This page last changed on Feb 02, 2015 by mredeker.

All,

there is a new Raspberry Pi 2 out in the wild
It comes with 900Mhz quad core and 1 GB of ram: http://www.raspberrypi.org/products/raspberry-pi-2-model-b/

https://www.youtube.com/watch?x-yt-cl=85114404&x-yt-ts=1422579428&v=Xo8RT8Wpv6w#t=364

-Marcus


Slackware Java SE1.6 install.txt (text/plain)
Naamloos8.jpg (image/jpeg)
Naamloos10.jpg (image/jpeg)

What an upgrade! I am going to try one of these with XBMC and a IR blaster. Make that dumb TV on the patio a little smarter..

Posted by sose at Feb 02, 2015 19:32

Windows 10 and Ubuntu prepare for IoT battle on Raspberry Pi 2

Posted by pz1 at Feb 04, 2015 10:53

Migrated my home controller (version 2.1.0) from a regular Raspberry Pi to the new Raspberry Pi 2. The unscientific observations I've made so far:

  • Start-up time from a Pi restart to a functioning controller is reduced
  • Starting the OpenRemote iOS app happens quicker (that is, time from clicking the app icon to having the interface on screen is reduced)
  • Purely subjective, probably placebo and totally irrelevant, but maybe the responsiveness of switches is slightly improved. Since this is either an improvement of fractions of second or none at all, it really does no matter.

However, there is some negative behavior as well. After rebooting the Pi a couple of times, the controller simply stopped working. The startup log of a successful process looked like this:

--------------------------------------------------------------------

DEPLOYING NEW CONTROLLER RUNTIME...

--------------------------------------------------------------------

INFO 2015-02-06 17:57:48,498 : Initialized event processor : Drools Rule Engine
INFO 2015-02-06 17:57:50,126 : Initialized event processor : RRD4J Data Logger
INFO 2015-02-06 17:57:50,127 : Initialized event processor : EmonCMS Data Logger
INFO 2015-02-06 17:57:51,452 : Registered sensor : Sensor (Name = 'Z2000powersensor', ID = '1225587', State Mappings: {})
INFO 2015-02-06 17:57:51,465 : Registered sensor : Switch Sensor (Name = 'pump_sensor', ID = '1442322')
INFO 2015-02-06 17:57:51,468 : Registered sensor : Switch Sensor (Name = 'Clean_sensor', ID = '1218011')
INFO 2015-02-06 17:57:51,479 : Registered sensor : Switch Sensor (Name = 'kitchen_scene_status_sensor', ID = '1218911')
INFO 2015-02-06 17:57:51,481 : Registered sensor : Switch Sensor (Name = 'kitchen_spots_status_sensor', ID = '114348')
INFO 2015-02-06 17:57:51,483 : Registered sensor : Range Sensor (Name = 'livingroom_inner_status_sensor', ID = '114351', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,485 : Registered sensor : Sensor (Name = 'powersensor', ID = '1225116', State Mappings: {})
INFO 2015-02-06 17:57:51,488 : Registered sensor : Range Sensor (Name = 'livingroom_outer_status_sensor', ID = '114350', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,499 : Registered sensor : Range Sensor (Name = 'bedroom_inner_status_sensor', ID = '114579', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,500 : Registered sensor : Range Sensor (Name = 'bedroom_outer_status_sensor', ID = '114578', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,502 : Registered sensor : Range Sensor (Name = 'livingroom_back_status_sensor', ID = '114581', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,504 : Registered sensor : Range Sensor (Name = 'kitchen_ceiling_status_sensor', ID = '114580', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,505 : Registered sensor : Switch Sensor (Name = 'virtual_kitchen_sensor', ID = '1218983')
INFO 2015-02-06 17:57:51,507 : Registered sensor : Range Sensor (Name = 'livingroom_side_status_sensor', ID = '114582', Min: 1, Max: 100)
INFO 2015-02-06 17:57:51,510 : Registered sensor : Switch Sensor (Name = 'livingroom_scenes_status_sensor', ID = '1218984')
INFO 2015-02-06 17:57:51,541 : Startup complete.
INFO 2015-02-06 17:57:51,548 : Controller Definition File Watcher for Default Deployer started.
INFO 2015-02-06 17:59:06,816 :

Whereas after a Pi reboot it simply stops in the middle without an error:

--------------------------------------------------------------------

DEPLOYING NEW CONTROLLER RUNTIME...

--------------------------------------------------------------------

INFO 2015-02-06 17:59:28,958 : Initialized event processor : Drools Rule Engine
INFO 2015-02-06 17:59:29,673 : Initialized event processor : RRD4J Data Logger
INFO 2015-02-06 17:59:29,674 : Initialized event processor : EmonCMS Data Logger
INFO 2015-02-06 17:59:31,018 : Registered sensor : Sensor (Name = 'Z2000powersensor', ID = '1225587', State Mappings: {})
INFO 2015-02-06 17:59:31,032 : Registered sensor : Switch Sensor (Name = 'pump_sensor', ID = '1442322')
INFO 2015-02-06 17:59:34,057 : Registered sensor : Switch Sensor (Name = 'Clean_sensor', ID = '1218011')
INFO 2015-02-06 17:59:34,066 : Registered sensor : Switch Sensor (Name = 'kitchen_scene_status_sensor', ID = '1218911')
INFO 2015-02-06 18:39:42,532 :

Digging into this, also having some concerns with Pi 2 being really eager to corrupt the memory card compared to the original one. First used a Transcend 16GB micro SD card, now swapped to Sandisk. Curiously, also the Transcend reports itself as a Sandisk card

Posted by frand at Feb 06, 2015 17:07

KNX-debug.log has some curious errors:

INFO 2015-02-06 19:06:09,637 (KNX): KNX IP interface hostname set to 'null'
INFO 2015-02-06 19:06:09,639 (KNX): KNX IP interface port set to '3671'
INFO 2015-02-06 19:06:09,639 (KNX): KNX PhysicalBus clazz set to 'org.openremote.controller.protocol.port.DatagramSocketPort'
INFO 2015-02-06 19:06:09,646 (KNX): Scheduled reconnection task
WARN 2015-02-06 19:06:09,648 (KNX): Unknown KNX property '<property name = "name" value = "pump(STATUS)"/>'.
INFO 2015-02-06 19:06:09,671 (KNX): Trying to create connection
INFO 2015-02-06 19:06:09,680 (KNX): Removing connection
INFO 2015-02-06 19:06:09,702 (KNX): KNX Connection manager resolving local host IP addresses...
INFO 2015-02-06 19:06:09,710 (KNX): Found candidate NIC: name:eth0 (eth0)
INFO 2015-02-06 19:06:09,717 (KNX): Added candidate IP address to set - /192.168.0.8
INFO 2015-02-06 19:06:09,718 (KNX): Skipping loopback interface: name:lo (lo)
DEBUG 2015-02-06 19:06:09,875 (KNX): Creating KNX bus with org.openremote.controller.protocol.port.DatagramSocketPort
INFO 2015-02-06 19:06:09,934 (KNX): Found a KNX IP interface at /192.168.0.10:3671
INFO 2015-02-06 19:06:09,999 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/1/1 Data: 0x00 for group address '0/1/1'
INFO 2015-02-06 19:06:10,018 (KNX): Connection created for KNX IP interface at /192.168.0.10:3671
DEBUG 2015-02-06 19:06:10,019 (KNX): Creating KNX bus with org.openremote.controller.protocol.port.DatagramSocketPort
INFO 2015-02-06 19:06:10,055 (KNX): Notified with KNX interface status = connected
INFO 2015-02-06 19:06:10,058 (KNX): Connected to KNX-IP interface /192.168.0.10:3671
INFO 2015-02-06 19:06:10,061 (KNX): KNX-IP socket listener IOException
java.net.SocketException: Socket closed
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
at java.net.DatagramSocket.receive(DatagramSocket.java:781)
at org.openremote.controller.protocol.port.DatagramSocketPort.receive(DatagramSocketPort.java:78)
at org.openremote.controller.protocol.knx.ip.IpProcessor$PhysicalBusListener.run(IpProcessor.java:82)
WARN 2015-02-06 19:06:10,065 (KNX): KNX-IP socket listener stopped
INFO 2015-02-06 19:06:10,067 (KNX): Stopping connection timer
WARN 2015-02-06 19:06:10,134 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_back(STATUS)"/>'.
INFO 2015-02-06 19:06:10,136 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/17 Data: 0x00 for group address '0/4/17'
WARN 2015-02-06 19:06:10,180 (KNX): Unknown KNX property '<property name = "name" value = "kitchen_ceiling(STATUS)"/>'.
INFO 2015-02-06 19:06:10,181 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/0/6 Data: 0x00 for group address '0/0/6'
WARN 2015-02-06 19:06:10,218 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_side(STATUS)"/>'.
INFO 2015-02-06 19:06:10,220 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/18 Data: 0x00 for group address '0/4/18'
WARN 2015-02-06 19:06:10,255 (KNX): Unknown KNX property '<property name = "name" value = "bedroom_inner(STATUS)"/>'.
INFO 2015-02-06 19:06:10,257 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/6/10 Data: 0x00 for group address '0/6/10'
WARN 2015-02-06 19:06:10,294 (KNX): Unknown KNX property '<property name = "name" value = "bedroom_outer(STATUS)"/>'.
INFO 2015-02-06 19:06:10,295 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/6/8 Data: 0x00 for group address '0/6/8'
WARN 2015-02-06 19:06:10,416 (KNX): Unknown KNX property '<property name = "name" value = "kitchen_scenes(STATUS)"/>'.
INFO 2015-02-06 19:06:10,418 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/0/5 Data: 0x00 for group address '0/0/5'
WARN 2015-02-06 19:06:10,488 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_inner(STATUS)"/>'.
INFO 2015-02-06 19:06:10,489 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/16 Data: 0x00 for group address '0/4/16'
WARN 2015-02-06 19:06:10,522 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_outer(STATUS)"/>'.
INFO 2015-02-06 19:06:10,524 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/15 Data: 0x00 for group address '0/4/15'
WARN 2015-02-06 19:06:10,561 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_scenes(STATUS)"/>'.
INFO 2015-02-06 19:06:10,562 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/12 Data: 0x00 for group address '0/4/12'
WARN 2015-02-06 19:06:10,596 (KNX): Unknown KNX property '<property name = "name" value = "kitchen_spots(STATUS)"/>'.
INFO 2015-02-06 19:06:10,598 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/0/7 Data: 0x00 for group address '0/0/7'
WARN 2015-02-06 19:06:13,792 (KNX): Unknown KNX property '<property name = "name" value = "kitchen_scenes(OFF)"/>'.
INFO 2015-02-06 19:06:13,794 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/0/5 Data: 0x00 for group address '0/0/5'
WARN 2015-02-06 19:06:13,798 (KNX): Unknown KNX property '<property name = "name" value = "bedroom_scenes(OFF)"/>'.
INFO 2015-02-06 19:06:13,799 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/6/6 Data: 0x00 for group address '0/6/6'
WARN 2015-02-06 19:06:13,803 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_rings_scenes(OFF)"/>'.
INFO 2015-02-06 19:06:13,804 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/12 Data: 0x00 for group address '0/4/12'
WARN 2015-02-06 19:06:13,808 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_back_scenes(OFF)"/>'.
INFO 2015-02-06 19:06:13,809 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/13 Data: 0x00 for group address '0/4/13'
WARN 2015-02-06 19:06:13,812 (KNX): Unknown KNX property '<property name = "name" value = "livingroom_side_scenes(ON)"/>'.
INFO 2015-02-06 19:06:13,814 (KNX): Created KNX Command FRAME L_Data.req 0.0.0 -> 0/4/14 Data: 0x01 for group address '0/4/14'
ERROR 2015-02-06 19:06:23,836 (KNX): Service failed
org.openremote.controller.protocol.knx.ip.KnxIpException: Service failed, no ACK
at org.openremote.controller.protocol.knx.ip.IpTunnelClient.service(IpTunnelClient.java:84)
at org.openremote.controller.protocol.knx.KNXIpConnectionManager$KNXConnectionImpl.service(KNXIpConnectionManager.java:850)
at org.openremote.controller.protocol.knx.KNXIpConnectionManager$KNXConnectionImpl.send(KNXIpConnectionManager.java:670)
at org.openremote.controller.protocol.knx.KNXCommand.write(KNXCommand.java:328)
at org.openremote.controller.protocol.knx.GroupValueWrite.send(GroupValueWrite.java:117)
at org.openremote.controller.model.Command.execute(Command.java:230)
at org.openremote.controller.model.Command.execute(Command.java:199)
at org.openremote.controller.statuscache.CommandFacade.command(CommandFacade.java:80)
at org.openremote.controller.statuscache.CommandFacade.command(CommandFacade.java:57)
at org.openremote.controller.model.event.Rule_Clean_Off_0.defaultConsequence(Rule_Clean_Off_0.java:14)
at org.openremote.controller.model.event.Rule_Clean_Off_0DefaultConsequenceInvoker.evaluate(Rule_Clean_Off_0DefaultConsequenceInvoker.java:25)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:751)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at org.openremote.controller.statuscache.rules.RuleEngine.push(RuleEngine.java:177)
at org.openremote.controller.statuscache.EventProcessorChain.push(EventProcessorChain.java:188)
at org.openremote.controller.statuscache.StatusCache.update(StatusCache.java:260)
at org.openremote.controller.model.sensor.Sensor.update(Sensor.java:342)
at org.openremote.controller.model.sensor.Sensor$DeviceReader.run(Sensor.java:608)
at java.lang.Thread.run(Thread.java:744)

Posted by frand at Feb 06, 2015 17:12

Hello Jani,

Are the KNX errors related to RPI 2 only, and not present in version 2.1.0 in general (on RPI 1) ?

Posted by juha at Feb 07, 2015 09:41

Hi Juha,

Can't confirm. The problem only manifested together with the migration process to the RPi2 which involved a lot of system restarts. The original RPi has been running stable for well over a year and I did not encounter the issue there. I'd hesitate to subject the original installation to this kind of testing since it's my backup in case the RPi2 turns out unstable

However, this other thread on the forum seems to have the same issue on different hardware: http://openremote.org/pages/viewpage.action?pageId=23596331

Posted by frand at Feb 07, 2015 10:23

Yes, saw the other thread and yours that's why I was asking. Sounds like your issue resolved itself – frequent restarts may be a cause since there's a fairly lengthy timeout on KNX connections if they're not cleaned out properly and I'm not sure our KNX implementation cleans itself up correctly under all cases.

Posted by juha at Feb 07, 2015 13:00

Yes, I re-installed the controller and synced from the designer a few hours later, and things have been back to normal for now, even scheduled rules fire normally. All the observations about snappier performance are still valid. The installation is running on the default Java that comes with Raspbian.

Posted by frand at Feb 07, 2015 15:57

Jani, which version of java did you install?

i have an rasppi 2 and did the installation according to this totorial: http://www.openremote.org/display/docs/OpenRemote+2.0+How+To+-+Install+Controller+on+Raspberry+Pi
but i believe this tutorial is for raspberry pi 1 boards right?
i tried java 1.8 but then drools will not work and the sync with the disigner is working, then i installed java 6 the icetea version and drool work but i cannot sync with the designer. when i enter the controller i will get a java ErrorCode: 10061. im using:

java version "1.6.0_35"
OpenJDK Runtime Environment (IcedTea6 1.13.7) (6b35-1.13.7-1~deb7u1+rpi1)
OpenJDK Zero VM (build 23.25-b01, mixed mode)

rules will work but when i will sync my design with the controller it failes, this logfile will be created:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_linux_zero.cpp:285), pid=2272, tid=1181217904
#  fatal error: caught unhandled signal 11
#
# JRE version: 6.0_35-b35
# Java VM: OpenJDK Zero VM (23.25-b01 mixed mode linux-arm )
# Derivative: IcedTea6 1.13.7
# Distribution: Debian GNU/Linux 7.8 (wheezy), package 6b35-1.13.7-1~deb7u1+rpi1
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#

---------------  T H R E A D  ---------------

Current thread (0x01b94c10):  JavaThread "HTTP-Thread-2" daemon [_thread_in_Java, id=2504, stack(0x46500000,0x46680000)]

Stack: [0x46500000,0x46680000],  sp=0x465c13d4,  free space=772k
Java frames:
 0x4667cfd0: stack_word[2]         = 0x00000001
 0x4667cfd4: stack_word[1]         = 0x000000c4
 0x4667cfd8: stack_word[0]         = 0x5dbf8788
 0x4667cfdc: istate->_thread       = 0x01b94c10
 0x4667cfe0: istate->_bcp          = 0x6fde8596 (bci 14)

the list is even longer than this.

could you help me out?

Posted by robnas at Sep 07, 2015 01:50

Just for my curiosity.
Do you use the Pro version or the free version?
I remember that it did work for me with the pre-installed jva 8 in a short experiment early 2014 using the free version of the controller. Don't have an image of that test unfortunately. Abandoned that because of the high cpu load on the Pi B

Posted by pz1 at Sep 07, 2015 10:58

i have the free version , i have also installed java 8:

root@raspberrypi:/opt/ejre1.6.0_38# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
root@raspberrypi:/opt/ejre1.6.0_38#

but drools wont work with that, syncing with the designer will work. should i try another java 8 version?

Posted by robnas at Sep 07, 2015 11:04

i tried with:

root@raspberrypi:~# java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
root@raspberrypi:~#

but drools wont work either

ERROR 2015-09-07 12:17:49,908 : Error in rule definition 'modeler_rules.drl' : wrong class format
java.lang.RuntimeException: wrong class format

i have also tried java jre6 but it won't even load:

root@raspberrypi:~# update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                             Priority   Status
------------------------------------------------------------
  0            /opt/ejre1.6.0_38/bin/java                        1058      auto mode
  1            /opt/ejre1.6.0_38/bin/java                        1058      manual mode
  2            /opt/jdk1.8.0_60/bin/java                         1         manual mode
  3            /usr/lib/jvm/java-6-openjdk-armhf/jre/bin/java    1057      manual mode
* 4            /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/java   1         manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /opt/ejre1.6.0_38/bin/java to provide /usr/bin/java (java) in manual mode
root@raspberrypi:~# java -version
java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
root@raspberrypi:~#
Posted by robnas at Sep 07, 2015 11:23

should i try another java 8 version

Sorry, I can't help you there since I have no record of what I did use at the time

Posted by pz1 at Sep 07, 2015 11:51

tnx anyway maybe someone else has the same problem

Posted by robnas at Sep 07, 2015 11:54

Hi Rob,
I had a similar problem with Raspbian. IcedTea6 works but is too slow on a RPI2. I installed Slackware Linux which is a soft float Linux.
For more details see http://www.openremote.org/display/forums/OpenRemote+Controller+crash+on+raspberry+pi+2?focusedCommentId=23599638#comment-23599638
I hope it helps.

Posted by patrickvandenbergen at Sep 07, 2015 14:52

Patrick,

i did install slackware onto my sdcard and ive copied openremote to it. i only need the java on to it, is version jre6 enough? as i used it before on a synology installation.

is this the correct way to install java?: http://www.unixmen.com/install-java-slackware-14-1/
it doesnt work with the ejre version: http://www.oracle.com/technetwork/java/embedded/downloads/javase/default-1934076.html
i tried ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012

or do i need a JDK?
like: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
only these a bin files like: jdk-6u45-linux-x64.bin and nor a tar file

which version did you install and how?

Posted by robnas at Sep 08, 2015 01:02

Hi Rob,

The java install is indeed based on http://www.unixmen.com/install-java-slackware-14-1/

Download ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012.gz from Oracle
Download jdk.tar.gz from slackbuilds.org/repository/14.0/development/jdk/
I did the download on a Windows PC and transferred the files with FTP
Go to /root and create /root/java

Extract jdk from jdk.tar.gz and copy (tar -zxvf ...) it to /root/java/jdk
I did rename jdk to jre /root/java/jre
Copy ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012.gz to /root/java/jre

You need to edit the file jdk.SlackBuild for this specific install (it was a bit of reverse engineering but it worked).
I would like to embed my adapted script here, but don't know how.
It would be easier if I could just post the script.

Edit jdk.sh :
(also this script needs to be embedded here)

Now make jdk.Slackbuild executable :
chmod +x jdk.Slackbuild
And execute it (because the .gz file is in the same folder we can just type :
./jdk.Slackbuild
This will take a while and generates a .txz file in /tmp
Now we are ready to install :
installpkg ejre-1_6_0_38-arm-1.txz

Add the java folder to your profile
nano /etc/profile
Add the line
export JAVA_HOME="usr/lib/java/"
Read again the profile setting
source /etc/profile
You can now check your java version

Posted by patrickvandenbergen at Sep 08, 2015 07:54

im half way there, does jdk.sh needs to be edited?
this is the original:

 
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="${MANPATH}:${JAVA_HOME}/man"
export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"

first i edited jdk.Slackbuild:
to:

tar xvf $CWD/ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012.gz

and when i run ./jdk.Slackbuild i got one 1 error:


tar: ejre1.6.0_38/COPYRIGHT: time stamp 2012-11-14 06:02:42 is 1352867433.022913601 s in the future
ejre1.6.0_38/README
tar: ejre1.6.0_38/README: time stamp 2012-11-14 06:02:42 is 1352867433.022121257 s in the future
ejre1.6.0_38/THIRDPARTYLICENSEREADME.txt
tar: ejre1.6.0_38/THIRDPARTYLICENSEREADME.txt: time stamp 2012-11-14 06:02:42 is 1352867433.021422611 s in the future
tar: ejre1.6.0_38/lib/arm/client/libjsig.so: time stamp 2012-11-14 05:17:36 is 1352864727.020565528 s in the future
tar: ejre1.6.0_38/lib/arm/client: time stamp 2012-11-14 05:17:23 is 1352864714.02019683 s in the future
tar: ejre1.6.0_38/lib/arm: time stamp 2012-11-14 05:17:36 is 1352864727.019798497 s in the future
tar: ejre1.6.0_38/lib: time stamp 2012-11-14 05:17:36 is 1352864727.019472351 s in the future
tar: ejre1.6.0_38: time stamp 2012-11-14 06:02:42 is 1352867433.01917558 s in the future
mv: cannot stat 'jdk1.7.0_45': No such file or directory
root@raspi-or:~/java/jre#

ive edited jdk.Slackbuild again and changed these lines:

PRGNAM=ejre
VERSION=${VERSION:-6u38}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

DVER=1.6.0_$(printf $VERSION | cut -du -f2)

now this error occurs:

 future
tar: ejre1.6.0_38/lib/arm/client/libjsig.so: time stamp 2012-11-14 05:17:36 is 1352864001.043342992 s in the future
tar: ejre1.6.0_38/lib/arm/client: time stamp 2012-11-14 05:17:23 is 1352863988.042288617 s in the future
tar: ejre1.6.0_38/lib/arm: time stamp 2012-11-14 05:17:36 is 1352864001.041323253 s in the future
tar: ejre1.6.0_38/lib: time stamp 2012-11-14 05:17:36 is 1352864001.040366951 s in the future
tar: ejre1.6.0_38: time stamp 2012-11-14 06:02:42 is 1352866707.039314138 s in the future
ls: cannot access /root/java/jre/profile.d/ejre*: No such file or directory
chmod: cannot access '/tmp/SBo/package-jdk/etc/profile.d/*': No such file or directory
root@raspi-or:~/java/jre#

do i miss something?

Posted by robnas at Sep 08, 2015 09:48

I would like to post the script in the files jdk.SlackBuild and jdk.sh. How can I publish the scripts like you did with jdk.sh?

Posted by patrickvandenbergen at Sep 08, 2015 09:58

put it here like this

Posted by robnas at Sep 08, 2015 10:15

This is the adapted jdk.SlackBuild

#!/bin/sh

# Copyright 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


VERSION=1_6_0_38
DVER=1.6.0_38
ARCH=arm                  # only determines the lib path locations
JAVA_ARCH=${JAVA_ARCH:-arm}  # or i586 if you want the 32bit version
BUILD=${BUILD:-1}


# if [ "$JAVA_ARCH" = "x64" ]; then
#  LIB_ARCH=amd64
# else
#  LIB_ARCH=i386
# fi

#if [ "$ARCH" = "x86_64" ]; then
#  LIBDIRSUFFIX="64"
#else

LIBDIRSUFFIX=""
LIB_ARCH="arm"

#fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-ejre
rm -rf $PKG
mkdir -p $TMP $PKG

cd $PKG
mkdir -p usr/lib${LIBDIRSUFFIX}
cd usr/lib${LIBDIRSUFFIX}
tar xvf $CWD/ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012.gz
# chown -R root.root $PKG
# yes yes | sh $CWD/ejre-${VERSION}-linux-${JAVA_ARCH}.bin || exit 1
mkdir -p $PKG/etc/profile.d
for file in $(ls $CWD/profile.d/*) ; do
  cat $file | sed -e "s#lib/java#lib${LIBDIRSUFFIX}/java#" \
    > $PKG/etc/profile.d/$(basename $file)
done
chown -R root.root $PKG
find $PKG \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 
\) \
  -exec chmod 644 {} \;

chmod 755 $PKG/etc/profile.d/*
( cd $PKG/usr/lib${LIBDIRSUFFIX}
  mv ejre${DVER} java || exit 1
  ln -sf java ejre${DVER}
) || exit 1
# mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
# ( cd $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
#  ln -sf /usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/libnpjp2.so libnpjp2.so
#)
( cd $PKG/usr/lib${LIBDIRSUFFIX}
  ln -sf ./java/lib/${LIB_ARCH}/client/libjvm.so .
)

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat << EOF > $PKG/install/doinst.sh

# Clean up a potential upgrade mess caused by changing the
# installation directory to /usr/lib${LIBDIRSUFFIX}/java/:
if [ -L usr/lib${LIBDIRSUFFIX}/java ]; then
  rm -rf usr/lib${LIBDIRSUFFIX}/java
 # mkdir -p usr/lib${LIBDIRSUFFIX}/java/man
 # mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/server
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/lib/${LIB_ARCH}/client
 # mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/javaws
 # mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/bin
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/bin
 # mkdir -p usr/lib${LIBDIRSUFFIX}/mozilla/plugins
fi
if [ -L ControlPanel ]; then
  rm -f ControlPanel
fi
if [ -L ja ]; then
  rm -f ja
fi
if [ -L javaws ]; then
  rm -f javaws
fi
if [ -L libjsig.so ]; then
  rm -f libjsig.so
fi
# End cleanup.
EOF

# Install the desktop/mime files:
#mkdir -p $PKG/usr/share/{applications,icons,mime}
#cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/applications/* \
#  $PKG/usr/share/applications/
#cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/icons/hicolor \
#  $PKG/usr/share/icons/
#cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/mime/packages \
#  $PKG/usr/share/mime/

# We ship the package unmodified, so we do not compress manpages.

cd $PKG
/sbin/makepkg -l y -c n $TMP/ejre-$(echo $VERSION | tr - _)-$ARCH-$BUILD.txz

and jdk.sh

#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="${MANPATH}:${JAVA_HOME}/man"
export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/ejre/bin"
Posted by patrickvandenbergen at Sep 08, 2015 10:19

yes that did the thick thank you
now java is installed:

root@raspi-or:/tmp# java -version
java version "1.6.0_38"
Java SE Embedded Runtime Environment (build 1.6.0_38-b05, headless)
Java HotSpot(TM) Embedded Client VM (build 20.13-b02, mixed mode)
root@raspi-or:/tmp#

drools is working, syncing works also
this is the solution for openremote on the raspberry pi 2

Posted by robnas at Sep 08, 2015 14:37

how about the startup script? i did:

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

cd /openremote/bin
./openremote.sh start

in /etc/rc.d/rc.local

i did a chmod +x openremote.sh but it does not autostart

Posted by robnas at Sep 08, 2015 14:46

I have no access to my RPI and cannot check this in datail right now, but you could try the following.

I copied the Openremote folders in /opt and used the script as described at http://www.openremote.org/display/docs/OpenRemote+2.0+How+To+-+Install+Controller+on+Raspberry+Pi

I called the script OpenRemoteStart and added the line JAVA_HOME=/usr/lib/java

#!/bin/sh
### BEGIN INIT INFO
# Provides:          openremote
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

JAVA_HOME=/usr/lib/java

cd /opt/openremote/bin        # Modify this line to your OpenRemote Controller installation path

case "$1" in

stop)
        echo "Stopping OpenRemote Controller..."
        /opt/openremote/bin/openremote.sh stop > /dev/null 2>&1 &
        ;;

start)
        # start OpenRemote in background mode
        /opt/openremote/bin/openremote.sh start > /dev/null 2>&1 &
        echo "OpenRemote Controller started..."
        ;;

restart)
        $0 stop
        sleep 5
        $0 start
        ;;
*)
        echo "usage: $0 { start | stop | restart}" >&2
        exit 1
        ;;

esac

Put the OpenRemoteStart script into /etc/rc.d and chmod +x OpenRemoteStart

Edit rc.local in /etc/rc.d and add the line :
/etc/rc.d/OpenRemoteStart start

If it still does not start, you perhaps need to use chown to change ownership of a number of files?

Posted by patrickvandenbergen at Sep 08, 2015 15:07

in the end i got it working

on the first boot it says "OpenRemote Controller started..." on the startup but nothing happends untill i changed ownership of these files and directories:
chown root /etc/rc.d/openremotescript.sh
and
chown root /openremote
after that i did a reboot and openremote started on boot

after a few mins after reboot ive got this error:

INIT: Id "s0" respawning too fast: disabled for 5 minutes

this can be fixed by out this line in /etc/inittab like:

#s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

also i had the wrong homepath to java in /etc/profile :

export JAVA_HOME="usr/lib/java/"

must be:

export JAVA_HOME=/usr/lib/java

otherwise Openremote does not start

furthermore i have made a script for removing the catalina.out every 24hours.
because this log file can be very big, last time i checked it was over 10gigs on my previous installation on the synology.
its just a shell command which runs every 24h and runs this shell script:

rm /openremote/logs/catalina.out > catalina-info.txt 2>&1 && echo succes || echo fail

be sure your path to openremote is correctly, i placed my openremote folder directly into the root.
add a rule to your startup of the controller to execute the script:

rule "rules start"
 salience 90
when eval(true)
then
execute.command("remove.catalina.out");
end

you can bind a costum sensor to your command:

and add the rules for logging:

rule "remove catalina.out succes"
when
CustomState(source == "rm.catalina.out", value == "on")
then
log("Logfile Catalina.out met succes verwijderd");
end

rule "remove catalina.out fail"
when
CustomState(source == "rm.catalina.out", value == "off")
then
log("Verwijderen mislukt: Logfile Catalina.out niet aanwezig");
end

i also had a clock issue, everytime after a reboot is been done the clock goes back to 1 Jan 1970.
for a solution see: http://pc-freak.net/blog/how-to-fix-clock-on-slackware-slackware-and-this-old-incorrect-bios-time-troubles/
unfortunatly something is wrong with my hardwareclock, when i run the command: hwclock --systohc
it says:

hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
root@raspi-or:~#

and on command hwclock --debug :

root@raspi-or:~# hwclock --debug
hwclock from util-linux 2.21.2
hwclock: Open of /dev/rtc failed: No such file or directory
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
root@raspi-or:~#

i don't know how to fix this one, on google i can find some pages which say that the kernel is not compiled correctly? my temporary solution is to add an extra line to rc.local with:

ntpdate time.nist.gov

set this as the first line before openremote starts so that your log files will have the correct time.

if anyone knows how to fix the clock issue please let me know

Posted by robnas at Sep 08, 2015 18:22

Rob, I haven't installed any additional java packages. The system is running stock java that comes with Raspbian:

java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

And drools fire just fine, I have scheduled KNX light scenes and a watering cycle that have been running stable for months now.

Posted by frand at Sep 08, 2015 20:22

Jani,

maybe i have another openremote controller, which one are you using?

Posted by robnas at Sep 08, 2015 20:41

Jani, which version of drools do you have (in openremote/webapps/controller/WEB-INF/lib)?

Posted by patrickvandenbergen at Sep 08, 2015 21:27

OpenRemote 2.1.1, Drools 5.1.1

Posted by frand at Sep 11, 2015 20:00
Document generated by Confluence on Jun 05, 2016 09:37