I’ve got Pimatic (current version 0.9.43) doing its thing for a couple of years now to great satisfactory. Thank you guys for that, i really hope the project stays alive.
Today when i got home my RF stuff wasn’t working anymore. Analyzing the logs, it seems to me that the connection with the Arduino got interrupted for just a short time:
Dec 28 15:18:34 raspberrypi kernel: [1775550.638095] usb 1-1.2-port2: disabled by hub (EMI?), re-enabling...
Dec 28 15:18:34 raspberrypi kernel: [1775550.638550] usb 1-1.2.2: USB disconnect, device number 5
Dec 28 15:18:34 raspberrypi kernel: [1775550.936066] usb 1-1.2.2: new full-speed USB device number 7 using dwc_otg
Dec 28 15:18:35 raspberrypi kernel: [1775551.080515] usb 1-1.2.2: New USB device found, idVendor=2341, idProduct=0043
Dec 28 15:18:35 raspberrypi kernel: [1775551.080534] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Dec 28 15:18:35 raspberrypi kernel: [1775551.080542] usb 1-1.2.2: Manufacturer: Arduino (www.arduino.cc)
Dec 28 15:18:35 raspberrypi kernel: [1775551.080550] usb 1-1.2.2: SerialNumber: 5563930393435161E0F1
Dec 28 15:18:35 raspberrypi kernel: [1775551.081799] cdc_acm 1-1.2.2:1.0: ttyACM1: USB ACM device
So the Arduino reconnects, but Pimatic isn’t aware of that because it’s now ttyACM1 instead of ttyACM0.
Of course pimatic-daemon.log says a few minutes later:
15:23:22.567 [pimatic-homeduino] warn: Couldn't connect (Serialport not open.), retrying...
Just restarting Pimatic doesn’t help:
17:55:46.989 [pimatic-homeduino] error: Couldn't connect to homeduino device: Cannot open /dev/ttyACM0.
After I rebooted the entire Pi things worked again.
What could have caused the short disconnection to the Arduino? It’s connected via a powered hub with no other usb devices on it.
How do i deal with this without rebooting the whole system?