OpenHAB And Zwave
#12
This is a fun rabbit hole.
1) Installed Gradle
- sudo apt install gradle
2) installed Git
- sudo apt install git
3) downloaded project to /home/openhab as described on GIT repo
- git clone https://github.com/NeuronRobotics/nrjavaserial.git
4) Thought I'd look up how to activate UART2, found this post
- http://forum.pine64.org/archive/index.ph...d-648.html
5) Realized I needed the dtc command, tried "device-tree-compiler" and it seemed to work
- sudo apt install device-tree-compiler
6) re-tried enabling UART2
- sudo mv /boot/pine64/sun50i-a64-pine64-plus.dtb /boot/pine64/sun50i-a64-pine64-plus.dtb-ORIG
- sudo dtc -I dtb -O dts -o sun50i-a64-pine64-plus.dts /boot/pine64/sun50i-a64-pine64-plus.dtb-ORIG
- sudo vi sun50i-a64-pine64-plus.dts
7) realized the status was already "okay"
8) tried to build project (took a few minutes)
- cd nrjavaserial
- gradle build
9) needed Make
- sudo apt install build-essential
10) attempt make again
- make arm
11) Backup openhab
- cd /opt
- sudo cp -R openhab openhab_bak
12) stop openhab
- sudo service openhab
13) Realize that 'make arm' failed,
- In file included from src/fuserImp.c:4:0:
./include/target/gnu_io_CommPortIdentifier.h:2:17: fatal error: jni.h: No such file or directory
- Tried to install jni packages through apt (didn't work)
- Noticed the messages were saying "-I/usr/lib/jvm/java-6-openjdk-armhf/include/", I didn't have openjdk 6 installd (its not avaible via apt)
14) modified src/main/c/Makefile on line 20
- add "-I/usr/lib/jvm/java-8-oracle/include/ -I/usr/lib/jvm/java-8-oracle/include/linux/"
15) Had more build problems... ran across this conversation
- https://community.openhab.org/t/64-bit-a...al/8493/15
16) Downloaded and installed liblockdev1 and liblockdev1-dev
- wget https://launchpad.net/ubuntu/+source/loc..._arm64.deb
- wget http://launchpadlibrarian.net/230433667/..._arm64.deb
- sudo dpkg -i liblockdev1-dev_1.0.3-1.6build2_arm64.deb liblockdev1_1.0.3-1.6build2_arm64.deb
17) Backed up jar from openhab & copied in new jar. (sure hope the version mismatch doesn't cause a problem.
- cp openhab/userdata/cache/org.eclipse.osgi/204/0/.cp/lib/nrjavaserial-3.9.3.jar openhab/
- cp ~/nrjavaserial/build/libs/nrjavaserial-3.12.0.jar openhab/userdata/cache/org.eclipse.osgi/204/0/.cp/lib/nrjavaserial-3.9.3.jar
18) Grr, had to copy an .so into userdata/tmp/libNRJavaSerial_openhab_0
- unzip /home/openhab/nrjavaserial/build/libs/nrjavaserial-3.12.0.jar native/linux/ARM/libNRJavaSerial.so -f /opt/openhab/userdata/tmp/libNRJavaSerial_openhab_0
19) restart service
20) test....
21) garbage --- error message says "ELFCLASS32" !!! that means I need to use a 32-bit JVM instead of 64-bit.
- Ran across this info in a post by xpomul - https://community.openhab.org/t/64-bit-a...al/8493/40
- Looks like these are 64-bit JVM compatible https://github.com/xsnrg/ARM64




So, after all that it seems changing to a 32-bit JVM (I downloaded the 1.8.0_101 build from oracle) and adding -Dgnu.io.rxtx.SerialPorts=/dev/ttyS2 to runtime/karafe/bin/setenv does the trick.
Or, you can muscle in the 64-bit jar & *.so file...


Note: This is my initial impression. The 32-bit JVM starts OpenHAB a lot faster than the 64-bit JVM. I have noticed this at my day job and have found lots of references to apps running 10% slower on 64-bit JVM's because of 64-bit pointers. With the Pine64 having less than 4GB of ram, there's no reason to use a 64-bit JVM.

WARNING: I'm a Java Developer by day, but this hacking new hardware at night is just my hobby. This might not be the right way to get this to work
  Reply


Messages In This Thread
OpenHAB And Zwave - by FrenchFrog - 07-27-2016, 09:20 AM
RE: OpenHAB And Zwave - by kai - 07-27-2016, 09:46 AM
RE: OpenHAB And Zwave - by B34N - 07-28-2016, 08:05 AM
RE: OpenHAB And Zwave - by avanderbergh - 09-09-2016, 10:41 AM
RE: OpenHAB And Zwave - by Coda - 09-13-2016, 09:46 AM
RE: OpenHAB And Zwave - by revoman - 09-12-2016, 09:51 PM
RE: OpenHAB And Zwave - by martinayotte - 09-13-2016, 10:13 AM
RE: OpenHAB And Zwave - by revoman - 09-13-2016, 11:18 AM
RE: OpenHAB And Zwave - by martinayotte - 09-13-2016, 11:36 AM
RE: OpenHAB And Zwave - by eric - 09-13-2016, 02:09 PM
RE: OpenHAB And Zwave - by bonterra - 09-13-2016, 11:17 PM
RE: OpenHAB And Zwave - by revoman - 09-13-2016, 02:07 PM
RE: OpenHAB And Zwave - by revoman - 09-13-2016, 09:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pine A64 + OpenHAB + Sonoff-pow: Would it Work? Bob123456789 6 10,931 05-31-2017, 02:54 PM
Last Post: Bob123456789
  openHAB Packaging for the Pine64 kai 19 32,917 02-21-2017, 07:19 AM
Last Post: BatoXan
  Keeping Openhab current socken23 4 7,840 01-13-2017, 12:51 AM
Last Post: swinging
  zwave module not available eric 4 8,223 11-04-2016, 10:24 PM
Last Post: stubbs
  OpenHAB Up - Getting My Bearings - Questions doundounba 4 6,733 07-08-2016, 12:38 AM
Last Post: av1024
Information [solved] Openhab not starting socken23 10 14,229 06-21-2016, 12:50 PM
Last Post: Luke
  openHAB just up on Pine64 :-) tllim 2 7,898 05-04-2016, 05:27 AM
Last Post: Luke

Forum Jump:


Users browsing this thread: 1 Guest(s)