When running it for the first time from exe file the dialogue “Add network…” does not appear with apparently no error, but running it from console there is an exception thrown because rxtxSerial.dll is not available. I installed that and could go further
Initially the same add network wizard gives an error that it cannot connect to the server - tried that several times with no success. I did try to connect to that debug port with a raw tcp client, I could do that. After closing my raw connection also the wizard could connect
I saw later that on openhab console there was an exception thrown continuously until I closed it. Unfortunately I have no log for that, but was something coming out from panstamp binding.
I’ll post the exception log here if I get it again
Here it is. Comes into opehnab console after I close the GUI
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_51]
at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_51]
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[na:1.8.0_51]
at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[na:1.8.0_51]
at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[na:1.8.0_51]
at java.io.InputStreamReader.read(Unknown Source) ~[na:1.8.0_51]
at java.io.BufferedReader.fill(Unknown Source) ~[na:1.8.0_51]
at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.8.0_51]
at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.8.0_51]
at me.legrange.swap.tcp.TcpTransport$Reader.run(TcpTransport.java:192) ~[na:na]
2015-10-05 23:51:31.329 [ERROR] [legrange.swap.tcp.TcpTransport] - null
Happens also when trying to connect from the same machine or a different machine
When running the client from the sme machine where rxtxSerial.dll was never installed, this problem does not appear. Only the exception at exit is still there.
I’m glad to see that there is finally a binding supporting panstamps in openhab. Thanks for the effort there.
I’m running openhab 1.7.1 on a raspberry pi which also has a shield for raspberry pi connected to it to act as a modem in a panstamp network.
Unfortunately I get the following error in openhab log when using your binding:
07:23:37.526 [DEBUG] [o.b.p.internal.PanStampBinding:248 ] - startNetwork()
07:23:37.554 [INFO ] [gnu.io.CommPortIdentifier :333 ] - static CommPortIdentifier:getPortIdentifiers()
07:23:37.585 [INFO ] [gnu.io.RXTXCommDriver :355 ] - RXTXCommDriver:initialize(), osName: Linux
07:23:37.599 [INFO ] [gnu.io.RXTXCommDriver :466 ] - scanning device directory /dev/ for ports of type 1
07:23:37.639 [ERROR] [o.b.p.internal.PanStampBinding:267 ] - Error reading modem settings for serial network on /dev/ttyAMA0: Could not find serial port ‘/dev/ttyAMA0’
Did I configure something wrongly?
Unfortunately I don’t have a free panstamp to give it a try with panstick connected to USB.
Does your openhab user belong to the dialout group?
sudo usermod -a -G dialout openhab
A normal “apt-get” install of openHAB runtime on Raspberry Pi should run as the openhab user, which will need permissions to access the serial port. Adding the openhab user to the dialout group usually achieves this.
I googled a bit and think that what happened to you is a known problem with Java serial IO on the Raspberry Pi. The binding uses nrjavaserial which is a fork of RXTX to do serial IO. It seems that RXTX and it’s derivatives assume that your serial port will be named /dev/ttySx or /dev/ttyUSBx and simply won’t pick up (they refer to enumerate) other ports. This is annoying given that you actually pass in the name of the port you want to use!
The recommended workaround is to pass the name of the serial port to Java using a property like
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
I like your solution however, it’s not like ttyS0 wil suddenly appear on the Pi since the hardware doesn’t exist.
I’m now using udev to automatically create a symlink from /dev/ttyS0 to
/dev/ttyAMA0 and it seems to be working quite well.
It seems that the binding is working in general but unfortunately I had
some issues with my client device and couldn’t test it properly yet.
Additionally it seemed I had huge performance issues yesterday that need
further investigation. It started after getting the panstamp binding
working but not sure whether it is really related to the binding.
I will give it a new try this evening and let you know.
I’ve updated the binding based on the code review @watou did, and also included a new version of the underlying panstamp library to fix some issues reported by the panstamp lead developer.
Hi,
I wanted to test this binding and i have an RGBdriver board.
Could you give me an example of how i could use it with openhab?
I found that of the product code i have to take is 1/3, but if i try to use the switch example I get unsupported command type OnOffType.