Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround causes serial port discovery issues #577

Open
wborn opened this issue May 13, 2020 · 8 comments
Open

Workaround causes serial port discovery issues #577

wborn opened this issue May 13, 2020 · 8 comments

Comments

@wborn
Copy link
Member

wborn commented May 13, 2020

The binding currently uses serialPortManager.getIdentifiers() to see if there are any SerialPortIdentifiers.

This workaround was added in #335 by @triller-telekom.

The workaround causes serial port detection issues because the getIdentifiers() method will only return discovered ports.

As a result:

  • Undiscovered (non-standard) RXTX ports will not work this way (e.g ports defined in udev rules), the transport adds undiscovered ports to gnu.io.rxtx.SerialPorts so they can be used without users having to configure this
  • RFC2217 ports cannot be used because there is no discovery logic for these ports.

We've upgraded nrjavaserial in OH3 so we should retest if this is still an issue.
We should also test if it is fixed with nrjavaserial 5.1.0+ because it contains fixes for hardware that gets removed.

If this is no longer an issue we should remove the workaround by instead detecting that a controller is disconnected by just opening the port and handling any resulting exceptions.

If it is still an issue, we should create an issue for it in the nrjavaserial issue tracker with a reproduction scenario. That way we can fix the root cause and don't need to add such workarounds (causing discovery issues) to other add-ons.

Related to:

@wborn
Copy link
Member Author

wborn commented May 22, 2020

The crash/exit can also be reproduced with other USB devices and will probably be resolved when NeuronRobotics/nrjavaserial#180 is fixed.

wborn added a commit to wborn/openhab-core that referenced this issue May 27, 2020
With this version it will no longer completely exit the JVM in certain scenarios when ports are closed/reopened.

Related to:

* openhab/org.openhab.binding.zigbee#577
* openhab/org.openhab.binding.zwave#1332

Signed-off-by: Wouter Born <[email protected]>
cweitkamp pushed a commit to openhab/openhab-core that referenced this issue May 27, 2020
With this version it will no longer completely exit the JVM in certain scenarios when ports are closed/reopened.

Related to:

* openhab/org.openhab.binding.zigbee#577
* openhab/org.openhab.binding.zwave#1332

Signed-off-by: Wouter Born <[email protected]>
@wborn
Copy link
Member Author

wborn commented May 27, 2020

The workaround can be removed in OH3 because nrjavaserial 5.2.1 no longer exits the JVM in certain scenarios when ports are closed/reopened.

@cdjackson
Copy link
Contributor

nrjavaserial 5.2.1 no longer exits the JVM

Unfortunately that's not true on a Mac at least.

@openhab-bot
Copy link
Collaborator

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

https://community.openhab.org/t/success-with-sonoff-zigbee-bridge-and-zigbee-binding/104985/81

@openhab-bot
Copy link
Collaborator

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

https://community.openhab.org/t/oh3-zigbee-binding-not-working-with-rfc2217-port/115711/2

@moodyblue
Copy link

moodyblue commented Feb 5, 2021

It would be good if this can be fixed. Sonoff ZBBridge can be used with zigbee binding, but only with socat because RFC2217 does not work.

@wborn
Copy link
Member Author

wborn commented May 7, 2021

Unfortunately that's not true on a Mac at least.

Hopefully your Mac issue will be fixed by NeuronRobotics/nrjavaserial#211

@dschall
Copy link
Contributor

dschall commented Jul 8, 2021

I've created a PR to make Zigbee work with RFC2217:
#661

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 11, 2023
With this version it will no longer completely exit the JVM in certain scenarios when ports are closed/reopened.

Related to:

* openhab/org.openhab.binding.zigbee#577
* openhab/org.openhab.binding.zwave#1332

Signed-off-by: Wouter Born <[email protected]>
GitOrigin-RevId: 5b325aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants