Go Down

Topic: Software Reset with WiFi Shield (Read 1 time) previous topic - next topic


Hi, guys

I would like to be able to reset my Arduino WiFi Shield when the connection is dropped. I am currently using an Arduino R3 board. I have used the below procedure this works in resetting to the beginning of code however the WiFi Shield does not want to connect again after this code is run and I must re-upload the sketch

I call the function softReset when connection fails, this restarts arduino to beginning of sketch
void softReset(){
asm volatile ("  jmp 0");

then I use http://arduino.cc/en/Tutorial/EEPROMClear , to clear memory (1024 because arduino has this much eeprom http://arduino.cc/en/Main/arduinoBoardUno
for (int i = 0; i < 1024; i++)
    EEPROM.write(i, 0);


Try this

void(* resetFunc) (void) = 0


Software reset not reliable in arduino case. You can also do it by WDT


Also, don't destroy your eeprom cos your wifi disconnected.

Code: [Select]
for (int i = 0; i < 1024; i++){
  if( EEPROM.read(i) != 0 ){
    EEPROM.write(i, 0);

I'm not sure if EEPROM.write does this automatically, but it would be worth checking.
Forum Mod anyone?


Thanks for the help but,

Unfortunately the above reset function does not work. The code will reset and go back to the beginning on the program however, it will not reconnect to the WiFi network once the Arduino gets to that line of code. 


Without seeing your code it's really difficult to help you. 8)

Did you call WiFi.disconnect() before calling the reset function.


Jumping to address 0 does not do a hardware reset. Even if you did a hardware reset using the watchdog timer that will almost certainly not reset the WiFi shield.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up