Arduino MKR1000 error 702

Arduino MKR1000 wifi
Smartphone Android
Blynk Server
Library version 1.1.0

Hi all,
I have for a long time more than 3 projects created for my home automation in local mode, but from what I have read I must necessarily switch to Blynk.cloud. My hardware is different, Arduino Mega, 3 NodeMcu V3 boards and one Arduino MKR1000 board. I start right from the latter to understand how to migrate my sketches, but I immediately had the problem that I noticed they all have: when I try to connect my arduino board to the wifi I get the error 702. I saw that Pete published a diagram on how to do the right provisioning of the cards, but no mention of the MKR1000. Can you help me? The sketch is naked, it only has a virtual pin for testing


#define BLYNK_TEMPLATE_ID "TMPLh6x75txD"
#define BLYNK_DEVICE_NAME "BOX"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

#include "BlynkEdgent.h"

void setup()
{
  Serial.begin(115200);
  delay(2000);

  BlynkEdgent.begin();
}
BLYNK_WRITE(V4) {   //BOX
  int var = param.asInt();
  if (var == 0) openBox();
}

void openBox() {
  digitalWrite(14, LOW);
  delay(1500);
  digitalWrite(14, HIGH);
  Serial.println("BOX IN MOVIMENTO");
}

void loop() {
  BlynkEdgent.run();
}

you’re using the MKR1000 example right ?

Yes, i writed version of uploaded library.

I guess it’s something has gone wrong with your Arduino SAMD Boards installation, I’d suggest completely uninstall it then reinstall the latest version.

I try also, removed all data of Arduino, library and sketch…same problem!

With new installation, arduino ask me to install these libraries:

  • ArduinoOTA, got it from Arduino Library, last version installed
  • WiFi101, got it from Arduino Library, last version installed
  • FlashStorage, got it from Arduino Library, last version 1.0.0
  • Timer5, got it from github.com

That’s because I don’t own any of the Arduino MKR range of boards, I use NodeMCU, Wemos D1 Mini and ESP32 boards

Personally, I’d suggest that you start with the NodeMCU boards that you own. I’d also migrate away from the Mega if at all possible.

Pete.

Sorry but it’s impossible, in arduino mega I have 52 pins occupied, tens and tens of meters wired, and hundreds of lines of arduino code connected to blynk local, as well as 3 additional Nodemcu boards to Arduino Mega, all connected to my home. I cannot settle for an answer that says to abandon the Arduino Mega. But I’ll do a test with my Nodemcu

Okay. It’s obviously possible to migrate away from your Mega hardware if you wish to do that, but you clearly don’t want to.

You won’t be able to use Edgent with your Mega, and TBH I’m not sure why you’re using Edgent for the rest of your project if you aren’t really interested in the enhances functionality that comes with it.

Pete.

My need is to continue using blynk as I structured it by migrating to the new blynk.cloud platform in the simplest way possible. The how does not matter, the important thing is that I solve.
I’m probably doing something wrong, my devices are already connected to wifi and lan, maybe provisioning is not needed?

From what you’ve said, dynamic provisioning is not needed.

Do any of your sketches use Blynk Notifications, Emails, or RTC?

Pete.

yes have a blynk notification,
i read this link https://docs.blynk.io/en/blynk-1.0-and-2.0-comparison/migrate-from-1.0-to-2.0
explaine your question. Right?
Is there a page with more detailed explanations?

Relating to Notifications?
Try this…

Pete.

Oh, good now work!
So to summarize and help others too.
If you need to migrate projects from the old Blynk 1.0, provisioning is not required.
Just add the information of BLYNK_TEMPLATE_ID, DEVICE NAME and AUTH TOKEN
It is necessary to change the cloud server in the code:
Blynk.begin (auth, ssid, pass, “blynk.cloud”, 80);
Now I see my device online.
And some tricks for notifications in the link shown
Correct Pete?

You wouldn’t normally explicitly name the server, so Blynk.begin (auth, ssid, pass); would also work fine.

These two items need to be the first two lines of code in your sketch, otherwise the compiler will attempt to connect to the Legacy cloud server (unless you specifically name the IoT cloud server in the Blynk.begin command).

Pete.