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

use upstream nrjavaserial 3.15.0 on runtime #761

Merged
merged 3 commits into from
Apr 29, 2019
Merged

use upstream nrjavaserial 3.15.0 on runtime #761

merged 3 commits into from
Apr 29, 2019

Conversation

maggu2810
Copy link
Contributor

Fixes: #750

I see two possible fixes for #750:

  • use the upstream library all the time and drop the OH specific release of nrjavaserial
  • state that the OH nrjavaserial provides the specific capability (openhab.tp;feature=serial;impl=rxtx)

I don't know what's the difference between 3.15.0.OH2 of openHAB's nrjavaserial and 3.15.0 of the upstream one.
The nrjavaserial repository of openHAB does not contain any tag or commit that tells me anything about that.

So, let's wait for a reply to #750 (comment)

At the moment I switch to the upstream one in this PR, but we can also remain at the OH spefic one, if working with upstream of nrjavaserial is not possible.

@maggu2810
Copy link
Contributor Author

I updated this PR to provide two nrjavaserial features:

  • the upstream nrjavaserial that is using liblockdev
  • the openHAB modified one that does not use liblockdev

The openhab-transport-serial feature uses the openHAB modified nrjavaserial

@maggu2810
Copy link
Contributor Author

karaf@root()> feature:install openhab-transport-serial

This results into this bundles being installed:

241 │ Active   │  80 │ 3.15.0.OH2             │ mvn:org.openhab/nrjavaserial/3.15.0.OH2
242 │ Active   │  80 │ 2.5.0.201904271903     │ mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial/2.5.0-SNAPSHOT
243 │ Active   │  80 │ 2.5.0.201904271903     │ mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial.linuxsysfs/2.5.0-SNAPSHOT
244 │ Active   │  80 │ 2.5.0.201904271904     │ mvn:org.openhab.core.bundles/org.openhab.core.config.serial/2.5.0-SNAPSHOT
245 │ Active   │  80 │ 2.5.0.201904271901     │ mvn:org.openhab.core.bundles/org.openhab.core.io.transport.serial/2.5.0-SNAPSHOT
246 │ Active   │  80 │ 2.5.0.201904271903     │ mvn:org.openhab.core.bundles/org.openhab.core.io.transport.serial.rxtx/2.5.0-SNAPSHOT
247 │ Active   │  80 │ 2.5.0.201904271903     │ mvn:org.openhab.core.bundles/org.openhab.core.io.transport.serial.rxtx.rfc2217/2.5.0-SNAPSHOT

@maggu2810
Copy link
Contributor Author

@openhab-5iver Would you like to review that change?

@5iver
Copy link

5iver commented Apr 27, 2019

Would you like to review that change?

I have to run out (actually helping a friend setup OH!), and will be working on helper libraries tomorrow. I can take a look later in the week and do some testing!

Copy link
Contributor Author

@maggu2810 maggu2810 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To simplify the review process I added comments to the changes to explain why it has been done.

@@ -446,7 +446,7 @@
<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>nrjavaserial</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
Copy link
Contributor Author

@maggu2810 maggu2810 Apr 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just for testing (runtime POM is used in itests and for the Bnd based demo applications). I don't see any need to use a non upstream implementation there (we can consider to change it if someone needs it because he develop on an arm64 machine).

@@ -17,7 +17,6 @@
<properties>
<jetty.version>9.4.12.v20180830</jetty.version>
<jna.version>4.5.2</jna.version>
<nrjavaserial.version>3.15.0.OH2</nrjavaserial.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That property has not been necessary at all, as it is used at one place -- in the feature.
There is no "win" to define it here and reference in the feature.
We can define it in the feature.

Now the bundle declaration in the feature has been moved at all to another feature repository.

@@ -609,7 +609,7 @@
</feature>

<feature name="openhab-transport-serial" description="Serial Transport" version="${project.version}">
<bundle>mvn:org.openhab/nrjavaserial/${nrjavaserial.version}</bundle>
<feature>openhab.tp-serial-rxtx-noliblockdev</feature>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't inject external dependencies but use a "target platform feature".
We do not use dependency="true" here because we want to force the usage of that specific serial implementation.

@@ -154,7 +154,12 @@

<feature name="openhab.tp-serial-rxtx" version="${project.version}">
<capability>openhab.tp;feature=serial;impl=rxtx</capability>
<bundle>mvn:com.neuronrobotics/nrjavaserial/3.14.0</bundle>
<bundle>mvn:com.neuronrobotics/nrjavaserial/3.15.0</bundle>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump upstream nrjavaserial from 3.14.0 to 3.15.0.

<bundle>mvn:com.neuronrobotics/nrjavaserial/3.15.0</bundle>
</feature>

<feature name="openhab.tp-serial-rxtx-noliblockdev" version="${project.version}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a separate feature for the openHAB "no liblockdev" nrjavaserial.
The "important" point here is, that we also provide the specific capability, so our features know about the provided serial implementation.

@cweitkamp cweitkamp requested a review from wborn April 28, 2019 14:30
@kaikreuzer
Copy link
Member

With the input from @wborn, shouldn't we simply ONLY use 3.15.0.OH2 as it is a kind of pre-release of the official 3.16.0 and we know that it solves a few issues that otherwise occur?

@maggu2810
Copy link
Contributor Author

Hm, I am using nrjavaserial 3.14.0 on several systems (arm 32bit and x86_64) running Debian Stretch (9). So it works with liblockdev. If there is no functionality lost I can think about switching to the OH released one.
But if my reading has been correct there is no PR provided to upstream or any comment that liblockdev will be removed in the next version. But I have to admit that I did not read the whole referenced issue from the beginning to the end.

@maggu2810
Copy link
Contributor Author

@kaikreuzer I changed to provide only one nrjavaserial implementation (the OH one). I am looking forward to get the downstream changes merged upstream and to use that one after the next release.

@kaikreuzer kaikreuzer merged commit d2c7db6 into openhab:master Apr 29, 2019
@maggu2810 maggu2810 deleted the nrjavaserial branch April 29, 2019 21:18
Copy link

@5iver 5iver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maggu2810, when I first looked at this, I incorrectly thought that there was a jar I could build and test. What I ended up doing was shutting down OH, modified the distro-2.5.0-SNAPSHOT-features.xml file as in the two feature.xml files, cleared cache and tmp, and restarted OH. Everything seemed to come up without nrjavaserial 3.14.0, but zwave is still having the same issue where it will not startup with OH and requires restarting the binding to get it running. Zigbee (still using the old serial transport) came up fine.

So, I either made a mess of things, or showed that at least a portion of this PR will work, but does not fix the zwave issue.

Oh... this got merged!? Teaches me not to leave tabs open!

@@ -154,7 +154,12 @@

<feature name="openhab.tp-serial-rxtx" version="${project.version}">
<capability>openhab.tp;feature=serial;impl=rxtx</capability>
<bundle>mvn:com.neuronrobotics/nrjavaserial/3.14.0</bundle>

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used that empty line to separate the commented stuff from other lines.

<!-- See: https://github.com/openhab/openhab-core/pull/761 -->
<!-- See: https://github.com/openhab/openhab-core/issues/750 -->
<!-- <bundle>mvn:com.neuronrobotics/nrjavaserial/3.15.0</bundle> -->
<bundle>mvn:org.openhab/nrjavaserial/3.15.0.OH2</bundle>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be statically called, or should it be...

<bundle>mvn:org.openhab/nrjavaserial/${nrjavaserial.version}</bundle>

... like it was in the openhab-transport-serial?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version should be statically (I tried to already comment this in a self made review of my own changes).

@maggu2810
Copy link
Contributor Author

@openhab-5iver I did not have a look at some specific binding problem.
I just tried to solve "[nrjavaserial] Multiple versions".

After there is only one version the binding author can perhaps have a look at.

wborn added a commit to wborn/openhab-core that referenced this pull request May 25, 2019
When debugging openHAB in Eclipse I ran into serial port locking issues again on Ubuntu 18.04.2.
We resolved these in the distro by using 3.15.0.OH2 which doesn't use licklockdev.

Errors similar to the one below may show after stopping/restarting openHAB when using serial ports on certain distros:

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyUSB0: File exists. It is mine

testRead() Lock file failed

See also:
    openhab#761

Signed-off-by: Wouter Born <[email protected]>
wborn added a commit to wborn/openhab-core that referenced this pull request May 25, 2019
When debugging openHAB in Eclipse I ran into serial port locking issues again on Ubuntu 18.04.2.
We resolved these in the distro by using 3.15.0.OH2 which doesn't use liblockdev.

Errors similar to the one below may show after stopping/restarting openHAB when using serial ports on certain distros:

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyUSB0: File exists. It is mine

testRead() Lock file failed

See also:
    openhab#761

Signed-off-by: Wouter Born <[email protected]>
maggu2810 pushed a commit that referenced this pull request May 27, 2019
When debugging openHAB in Eclipse I ran into serial port locking issues again on Ubuntu 18.04.2.
We resolved these in the distro by using 3.15.0.OH2 which doesn't use liblockdev.

Errors similar to the one below may show after stopping/restarting openHAB when using serial ports on certain distros:

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyUSB0: File exists. It is mine

testRead() Lock file failed

See also:
    #761

Signed-off-by: Wouter Born <[email protected]>
@wborn wborn added this to the 2.5 milestone Jul 30, 2019
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
* add nrjavaserial without liblockdev
* use only one feature for a nrjavaserial implementation

Fixes: openhab#750

Signed-off-by: Markus Rathgeb <[email protected]>
GitOrigin-RevId: d2c7db6
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
When debugging openHAB in Eclipse I ran into serial port locking issues again on Ubuntu 18.04.2.
We resolved these in the distro by using 3.15.0.OH2 which doesn't use liblockdev.

Errors similar to the one below may show after stopping/restarting openHAB when using serial ports on certain distros:

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyUSB0: File exists. It is mine

testRead() Lock file failed

See also:
    openhab#761

Signed-off-by: Wouter Born <[email protected]>
GitOrigin-RevId: 060530a
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

Successfully merging this pull request may close these issues.

[nrjavaserial] Multiple versions
4 participants