Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Docker in limbo after serial interruption #111

Open
madejackson opened this issue Aug 14, 2024 · 0 comments
Open

[BUG] Docker in limbo after serial interruption #111

madejackson opened this issue Aug 14, 2024 · 0 comments

Comments

@madejackson
Copy link

So I am trying to use mbusd inside a docker container on a rpi4. So far it works perfectly fine apart from one issue:

When the connection to the serial port gets interrupted, the process stops working / stops accepting connection from modbusTCP-clients.

For my testing I used home assistant which underlying uses pymodbus to connect to mbusd in a seperate container.

mbusd thinks it reconnects successfully, but because the device link to the host is broken, only a restart of the container actually fixes it.

Example log from container when the serialport-connection gets interrupted:

2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty: error in read() (port closed)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty: trying to open /dev/ttyModbus (speed 9600 mode 8N1)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty_reopen(): can't open tty device /dev/ttyModbus (No such device or address)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty: trying to open /dev/ttyModbus (speed 9600 mode 8N1)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty_reopen(): can't open tty device /dev/ttyModbus (No such device or address)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty: trying to open /dev/ttyModbus (speed 9600 mode 8N1)
2024-08-14 09:32:24
14 Aug 2024 09:32:24 tty_reopen(): can't open tty device /dev/ttyModbus (No such device or address)
2024-08-14 09:32:25
14 Aug 2024 09:32:25 tty: trying to open /dev/ttyModbus (speed 9600 mode 8N1)

corresponding logs from host, when the serialports lose connection and reconnect:

Aug 14 09:32:24 xxxx kernel: usb 1-1.3: USB disconnect, device number 7
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: new full-speed USB device number 8 using xhci_hcd
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: New USB device found, idVendor=xxxx, idProduct=xxxx, bcdDevice= 2.00
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: Product: xxx
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: Manufacturer: xxx
Aug 14 09:32:24 xxxx kernel: usb 1-1.3: SerialNumber: xxx
Aug 14 09:32:24 xxxx kernel: cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
Aug 14 09:32:24 xxxx kernel: cdc_acm 1-1.3:1.2: ttyACM1: USB ACM device
Aug 14 09:32:24 xxxx kernel: cdc_acm 1-1.3:1.4: ttyACM2: USB ACM device
Aug 14 09:32:24 xxxx kernel: cdc_acm 1-1.3:1.6: ttyACM3: USB ACM device

I think I try to do an new docker image with healthchecking via pymodbus and do a restart when the serialport gets broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant