openhab / org.openhab.binding.zigbee

openHAB binding for ZigBee
Eclipse Public License 2.0
73 stars 111 forks source link

Fix RFC2217 for Zigbee #661

Closed dschall closed 2 years ago

dschall commented 3 years ago

This change skips enumerating all available COM ports when rfc2217 is used. It also adds a call to flush() to both write() methods to make remote connections work. Finally, it refactors some of the exception handling to take into account that some calls may fail without bringing down the whole connection.

dschall commented 3 years ago

@cdjackson , not sure if you'll see new PRs automatically or if you need a ping..

cdjackson commented 3 years ago

Is it not possible to implement this in the serial implementation rather than the binding. That would also then (presumably) resolve it for other bindings as well without having to make this change everywhere?

dschall commented 3 years ago

I don't think it's possible to fix this in the serial implementation. We'll have to skip the call to serialPortManager.getIdentifiers() here, because RCF2217 ports can't be discovered, so we'll always get an empty list back if no other serial ports are available on the system (or they are in use already).

Plus, we'll have to make at least one change in this binding: RFC2217 won't work without the call to flush after writing.

giuliano-favro commented 2 years ago

Shall be also possible to use 'socket://' instead 'rfc2217'?

openhab-bot commented 2 years ago

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/solved-zwave-zigbee-rfc2217-remote-serial-port-howto/81633/123