Sorry if this question have already been ask but i didn't find the awnser. The problem is that if we lost the electricity, the router take more time to boot then the arduino so it fail to make a connection and i need to do a manual reset for it. Is therr a way or a command to reset the arduino if network fail to initialyse?
Thanks in advance
Better to check for successful initialisation and retry until it succeeds.
How to test for successful connection depends on whether you are using an Ethernet shield or a WiFi shield.
I use the ethernetshiel. I use the
ethernet.begin(mac, ip); in the void setup. And i use
if(ethernet.begin(mac) == o) could i put there a reset sketche and if so, how to??
No need to reset the Arduino. If the connection fails just keep trying until it succeeds as has been suggested.
I know what you mean but it's in the void setup, how could you loop it in the void setup? Could i initialise the ethernet from the void loop??
While (test for connection fails);
how could you loop it in the void setup?
Just like you would “loop it” in the loop() function.
while(Ethernet.begin(mac, IP) == 0)
// do nothing