I am starting my 3rd project using BLYNK. I have two working perfectly. I have an Arduino Mega with a network shield. Exactly the same configuration and hardware as the other 2 working projects.
One other project is on the same local network as the one I am developing. I used the same sketch as on the working one. I enabled BLYNK debug and get the following (I have some debug instructions as well)
Starting Up
Starting Blynk
[62452] Getting IP…
[122905] DHCP Failed!
Starting Up
Starting Blynk
[62453] Getting IP…
[122906] DHCP Failed!
The strange thing is it restarts the Mega every 30 seconds or so. It never gets to the loop. I need some code to prevent BLYNK to restart the system and how to make it work. I have identical hardware on 2 other systems and they have been performing for more than a month now.
My guess is that you’re using the same MAC address on both devices, which is confusing your router and preventing the router from handing-out an IP address via DHCP.
Thanks Pete. I tried different MAC addresses but no luck. I am beginning to suspect a hardware issue. I will try with just plain internet connection and see if it works.
Any idea why the Blynk restarts the Setup routine when it fails to connect?
Turns out it was a hardware issue. After some research I found the a batch of the Ethernet shields were made with incorrect resistor and fails to connect.
I received a new one (from a different manufacturer) and it issues an IP address immediately however now it fails to connect to Blynk. It still restarts the SetUp loop during the connect process.
I checked Auth code and made sure the app is running on my iphone. It never gets past the BLYNK.begin(auth); statement.
This is what I get:
Starting Up
Ethernet SetUp 536979648
Starting Blynk
[7233] Getting IP...
[9507] IP:192.168.1.33
[9508]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.1 on Arduino Mega
[9620] Connecting to 222.205.174.186
[41800] Connecting to 222.205.174.186
[73949] Connecting to 222.205.174.186
[106096] Connecting to 222.205.174.186
[138245] Connecting to 222.205.174.186
[170394] Connecting to 222.205.174.186
[202529] Connecting to 222.205.174.186