This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Restart USB device?
#1
Hi,

On a LM4 I have an Arduino connected to the USB bus. The Arduino gets its power from the USB bus and acts as a serial device.

Every now and then, the Arduino gets stuck (for reasons that I have not figured out yet) and sends no more data to the LM.

I have two options then:
  1. unplug the Arduino from the USB bus and plug it back in, which restarts it
  2. reboot LM which has the same effect
I now have a scheduled script which checks every 5 minutes if the Arduino data get updated. If not, an Alert is sent and I then usually reboot the LM remotely.

I could change this script to reboot LM automatically but I wonder if there is a less intrusive way to restart the Arduino by manipulating the USB bus.

Thanks for your help.
Reply
#2
Arduino usually has automatic reset when the serial port is open. Check if restarting the script helps. You should also enable watchdog in your Arduino so it will reset itself if it hangs somewhere in the program.
Reply
#3
(24.03.2021, 09:51)admin Wrote: Arduino usually has automatic reset when the serial port is open. Check if restarting the script helps. You should also enable watchdog in your Arduino so it will reset itself if it hangs somewhere in the program.

I suppose by 'script' you mean the script that reads the Arduino data? That is also a scheduled script, so it gets restarted every 5 minutes... It does not reset the Arduino.
As for the watchdog: I have no real knowledge about Arduino's so I will have to inquire with the third party who provided the Arduino...
Thanks.
Reply


Forum Jump: