BlynkEdgent Based Sketch Cannot Connect to Wifi

Sorry, forgot to add that to my last post.
Yes I have tried rebooting the router.

Is your router configured to use a very small pool of IP addresses in its DHCP settings?
Is it possible that you’ve simply run-out of available IP addresses to be allocated?

Pete.

I don’t believe that to be the issue. I’ve tried it on 4 different networks at this point with the exact same error. I’ve rebooted all routers as well on all 4 networks.

On the off chance all those networks have run out of available IP’s… how would I even check that?

You’d need to check the DHCP pool range in the router config, then run an IP address scan tool to check which addresses are used. This would tell you if all the available addresses are used.

Seems more likely that your board’s WiFi circuitry is dead, or you have a power supply issue.
Have you tested with a simple (non Edgent) sketch?

Pete.

Hmmm, I’ll try another board.
I’ve tried mutiple power supplies as well with no difference.

I would have thought a board with a bad wifi circuit wouldn’t generate a “setup” network that my phone connects to when trying to provision the board but stranger things have happened I suppose.

I have a spare board at home I can try. I’ll update you this evening on my findings.

Actually, I’ll try a non-edgent sketch and see if it connects with that as you suggested, that way we will know if it is a circuit issue with the board for sure.

1 Like

So it isn’t wifi circuitry, a standard “non-edgent” sketch connects no problem.

Actually, I just migrated the exact same code to a non-edgent Blynk Example and it’s connected to my blynk cloud and visible.

Okay, you don’t have a board type un-commented, and you’re using GPIO0 for something.

Presumably the custom board configuration section of Settings.h looks like this…

#else

  #warning "Custom board configuration is used"

  #define BOARD_BUTTON_PIN            0                     // Pin where user button is attached
  #define BOARD_BUTTON_ACTIVE_LOW     true                  // true if button is "active-low"

  //#define BOARD_LED_PIN             4                     // Set LED pin - if you have a single-color LED attached
  //#define BOARD_LED_PIN_R           15                    // Set R,G,B pins - if your LED is PWM RGB
  //#define BOARD_LED_PIN_G           12
  //#define BOARD_LED_PIN_B           13
  //#define BOARD_LED_PIN_WS2812      4                     // Set if your LED is WS2812 RGB
  #define BOARD_LED_INVERSE           false                 // true if LED is common anode, false if common cathode
  #define BOARD_LED_BRIGHTNESS        64                    // 0..255 brightness control

#endif

So GPIO0 is being used by Edgent as your credentials reset pin. You should read this…

Pete.

I’m using a custom board that I have working perfectly with 2 other edgent based sketches.
That variable is actually for the pin state, not the pin itself. the pin for the switch can be seen on following line as:

const int realSwitchPin = 27;

I use GPIO 0 for my credential reset pin which has always worked flawlessly in the past and is the default credential reset pin used by the custom board setting.

Quick update. Tried an Edgent sketch with no modifications and no change. Still will not connect.

Just want to make a quick update, or more a lack of update.
I’ve uninstalled and re-installed the Blynk app on my phone. I’ve tried multiple boards and I can’t get any “new” sketches to connect to wifi through Edgent, same error as above.

What I find strange is that any of my currently functioning projects will update no issue OTA, or even over USB if I accidentally brick them so I can’t access over wifi anymore. They will accept the new firmware and boot back up on wifi no problem.

Any thoughts, is this worth submitting an issue on github at this point?

Have you tried enabling the “Erase All Flash Before Sketch Upload” option in the IDE (requires latest ESP32 core version I think).

Pete.

Hey Pete,

I can’t find that option in the IDE however I do have esptool.py installed and I just used it to wipe one of my boards (successfully according to the esptool.py output).

I then tried to upload a blank Edgent example with only the needed template id and device token.

Same result. Accepts the credentials during provisioning and then hangs before re-booting itself and spitting out this on the serial monitor (wifi credentials removed for security):

[37745] WAIT_CONFIG => CONFIGURING
[37745] Sending board info...
[70245] Applying configuration...
[70246] WiFi SSID: "xxxxxx" Pass: xxxxx
[70246] Blynk cloud: 44umGRSLrh_beEJmSOWFj8ebNME0vrhi @ blynk.cloud:443
[70250] CONFIGURING => SWITCH_TO_STA
[70252] Switching to STA...
[71363] SWITCH_TO_STA => CONNECTING_NET
[71363] Connecting to WiFi: "hotchs"
[121364] Last error code: 701

One more thing I tried to isolate the issue from the board or network:
I flashed Tasmota firmware to the device and successfully connected to a wifi network.
The same device will not connect to the same network using Blynk.Edgent provisioning.

You aren’t doing anything weird with template or device names, such as editing them after they’ve been assigned, are you?

Pete.

Hey Pete,

No nothing weird. Normal template and device names. I’ve tried making a new device template, tried using a pre-existing template and adding a new device, doing full flash wipes using esptool.py in between to make sure nothing is left to cause an issue in flash.

The part that is really confusing me is that I have two devices running that uses this exact same board, with Edgent based sketches that work perfectly, including OTA. But if I try and flash that same sketch onto a “fresh” board of the same design, I get this error. The Blynk library version hasn’t changed either since my last successful flash.

@PeteKnight (sorry for the tag, it didn’t appear to attach this reply correctly and wanted to make sure you saw it)

Problem identified, but not solved.

I recently replaced my phone after it suffered an unfortunate accident being run over by my truck. The phone itself still functioned at a base level but the screen was shattered, the camera shattered and the frame of the phone itself has a visible twist.

My old phone was a Pixel 5, my new phone is a Pixel 7.

As an experiment, I fired up my old phone and attempted to provision one of these Edgent using the Blynk app on my old phone. The process worked flawlessly and the device connected.

So something has changed between the Pixel 5 and the Pixel 7 in a way that breaks the Edgent provisioning process.

Is this something to tag the Blynk Devs in do you think or is it something that I should file a github issue for?

Just too add additional info, both phones are running Android 13 as an OS.

@BlynkAndroidDev one for you to look at?

Pete.

We seem to have fixed the issue. I’m planning tomorrow to upload a 1.7.4 version with a fix to this issue and another one from community reports.

Thanks for looking into this and the quick fix!