USB and Files

I am creating a Scheduling System for some light fixtures. It consists of 35 buttons that can be programmed to turn on,off,ramp etc… any fixture in the building. The interface from the RPI3 uses a trendnet USB to serial. I created an autostart file in /lib/systemd/system using method 4 or systemd from this page .
The problem i am having is that when the USB is plugged in the file system service doesn’t load the button data on autostart. Buttons show but labels within the buttons are gone as well as file data. When the usb is unplugged and rebooted everything comes up normally.

The question is what do i put in the unit file beyond what Step 4 or systemd from the link above that allows me to use the USB and still load the button data.

I’m suspecting that i would need “After=” . I’m not a linux or RPI person so any help would be appreciated.


You need to run you app, and check if the serial port has become available or maybe use the MBS plugins to see if the USB device is plugged in. If not the sleep for a while for example.

If it’s plugged in, you can open the serial port and resume. I don’t think there is a specific systemd target for your usb device. As it’s hot pluggable.

It’s also possible to use the shell class and parse the “lsusb” command to see if your device is plugged in then check if the serial port is available.

Thanks, found the problem. Been programming for years and still make dumb mistakes.