Raspberry Pi + Oracle JVM + Hard Float ABI = already possible!

2,536 views
Skip to first unread message

Mihail Panayotov

unread,
Dec 22, 2012, 6:07:03 AM12/22/12
to ope...@googlegroups.com
Hi all,
don't know if you already know, but Oracle released JVM 1.8 for Hard Float ABI ARM a few days ago (18.12.2012). This means that it is already possible to use Oracle's JVM on the regular Raspbian “wheezy” with hard-float ABI.

I've successfully installed JVM 1.8 and openHAB on a Raspi and so far it runs OK. It is still slow. It takes 3-4 minutes to run and load the demo files. 
There is one issue too, with FreeTTS. Don't know if it is FreeTTS issue or only Raspi related issue:

Trouble while processing utterance java.lang.IllegalStateException: Syllable relation has already been set
java.lang.IllegalStateException: Syllable relation has already been set
        at com.sun.speech.freetts.Segmenter.processUtterance(Segmenter.java:56)
        at com.sun.speech.freetts.Voice.runProcessor(Voice.java:595)
        at com.sun.speech.freetts.Voice.processUtterance(Voice.java:414)
        at com.sun.speech.freetts.Voice.speak(Voice.java:289)
        at com.sun.speech.freetts.Voice.speak(Voice.java:235)
        at org.openhab.io.multimedia.internal.tts.TTSServiceFreeTTS.say(TTSServiceFreeTTS.java:96)
        at org.openhab.io.multimedia.actions.Audio.say(Audio.java:203)
        at org.openhab.io.multimedia.actions.Audio.say(Audio.java:183)
        at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:474)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:729)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._featureCallOperation(XbaseInterpreter.java:713)
        at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:474)
        at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
        at org.openhab.model.script.interpreter.ScriptInterpreter.internalFeatureCallDispatch(ScriptInterpreter.java:89)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateAbstractFeatureCall(XbaseInterpreter.java:658)
        at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:474)
        at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateBlockExpression(XbaseInterpreter.java:321)
        at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:474)
        at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218)
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:204)
        at org.openhab.model.script.internal.engine.ScriptImpl.execute(ScriptImpl.java:79)
        at org.openhab.model.rule.internal.engine.ExecuteRuleJob.execute(ExecuteRuleJob.java:75)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)

Kai Kreuzer

unread,
Dec 22, 2012, 6:29:34 AM12/22/12
to ope...@googlegroups.com
See also here: https://twitter.com/thorstenkampp/status/282245505742942209

No idea about the freetts problem though - haven't tried this yet myself.

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/0sFu1j8K_s4J.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.

oliver_...@gmx.de

unread,
Jan 2, 2013, 11:55:16 AM1/2/13
to ope...@googlegroups.com, k...@openhab.org
I can confirm that openHAB runs on a RaspberryPi (256MB RAM, Hardfloat) smoothly. I also can confirm the exception Mihail posted.

@Kai If you need any further information, please let me know.

Kind reagrds
Oliver

Guido Zockoll

unread,
Jan 3, 2013, 1:29:21 AM1/3/13
to ope...@googlegroups.com
Same here (512MB). I works - but freetts has some problems.

I got a "Java Heap Space" error, so i added -Xmx128m to the start.sh script - which also makes it much faster (less garbage collection i think).

Currently i am enabling remote jmx monitoring to have a closer look at the jvm. Will also fiddle around with the garbage collector settings.

Regards,

Guido

Kai Kreuzer

unread,
Jan 3, 2013, 2:59:23 AM1/3/13
to ope...@googlegroups.com
Hi Guido,

so i added -Xmx128m to the start.sh script -

This sounds very reasonable. I wonder that this setting wasn't yet there in the start.sh, I actually expected it to be, but indeed it is missing.
I think it makes sense that we add this in general to the runtime.

Best regards,
Kai

Guido Zockoll

unread,
Jan 3, 2013, 6:43:14 AM1/3/13
to ope...@googlegroups.com, k...@openhab.org
Hi everyone,

some news from my experiments. 128m seems to be more then enough. During my tests even 64m should be fine. Currently i am using -Xmx96m -Xms96m which means the initial heap is the same as maximum heap. This gives you a slightly faster system startup. Here is my current start script with enabled remote jmx. You have to adjust your ip address. Localhost or 0.0.0.0 will not work!

#!/bin/bash

# set path to eclipse folder. If local folder, use '.'; otherwise, use /path/to/eclipse/
eclipsehome="server";

# set ports for HTTP(S) server
HTTP_PORT=8080
HTTPS_PORT=8443

# set Java Options
JAVA_OPTS="-Xmx96m -Xms96m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8999 -Djava.rmi.server.hostname=192.168.187.32 -XX:MaxGCPauseMillis=500 -XX:ParallelGCThreads=4 -XX:+UseAdaptiveSizePolicy"

# get path to equinox jar inside $eclipsehome folder
cp=$(find $eclipsehome -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -1);

echo Launching the openHAB runtime...
java -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djetty.port=$HTTP_PORT -Djetty.port.ssl=$HTTPS_PORT -Djetty.home=. -Dlogback.configurationFile=configurations/logback.xml -Dfelix.fileinstall.dir=addons -Djava.library.path=/usr/lib/jni -Djava.security.auth.login.config=./etc/login.conf -Dorg.quartz.properties=./etc/quartz.properties -Dequinox.ds.block_timeout=240000 -Dequinox.scr.waitTimeOnBlock=60000 -Djava.awt.headless=true $JAVA_OPTS -jar $cp $* -console

Guido Zockoll

unread,
Jan 3, 2013, 7:39:39 AM1/3/13
to ope...@googlegroups.com, k...@openhab.org
Screenshot fpr Jconsole:


Guido Zockoll

unread,
Jan 3, 2013, 7:57:57 AM1/3/13
to ope...@googlegroups.com
Next to the serial connection:

org.openhab.io.transport.seriel Package did not work due to missing native libs.

Knopflerfish Bundle with ARM fragment bundle did not work either.


What did work is 

sudo apt-get install librxtx-java and change the start script to ... java.library.path=/usr/lib/jni ...

I tried with the KF bundle but perhaps the new OH bundle will do either.

Regards,

Guido

Kai Kreuzer

unread,
Jan 3, 2013, 3:47:40 PM1/3/13
to ope...@googlegroups.com
Hi Guido,

This looks very nice! A heap of 60MB sounds reasonable, although I will still try to decrease it. Does it stay at this heap over time or do you see any memory creep?

What is the scale on the x-Axis? Is this really the time? That would mean that the startup takes more than 30 minutes? I hope this is a misinterpretation :-o

Regards,
Kai

Am Jan 3, 2013 um 1:39 PM schrieb Guido Zockoll <gzoc...@gmail.com>:

Screenshot fpr Jconsole:



--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/seyx-HCN9H8J.

Jan Gatzke

unread,
Jan 3, 2013, 5:40:47 PM1/3/13
to ope...@googlegroups.com
Hi Guido,
 
using this lib I alsways get the following warning during openhab startup:
 
Native lib Version = RXTX-2.2pre2
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
        Jar version = RXTX-2.1-7
        native lib Version = RXTX-2.2pre2
How do I integratethe KF bundle in my openhab installation? I found an RXTXcomm.jar file in the openhab folder, and replaced it by the KF file, but that didn't change anything.
 
Till now I used an version of librxtxSerial-2.1.7.so that was build for arm. (just googled it and copied it to the lib folder) But I'm having some problems with the serial binding and would like to test a newer version of the libs.
 
Regards,
 
Jan

Guido Zockoll

unread,
Jan 4, 2013, 12:14:05 AM1/4/13
to ope...@googlegroups.com
Hi Jan,

i also got these warning ... but it worked for me anyway.

To install KF bundles i just do a


If you give "ss rxtx" in the OH console you should see these bundles.

As i described before: Wheezy comes with librxtxSerial-2.x.y itself. When you do "sudo apt-get install librxtxjava" you will find them in /usr/lib/jni. I set the java.library.path to that directory in the start.sh script.

Regards,

Guido

Guido Zockoll

unread,
Jan 4, 2013, 12:24:22 AM1/4/13
to ope...@googlegroups.com, k...@openhab.org
Hi Kai,

no memory creep after 24h. The memory usage is between 40MB (after the garbage collector was triggered) and than rises to a bit over 60MB before the GC is triggered again.

But: the number of loaded classes slowly grows. In yesterdays screenshot you see about 10000 classes - right now i see more than 12000 classes. That could leed to an PermGenSpace error sooner or later if these additional classes could not be freed by the GC. I will have a look at it.

Yesterdays screenshot contains more than one restart (every time the number of classes dropped) of openHAB. So startup does not take 30min - without measuring it i think it was around one minute until every thing was up and running.

Regards,

Guido 

Guido Zockoll

unread,
Jan 4, 2013, 2:28:12 AM1/4/13
to ope...@googlegroups.com, k...@openhab.org
Here are the logs from a complete startup cycle:

Launching the openHAB runtime...
updated x10.controllers-1357284026653-0, org.eclipse.equinox.internal.cm.ConfigurationDictionary@442484
osgi> 08:21:41.044 INFO  o.o.c.internal.CoreActivator[:90] - openHAB runtime has been started (v1.1.0).
08:22:39.340 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'db4o.persist'
08:22:47.314 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'demo.items'
08:22:48.737 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'logging.persist'
08:22:49.140 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'rrd4j.persist'
08:22:49.450 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'exec.persist'
08:22:55.641 INFO  runtime.busevents[:46] - Date state updated to 2013-01-04T08:22:45
08:23:08.765 INFO  runtime.busevents[:46] - Weather_Temperature state updated to 6
08:23:09.672 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'demo.script'
08:23:25.942 INFO  o.o.m.c.i.f.FolderObserver[:163] - Loaded file 'demo.sitemap'
08:23:40.009 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
08:23:40.062 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63] - Registering new service _openhab-server._tcp.local. at port 8080
08:23:43.141 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63] - Registering new service _openhab-server-ssl._tcp.local. at port 8443
08:23:46.771 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at /openhab.app
08:24:06.780 INFO  runtime.busevents[:46] - Weather_Temperature state updated to 6
08:24:12.201 ERROR o.o.i.multimedia.actions.Audio[:205] - No TTS service available - tried to say: Welcome at openHab!
08:24:18.199 ERROR o.o.i.multimedia.actions.Audio[:205] - No TTS service available - tried to say: The temperature outside is 6 degrees celsius
08:24:21.742 INFO  runtime.busevents[:46] - Light_GF_Living_Table state updated to ON
08:24:21.945 INFO  runtime.busevents[:46] - Light_GF_Corridor_Ceiling state updated to OFF
08:24:22.756 INFO  runtime.busevents[:46] - Light_GF_Kitchen_Ceiling state updated to ON
08:24:23.057 INFO  runtime.busevents[:46] - Light_GF_Kitchen_Table state updated to ON
08:24:23.330 INFO  runtime.busevents[:46] - Light_GF_Corridor_Wardrobe state updated to OFF
08:24:23.475 ERROR o.o.i.multimedia.actions.Audio[:205] - No TTS service available - tried to say: 1

As you can see it took five minutes for a complete startup sequence.

Regards,

Guido

Thomas Eichstädt-Engelen

unread,
Jan 4, 2013, 10:46:28 AM1/4/13
to ope...@googlegroups.com
so we don't need any changes of the startup-script, do we?
Reply all
Reply to author
Forward
0 new messages