Unable To Connect To Device when attempting to reprovision

I had sent a device to a friend as a learning/testing process. They were unable to successfully connect it to their network via the reprovisioning process and have sent it back to me for troubleshooting.

When I attempt to reprovision from two different phones and one tablet without success. I can see the Wifi network that it is broadcasting. However, while going through the reprovisioning process, the app says it has Connected and is getting device info. The app will sit at “Waiting for device online” before failing with “Unable To Connect To Device” after some time. I have tried following the suggestions here. The template name is only 14 characters long, fwiw.

This seems like something silly, but I’ve been stumped for a few hours. Thanks for any guidance.

Is the WiFi network broadcasting on 2.4 and 5GHz on the same SSID?
If so, then try setting-up an SSID that is 2.4GHz only and try connecting to that.

Have you made any changes, such as deleting/renaming the template that was originally used when you flashed the device?

I’m also a bit confused by your references to your friend’s setup.
Are they a part of your organisation?
Did they flash the device with new code then try to provision it, or did you do that?

Pete.

Is the WiFi network broadcasting on 2.4 and 5GHz on the same SSID?

No, I only have a 2.4GHz network active.

Have you made any changes, such as deleting/renaming the template that was originally used when you flashed the device?

No. I have also verified the template name on the Blynk site with what I have in my sketch.

I’m also a bit confused by your references to your friend’s setup.
Are they a part of your organisation?

No. As this is both of our first times to work with any of this, it is just my account. He is logged into it via his phone to try and reconfigure. He is located 4 hours away from me so I am trying to figure out how to get everything set-up here at my place, then ship it to him and have him reconfigure it for his network.

Did they flash the device with new code then try to provision it, or did you do that?

Initially, he did that, with my direction, but could not get anything to connect. He mailed it back to me and I’m attempting to get everything working again but am running into these difficulties.

For my own clarification and understanding: is the phone expected to disconnect from the Blynk device and then reconnect to the active wifi network? My phone will stay connected to the Blynk-XXXX network throuhout the process, but I believe it is failing when trying to verify the connection to the reprovisioned wifi. However, I could also be mistaken with how the process works.

What type of subscription do you have (free, maker, pro)?

Is the other person logging-in with your credentials, or are they invited to your organisation?

What process have you been through to reset the device? What board type is specified in your sketch, what settings do you have in Settings.h for that board type, and what physical board type are you using?

I’ve asked some of these questions before and you haven’t answered them, so unless you’re prepared to provide sufficient information it’s difficult to help you further.

Pete.

What type of subscription do you have (free, maker, pro)?

Free

Is the other person logging-in with your credentials, or are they invited to your organisation?

My credentials, as I only have a Blynk account for this one device at this time.

What process have you been through to reset the device?

I have held the flash button (see below) for reprovisioning. I have reflashed the device via Arduino IDE. I have also followed this tutorial in my attempts to troubleshoot.

What board type is specified in your sketch, what settings do you have in Settings.h for that board type, and what physical board type are you using?

In my sketch:

#define USE_NODE_MCU_BOARD

#include "BlynkEdgent.h"

What I believe to be the relevant information in the Settings.h file:

#if defined(USE_NODE_MCU_BOARD) || defined(USE_WEMOS_D1_MINI)

  #if defined(USE_WEMOS_D1_MINI)
    #warning "This board does not have a button. Connect a button to gpio0 <> GND"
  #endif

  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN               2
  #define BOARD_LED_INVERSE           true
  #define BOARD_LED_BRIGHTNESS        255

I’ve asked some of these questions before and you haven’t answered them, so unless you’re prepared to provide sufficient information it’s difficult to help you further.

My appoligies if I have missed a question. I believe have answered when asked in my only other thread, here and here. If I have missed a question please direct me to it and I will answer.

I hate it when people do this. Keep your discussion in ONE topic, oterwise it makes it much harder to help you!

You say that you’ve tried three different things, but given no detail regarding the outcomes of these processes, or any detail to go with them - for example, when pressing the GPIO1 button for 10 seconds what did you observe your LED doing, and what did you see in your serial monitor?

The RandomNetds tutorial is totall 7nnecessary. You can achieve the same thing by choosing “Erase flash : All flash contents” in the IDE when uploading your sketch.

If you’re having problems with provisioning a device after you’ve cleared the flash and re-uploaded your sketch then I assume that the issue probably lies with the two lines of firmware configuration code at the very top of your sketch. I’d re-copy this from your template settings in Blynk.

It could also be an issue with you using GPIO0 (D3) elsewhere in your sketch.

Pete.

I hate it when people do this. Keep your discussion in ONE topic, oterwise it makes it much harder to help you!

My deepest apologies. I thought about continuing on the same thread, but ultimately decided that while that thread was a question about how Blynk worked, this was a problem with my being able to connect the device back to my own network. They were different to my untrained mind. Again, apologies.

You say that you’ve tried three different things, but given no detail regarding the outcomes of these processes, or any detail to go with them - for example, when pressing the GPIO1 button for 10 seconds what did you observe your LED doing, and what did you see in your serial monitor?

The outcomes with all of my efforts thus far have been an inability to connect the device back to Blynk via my network. The LED flashes faster after holding the FLASH button for 10 seconds.

I have spent some time doing some more troubleshooting in order to try and narrow down the issue, as it seems that connecting to the network is the issue. I can connect to the device via my phone, and tablet, successfully. This sent me to the code.

I have found that loading a fresh, unchanged Blynk.Edgent example, except for my Template ID and Name, results in the provisioning process working successfully.

When I load my code is when things stop working. This is not surprising for me since I am trying to learn, but I am coming at this without a formal, guided starting point.

The RandomNetds tutorial is totall 7nnecessary. You can achieve the same thing by choosing “Erase flash : All flash contents” in the IDE when uploading your sketch.

Duly noted. Thank you.

If you’re having problems with provisioning a device after you’ve cleared the flash and re-uploaded your sketch then I assume that the issue probably lies with the two lines of firmware configuration code at the very top of your sketch. I’d re-copy this from your template settings in Blynk.

As mentioned above, I am attempting to troubleshoot on my end and can get the Blynk.Edgent sketch to connect to the Blynk template and come online without issue. I can trace the issue back to my own code.

Through my most recent troubleshooting, I think I have learned that both BlynkEdgent.run and Blynk.run do not need to be called. BlynkEdgent.run is all that’s required. Once I removed Blynk.run, the device connected without trouble and I was able to reprovision from other devices quite easily. I cannot speculate about when I inserted Blynk.run in addition to BlynkEdgent.run.

Correct. When using Blynk Edgent then you need BlynkEdgent.run() in your void loop, not Blynk.run()

Is your problem solved now?

Pete.

Yes. The device is now online in the new location. Thank you for your assistance.