hmm cant find this “file”, can you show me a console output
Bundle Management
a vendor and technology agnostic open source automation software for your home
hmm cant find this “file”, can you show me a console output
Have you tried reading the port as the openhab user inside the container?
su - openhab -c 'cat /dev/ttyUSB0'
Just a thought, it may reveal an error, or confirm that the permissions are not the issue.
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.
See here.
this works wihtout a problem:
root@openhab:/openhab# su - openhab -c ‘cat /dev/ttyUSB0’
0;255;3;0;9;10027 TSM:FAIL:RE-INIT
0;255;3;0;9;10030 TSM:INIT
0;0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGA—,REL=255,VER=2.3.1
0;255;3;0;9;5 TSM:INIT
0;255;3;0;9;7 TSF:WUR:MS=0
0;255;3;0;9;14 !TSM:INIT:TSP FAIL
0;255;3;0;9;17 TSM:FAIL:CNT=1
0;255;3;0;9;20 TSM:FAIL:DIS
0;255;3;0;9;22 TSF:TDI:TSL
Please post logs and code using code fences, it makes them easier to read. There are buttons above the edit box for a post to insert them for you.
This is interesting, it sounds like you’re missing a driver possibly? Or you’ve specified the wrong thing in your Java extra options?
Also for the record I have yet to use any serial bindings, but I do run openhab in docker. I’m just coming at this with general diagnostic questions.
I need the serial interface for the MySensor Binding. The instruction I used is from here:
In my testing I found things usually worked when starting OH but failed when a binding was restarted. It could not find the serial port.
Are you running the latest version of the binding?
Is nrjavaserial (bundle) running in openHAB?
Yes it is the latest version and yes it is runing:
openhab> bundle:list -s | grep serial
259 │ Active │ 80 │ 3.14.0 │ com.neuronrobotics.nrjavaserial
260 │ Active │ 80 │ 3.15.0.OH2 │ com.neuronrobotics.nrjavaserial
261 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial
262 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs
263 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.serial
264 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial
265 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx
266 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx.rfc2217
Why are there 2 versions running?
I’m out of ideas and time this morning. Maybe try searching the forum for “serial port not found” or similar, not involving MySensors.
@CrazyIvan359 as mentioned by @Bruce_Osborne
Try using the console stop/remove one of them, could be a conflict not seen in logs, see if that helps.
They may need to restart OH too? I duobt just stopping a bundle would be sufficient. Is there a way to stop a bundle from auto-starting with OH?
Not that I know of.
Just pick the one you want to use, then from the console use
bundle:uninstall to remove the other.
With the extra complexity I would try a few things to troubleshoot. First - if you don’t have it already I’d grab the Portainer docker app and run it. This is a web admin GUI for docker and it will allow you to not only edit / redeploy current containers but also enter a command shell within the container itself. This way you can confirm the serial port is there and accessible within the container. If all is well there then you can go on to troubleshooting openHAB. When jumping into the container you can go in as root so all permissions should be fine - as long as docker is running as a user with access to the ports. From what I see In your config I’d just confirm that you have the group IDs matching and openhab is running as a user with access to the tty ports
When I do this both bundles will disappear…
openhab> bundle:list -s | grep serial
261 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial
262 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs
263 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.serial
264 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial
265 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx
266 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx.rfc2217
278 │ Active │ 80 │ 3.14.0 │ com.neuronrobotics.nrjavaserial
279 │ Active │ 80 │ 3.15.0.OH2 │ com.neuronrobotics.nrjavaserial
openhab> bundle:uninstall com.neuronrobotics.nrjavaserial
openhab> bundle:list -s | grep serial
261 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial
262 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.discovery.usbserial.linuxsysfs
263 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.config.serial
264 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial
265 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx
266 │ Active │ 80 │ 0.10.0.oh240 │ org.eclipse.smarthome.io.transport.serial.rxtx.rfc2217
Use the bundle number 278 or 279 to identify the one to remove. a vendor and technology agnostic open source automation software for your home
Bundle Management
With the extra complexity I would try a few things to troubleshoot. First - if you don’t have it already I’d grab the Portainer docker app and run it. This is a web admin GUI for docker and it will allow you to not only edit / redeploy current containers but also enter a command shell within the container itself. This way you can confirm the serial port is there and accessible within the container. If all is well there then you can go on to troubleshooting openHAB. When jumping into the container you can go in as root so all permissions should be fine - as long as docker is running as a user with access to the ports. From what I see In your config I’d just confirm that you have the group IDs matching and openhab is running as a user with access to the tty ports
I already use Portainer and yes I can connect to the docker container and can manualy read from ther serial port by using cat /dev/ttyUSB0
Use the bundle number 278 or 279 to identify the one to remove.
Bundle Management | openHAB
Ok that worked one of the bundles is now removed however still no luck
15:36:03.098 [ERROR] [ocol.serial.MySensorsSerialConnection] - No such port: /dev/ttyUSB0
gnu.io.NoSuchPortException: null
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[283: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) [?:?]
Did you restart OH after removing the bundle?