OpenHAB And Zwave
#11
(09-13-2016, 11:36 AM)martinayotte Wrote: According to the picture from https://cdn.shopify.com/s/files/1/1013/5...1455062700
it is connected to the EULA ten last pins, therefore, it is using PB8/PB9 as UART0, so the same as the debug console connector, so, /dev/ttyS0
(I don't know if there will be conflict with the console, I don't own this ZWave board.)

The zwave module I received a couple of days ago is connected to the PI2 port (via an adapter) and thus uses the UART2 port. I suspect that the linux image I am using does not have the UART2 activated, but I have not had the time to investigate this further. The maintainer of Openhab mentioned in another thread that they will release an image in the near future with support for the zwave module so I will probably wait for it.
  Reply
#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
#13
(09-13-2016, 11:36 AM)martinayotte Wrote: According to the picture from https://cdn.shopify.com/s/files/1/1013/5...1455062700
it is connected to the EULA ten last pins, therefore, it is using PB8/PB9 as UART0, so the same as the debug console connector, so, /dev/ttyS0
(I don't know if there will be conflict with the console, I don't own this ZWave board.)

That image shows an old version of the Z-wave board, not the one currently being shipped. The Pine team has since updated the photo in their store:

[Image: PMZW01_Zwave_Module_EU_Version.jpg]
(This is the EU version, the US/AU versions look slightly different but have the same board size)

@revoman: impressive work (and list!)
Backer #16374 - KS funded January 23rd 2016 - Backerkit funded on March 10th 2016 - BOARD RECEIVED ON JUNE 29th - BACKERKIT ORDER FULFILLED ON SEPT 8th
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)