Embedded: Resin On Raspberry Pi

From Resin 4.0 Wiki

Revision as of 00:00, 14 February 2013 by Cowan (Talk | contribs)
Jump to: navigation, search

Embed-48.pngPie48.png

Contents

Resin on Raspberry Pi

We are currently in the early stages of modifying Resin to run on a Raspberry Pi.

Caucho Wiki Raspberry Pi Pages:

Resin on Raspberry Pi : Installation and Configuration

Preface

I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed and updated, accessible via SSH. If not, here are some links to help get you started:

I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.

Java

If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. Get the soft-float version.

Resin

  • Download Resin 4.0.35 or later from www.caucho.com. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi
  • We'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.
  • Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.

1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.

wget http://www.caucho.com/download/resin-pro-4.0.35.zip
unzip resin-pro-4.0.35.zip
cd resin-pro-4.0.35
./configure

You should get a configuration summary that looks like this:

Resin Configuration Summary:

 RESIN       : 4.0.35
   home      : /usr/local/share/resin-4.0.35
   root      : /var/resin
   conf      : /etc/resin
   log       : /var/log/resin
   plugins   : common resin_os resin resinssl
   init      : /etc/init.d/resin

 JAVA_HOME   : /usr/java/bin/..

 JNI         : 32-bit
   include       : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux
   CFLAGS        : 
   cflags_shlib  : -fPIC
   ld_shlib      : gcc
   ldflags_shlib : -shared -fPIC
   libs_shlib    : 
   epoll() for keepalives

 OPENSSL     : OpenSSL 1.0.1c 10 May 2012
   include   : /usr/include
   lib       : 
   libraries :  -lssl -lcrypto
make
make install

Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin...

If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses

cp /home/pi/10101.license /etc/resin/licenses/

There's really only 1 change required to run on Raspberry Pi. On Oracle JDK you MUST modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:

vi /etc/resin/resin.properties

jvm_mode    : -client

On OpenJDK, you have a couple choices. -server implies -zero, the Zero-Assembler Project VM. There's also -jamvm, JamVM. Older version of OpenJDK had Cacao JVM, but that appears to have been removed in recent releases and replace with Avain VM, although with -avian I get missing library errors...

root@raspberrypi:/# resinctl start
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP

If you're seeing the message above, you need to modify /etc/resin/resin.properties and set "jvm_mode  : -client". Oracle JDK won't run in -server mode on a Raspberry Pi.

Personal tools
TOOLBOX
LANGUAGES