i am using an arduino UNO R3 in an installation.
The used application communicates with the device via the usb/serial.
Now i am wondering if it is possible to "reboot" the arduino in case something goes wrong.
I am using the plain Arduino IDE compiling, so i never got into the avr-binary options.
But i guess it should be possible by using avrdude or somthing similar?
Thanks a lot!
You would only need to use avrdude if you need to upload another program and that should never be necessary just because of a code malfunction.
You can include the WatchDog timer in your code if you are concerned that, for example, something might get in an endless loop. The WatchDog timer will restart the Arduino after a short time unless it is told not to by the properly functioning program.
You could also connect a physical switch that mimics the reset switch on the Arduino board if you are happy with human intervention.
I see then.
So there is no way to restart / reset the board with software from the computer side?
If the "used application" can direct the USB/Serial adapter to create a low on the DTR signal, that could be used to reset the Arduino, the same as the IDE does when a File:Upload occurs.
I don't know how that is done, and I imagine it's further complicated by whether the USB/Serial interface is performed for example by Atmega8U2/16U2 on Uno and Mega2560, FTDI FT232 on Nano and Promini, Atmega32U4 on Leonardo and Micro/ProMicro, etc., or some other chip (CP2102, CH340 (430?) and other that is turning up on clones).
Building on what @CrossRoads said, you could perhaps arrange for your PC program to close and reopen the serial port.
In my earlier reply I was assuming (probably incorrectly) that you wanted a solution independent of the PC.
Thanks for all the good intel.
Well, the application i am using actually does open the serial port on boot.
The arduino itself then boots the rfid shield it is using on setup.
in most cases this works fine. however sometimes, the rfid-shield reports a problem.
in that case i need to restart the board.
unfortunately i use an external library for the arduino serial communication, so i cannot directly access and close the port.
thus the idea of a second solution which actively resets the boars.
it seems i should look into the library again to make sure the serial port gets handled correctly.
This library provides a way to reset your arduino from software. See pdf attachment below for details. Hope it helps
leOS - user guide.pdf (291 KB)