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

nrjavaserial in OH2.5 #171

Closed
mstormi opened this issue Jun 3, 2020 · 6 comments
Closed

nrjavaserial in OH2.5 #171

mstormi opened this issue Jun 3, 2020 · 6 comments

Comments

@mstormi
Copy link
Contributor

mstormi commented Jun 3, 2020

OH 2.5 on Java 11 is suspected to fail on using the serial interface because of an older version of the nrjavaserial library to cause this.
While a newer fixed version of the lib exists -confirmed to work with OH3-, unfortunately as the OH core is frozen this will not be put to use with OH 2.5 any more by means of OH packages.
@wborn has provided a "back-versioned" nrjavaserial to work with 2.5 at https://github.com/wborn/nrjavaserial/releases/download/reversioned521/nrjavaserial-3.15.0.OH2.jar but AFAIK it has not yet found its way into 2.5 where we're just asking people to test-drive Java 11.

I'd like you to include this with the current OH2.5 packages.

FWIW, here's my openhabian script sniplet.

But I think you could simply replace the jar at its location.

## switch nrjavaserial lib used in openHAB
## arguments "backport", "orig"
##
select_nrjavaserial() {
  local pass=habopen
  local client=${OPENHAB_RUNTIME}/bin/client
  local url=https://github.com/wborn/nrjavaserial/releases/download/reversioned521/nrjavaserial-3.15.0.OH2.jar
  local location=/usr/share/openhab2/runtime/system/org/openhab/nrjavaserial/3.15.0.OH2
  local origbundle=nrjavaserial-3.15.0.OH2.jar
  local newbundle=nrjavaserial-3.15.0.OH2-wborn.jar

  if [[ "$1" == "backport" ]]; then
    wget -O "${location}/${newbundle}" "${url}"
    cmd="bundle:update $id file:${location}/${newbundle}"
  elif [[ "$1" == "orig" ]]; then
    cmd="bundle:update $id file:${location}/${origbundle}"
  fi
  id=$($client -p "$pass" "bundle:list | grep nrjavaserial" | tail -1|cut -d' ' -f1)
  $client -p "$pass" "$cmd"
}
@wborn
Copy link
Member

wborn commented Jun 3, 2020

AFAIK it only crashes with Java 11 on Windows (openhab/openhab-core#1384).

nrjavaserial 5.2.1 has a file descriptor leak NeuronRobotics/nrjavaserial#111 so instead increasing stability you might decrease it with this new version. 😉

@mstormi
Copy link
Contributor Author

mstormi commented Jun 3, 2020

Ooookay ... so is OH 2.5 to crash on LINUX Java 11 due to serial fake news or worth pursuing ?

@wborn
Copy link
Member

wborn commented Jun 3, 2020

It might be a misinterpretation of words if it's based on this comment by @J-N-K who uses Windows IIRC.

@mstormi
Copy link
Contributor Author

mstormi commented Jun 3, 2020

No @J-N-K told me in further private communication that it's about Windows only and that he has no knowledge about crashes on Linux. But I thought I read it elsewhere, too.
So Wouter you also are not aware of Linux serial crashes/exceptions ?

@wborn
Copy link
Member

wborn commented Jun 3, 2020

I have never seen nrjavaserial crash on Linux with Java 11. So it would be nice to know who did see it crash and what JVM/architecture/OS/32|64-bit combo this is.

@mstormi
Copy link
Contributor Author

mstormi commented Jun 3, 2020

ok so I'll put this issue here on hold.
Should we get feedback as part of our Java testdrive then I'll let you know.

@mstormi mstormi closed this as completed Jun 3, 2020
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

2 participants