tobof / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
39 stars 30 forks source link

Failed to connect on port: /dev/ttyUSB20... #20

Closed SingleDadLiving closed 7 years ago

SingleDadLiving commented 8 years ago

I'm not sure if this is a bug or just an issue with the user (me).

I'm running the newest OH2 and the newest MySensors binding on a RPi2 with my nrf24l01+ connected directly to the RPi and I'm running PiGatewaySerial

After trying a million things I think I'm close to getting it working, except I keep getting an error saying failed to connect to port.

I've tried /dev/ttyUSB20, /dev/ttyMySensorsGateway and /dev/pts/0 - I've also tried various permissions combinations, and nothing seems to do the trick.

Here is my things setup: Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/ttyUSB20", sendDelay=200, baudRate=115200, skipStartupCheck=true ] { humidity hum01 [ nodeId="2", childId="0" ] temperature temp01 [ nodeId="2", childId="1" ] }

Here is my error log 11:49:30.930 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors Bridge 11:49:30.933 [DEBUG] [col.serial.MySensorsSerialConnection] - Connecting to /dev/ttyUSB20 [baudRate:115200] Failed to connect on port: /dev/ttyUSB20 exception: gnu.io.NoSuchPortException at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) at gnu.io.NRSerialPort.connect(NRSerialPort.java:48) at org.openhab.binding.mysensors.protocol.serial.MySensorsSerialConnection.connect(MySensorsSerialConnection.java:56) at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:92) at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:182) at org.eclipse.smarthome.core.thing.internal.ThingManager$5.call(ThingManager.java:542) at org.eclipse.smarthome.core.thing.internal.ThingManager$5.call(ThingManager.java:1) at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 11:49:30.986 [ERROR] [col.serial.MySensorsSerialConnection] - Can't connect to serial port. Wrong port? 11:49:31.028 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing 'mysensors:bridge-ser:gateway' has been updated.

SingleDadLiving commented 8 years ago

ok, I think I fixed it, I changed the permissions of /dev/pts/0 to pi:pi, and it works.... but I don't think that solution will last through a reboot. Any better suggestions?

andreacioni commented 8 years ago

Try link USB20 to S80 through udev rule