I’ve read probably 20 threads about this problem here in the forum and on the internet but still I can’t get it working…
I use the binding MySensors. The instillation went well and I could add the Port Settings in the PaperUI.
However I get this error:
06:13:46.071 [DEBUG] [ocol.serial.MySensorsSerialConnection] - Connecting to /dev/ttyUSB0 [baudRate:115200]
06:13:46.072 [ERROR] [ocol.serial.MySensorsSerialConnection] - No such port: /dev/ttyUSB0
gnu.io.NoSuchPortException: null
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[260:com.neuronrobotics.nrjavaserial:3.15.0.OH2]
at org.openhab.binding.mysensors.internal.protocol.serial.MySensorsSerialConnection.establishConnection(MySensorsSerialConnection.java:51) [275:org.openhab.binding.mysensors:2.4.0.201812040738]
at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection.connect(MySensorsAbstractConnection.java:148) [275:org.openhab.binding.mysensors:2.4.0.201812040738]
at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection.run(MySensorsAbstractConnection.java:127) [275:org.openhab.binding.mysensors:2.4.0.201812040738]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
OpenHab is running in a docker container with those additional arguments:
I think I once read that when using Docker the ports may not be immediately available and sleeping a couple of seconds before starting OH may help by adding a startup script:
Does it also work if you restart the binding again using the Console? If so, the binding may be missing serial port reconnection logic which would make it a lot more stable.
If it never works it may also be a permissions problem or Docker configuration problem. On some Synology NASes you also need to load extra kernel modules for serials comms to work.
It has never worked yet (just trying now for 2 days)
Its a normal server no NAS etc with an Intel Xeon processor running in VM.
But why can I read data (with cat) in the docker itself but openhab can’t?
Have you added that port to the EXTRA_JAVA_OPTS in the start.sh file? I recently went through some port troubleshooting and found this in the OH documentation.
so I made a new docker file to test if it would work. However I’m not sure how to add the Paramter to the start.sh file. My Start.sh file now looks like this:
I have also had success adding the OPTS string to /etc/default/openhab2 configuration file to resolve my test issue That file needs to be edited as root
From what I understand from a GitHub issue I opened for a different binding, there are different ways the binding uses to access the serial port device.