Beagleboard Black w/MRL

Anybody had any success getting MRL up and running on a BBB?  I'm stuck at trying to verify my java installation at the moment, so any pointers/helpful suggestions/handholding walkthroughs would be completely appreciated.

 

GroG's picture

Hi MaxHirez ! Nice to see

Hi MaxHirez !

Nice to see you, haven't had much time to hang out at LMR...

Funny you should ask, I'm scrambling looking for a micro HDMI to boot a BBB...  
I have zero experience with this board, but it looked exciting...

You have specific plans or are you experimenting ?

So a Raspi needs an SD, but this SD is optional ?  Does the image on the board start a sshd server? I'm wondering because I could probably sniff it  out and connect via ssh which would be great, but I have no micro HDMI cable..

Any guidance would be appreciated :)

GroG's picture

What JDK did you install and how ?

This is a question for you Max and KMC..

Ahhhhh...  ANOTHER PACKAGE MANAGER ?? 

Angstrom use opkg ?  :P

kmcgerald's picture

I have my BBB with MRL WORKY!

I bought my BBB on Sunday and just started playing with it this morning.  After getting passed a bug with the ssh keys not letting me log in (no micro HDMI cable) it was pretty short work getting MRL running.

Can you get connected yet?

I'm going to assume that you have a basic familiarity with Linux.  If you don't and nothing I write below makes any sense, let us know and we'll be more explicit.

I'm using the embedded Angstrom Linux that came on the board (2012.12) so nothing fancy there.  After I saw that there was no Java installed on the board I downloaded the jdk7.u45 from Oracle. You want the "Soft Float ABI" ARM version.  You have to deal with their licence agreement so rather than wget the file directly, I downloaded the file to my computer and then pulled it from there onto my BBB.  Once the file was downloaded I did a standard "tar xzf jdk-7u45-linux-arm-vfp-sflt.tar.gz" to unpack it.  Since space is tight I deleted the tar.gz file after it was unpacked.  Then I pulled down the latest MRL zip file from the download page.  After I unzipped that in the root home directory I deleted the zip file and renamed the myrobotlab.******* to just "myrobotlab" for my own ease.  I jumped in that directory, deleted the .bat files (no windows here thanks), and did a chmod +x on the .sh files.  Before running the .sh files you need to edit them so that the last command "java .... " has the full path in front of it.  For me that was "/home/root/jdk1.7.0_45/bin/java ...." 

If you're not running in a gui environment on the BBB (I'm just connected via ssh) you can start the webgui.sh to get things fired up.  Then just point your browser on another computer to "http://<BBB IPADDRESS>:7777" and you should be good to start playing.

One other thing I did was update my MRL before starting the webgui.  To do that make a copy of myrobotlab.sh or webgui.sh to update.sh.  Then edit the update.sh you just made and get rid of the stuff after org.myrobotlab.service.Runtime on the last line and add "-update -logToConsole" to the end.  When you run this script MRL will start fetching the latest and greatest Grogware from the Internetz.  I got an error at the end of that process but I was still able to start the webgui and the bleeding edge version was correct so I'm not sure why it complained.  I sent the error to Grog and he'll have his best elves look at it.

GroG's picture

I must have followed your

I must have followed your instructions and gotten side-tracked ..  SQUIRREL !

Java was installed .. a jdk1.7.0_45 version .. so I'm following in your footsteps.

Did the same with the bat & sh files

BOOYA - TO THE REST API !

Step 1 - MRL's silly webpage

Step 2 - TO THE REST API  !

Step 3 - I want the Runtime Service !

Step 4 - Update and Upgrade EVERYTHING !!!

Oh and if you want to see it hard at work add 

-logToConsole 

to the end of the java command in the webgui.sh file

Now time to do something else and it shovels bits in......

GAH ! ran out of space - was very little to begin with...
What did you remove to lighten the ship KMC ?

I don't even had a mini-hdmi ... so maybe I should start with GNOME ...  never liked gnomes ;)

GroG's picture

WORKY = YAY !

Thanks for the Information KMC .. Your the first to get MRL running on a BBB !

Java instructions found by KMC - http://beagleboard.org/project/java/

maxhirez's picture

Not going to be much help yet...

I did pretty much what KMCGerald did to load the JDK onto the board, but I can't get the permissions to let me access any of the Java files.

You might want to add the SD just to make sure you have the room for both the JDK and MRL.  To get it to work, you need to format the SD card as a FAT32 with one partition and put a file called uEnv.txt on it with this in it:

 

mmcdev=1
bootpart=1:2
mmcroot=/dev/mmcblk1p2 ro
optargs=quiet

I've pretty much been doing everything over SSH from my mac.  That shouldn't be the source of my problems though. (ssh -l 192.168.7.2 to log into root and <enter> for password.)  The microHDMI thing is a pain, but I have used the GUI as well-the problem is that its USB port stinks too.  Even with a powered hub you're not going to get more than one item on the Bus to work.

The plan is to make a Doctor Who K-9.  I wanted to use Sphinx and the TTS functions, as well as motor control.  I kind of got hooked on the idea of the dog-themed brains for him, but having used both the RPi and PCduino, I'm just about to give up on TI products for good (I have this, an original BeagleBoard and two LaunchPads, none of which is anything but buggy and annoying.)

Bird tried to walk me through installation of the jdk today on the hangout.  He has a BBB and had no problems getting it to work.  I think mine is just cursed.

 

kmcgerald's picture

Permission Problems

I'm not sure what your permission problems are but I have been running everything as root on the BBB so far. As far as space is concerned I can fit the whole jdk and MRL with all of the services installed and still have over 100MB free space. I haven't found a blank uSD card I can use in it yet so I'm sticking with the limits of the built in eMMC for now.

GroG's picture

Aight... finally got my BBB

Aight... finally got my BBB online...
The web interface freaks me out .. I need a command line..  It grabbed a IP address and I scanned it and found it YAY !

Logging in - there doesn't seem to be a lot of wiggle room

Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.7G  1.6G   64M  97% /
/dev/root       1.7G  1.6G   64M  97% /
devtmpfs        250M     0  250M   0% /dev
tmpfs           250M  4.0K  250M   1% /dev/shm
tmpfs           250M   21M  229M   9% /run
tmpfs           250M     0  250M   0% /sys/fs/cgroup
tmpfs           250M  4.0K  250M   1% /tmp
/dev/mmcblk0p1   70M   54M   16M  78% /media/BEAGLEBONE]

kmcgerald's picture

You showed me yours, I'll show you mine.

root@beaglebone:/media/USB DISK/opencv/opencv-2.4.6.1# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.7G  1.5G   92M  95% /
/dev/root       1.7G  1.5G   92M  95% /
devtmpfs        250M     0  250M   0% /dev
tmpfs           250M  4.0K  250M   1% /dev/shm
tmpfs           250M  280K  250M   1% /run
tmpfs           250M     0  250M   0% /sys/fs/cgroup
tmpfs           250M   36K  250M   1% /tmp
/dev/sda1        29G   16G   14G  55% /media/USB DISK
/dev/mmcblk0p1   70M   56M   15M  80% /media/BEAGLEBONE
/dev/loop0      3.9G  1.6G  2.2G  43% /media/USB DISK/opencv/opencv-2.4.6.1/release

I remember there being a ton of space wasted in root's home dir by a log file complaining about HDMI errors. do a ls -lah on ~root and see what it is. I think it was .xsession-errors but mine isn't bloated now perhaps because I have HDMI hooked up now.

Roboman's picture

noob help?

Hey guys, this may be just a stupid problem but since I'm new to Linux and have been trying to get my BBB to run mrl I thought I'd post it here. I've copied all the files to my BBB and installed java using

apt-get install default-jre

but now when I run webgui.sh I get

root@arm:~# bash /home/myrobotlab.20140525.0742/webgui.sh
Error: Could not find or load main class org.myrobotlab.service.Runtime
 
any help?
kmcgerald's picture

path problem

root@beaglebone:~# bash /opt/mrl/webgui.sh
Error: Could not find or load main class org.myrobotlab.service.Runtime
root@beaglebone:~# cd /opt/mrl/
root@beaglebone:/opt/mrl# bash ./webgui.sh
1978.20140218.1942
createAndStartServices service count 2
 

Roboman's picture

nevermind, i got it worky :)

nevermind, i got it worky :)

Roboman's picture

about to throw my bbb in the blender!

hey again, so i got MRL working once on the beagleboneblack but now I'm having trouble again.. i installed java just as kmc said and i got MRL worky, but whenever i restart i get the Error: Could not find or load main class org.myrobotlab.service.Runtime.  I am exporting the path each time but it doesn't work unless i uninstall all java, install the jdk that kmc described, and then install openjdk-7-jre on top of that using apt-get.  this works temporarily but eventually fails again after roughly 20 min.. this issue is driving me crazy! my beaglebone is running Debian wheezy because it was the only distribution i could get to properly install a desktop environment on other than angstrom which has different problems. to make things even more confusing, occasionally the myrobotlab.sh wont even return an error but if i try to run it from the desktop a window never shows up. I'm calling out to the MRL script-fu masters to help me. i have exhausted my skill set and every tutorial/blog i could find on the internet. help me Grog, you're my only hope.

GroG's picture

20 min and things are borked?

20 min and things are borked?  Hmmmm that's strange.   I can tell you a few things about your Error, "Could not find or load main class org.myrobotlab.service.Runtime"..  From this simple error we can derive the following.

  • Some version of Java is installed..  the error is "from" Java so therefore it is installed .. you know like I think therefore I am thingy ...
  • Your starting this from a script ..   You would get this error if you tried to execute the script in a different directory.  The script file should say "java -classpath "./libraries/jar/*: ..."   but my guess is you haven't moved the myrobotlab.sh .. correct me if I'm wrong
  • the class org.myrobotlab.service.Runtime is inside the ./libraries/jar/myrobotlab.jar file - make sure the myrobotlab.jar file exists and its not 0 bytes... (perhaps bad update) .. if I remember correctly it should be about ~5 Megs

My first guess is that some update clobbard you.. but DON'T PANIC .. we can work it out.  You have Java installed I'd leave it installed.  Let me know about my assumptions and we will work it from there...

Roboman's picture

deep breaths.......

ok, so i checked over everything you mentioned and i still get an error. the MRL files all seem to be in order...here is the full error for you to see:

root@beaglebone:/home/debian/Desktop/Myrobotlab# bash ./myrobotlab.sh
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/myrobotlab/service/Runtime : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.myrobotlab.service.Runtime. Program will exit.
root@beaglebone:/home/debian/Desktop/Myrobotlab#
 
Could it possibly be the java version im using? i installed jdk1.7.0_60  in /usr/java/jdk1.7.0_60..etc and added th eexprot commands tobut when i run java -version it returns :
 
java version "1.6.0_31"
OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1~deb7u1)
OpenJDK Zero VM (build 23.25-b01, mixed mode)
 
and tat really confuses me because i dont believe i have any other java installed, i originally tried apt-get default-jre, apt-get openjdk-7-jre, and Kmc's method but i uninstalled the default-jdk and openjdk-7-jre before installing as KMC described. i also realized that i couldne find the line that KMC described in his post here:
 
Before running the .sh files you need to edit them so that the last command "java .... " has the full path in front of it.  For me that was "/home/root/jdk1.7.0_45/bin/java ...
 
i checked my myrobotlab.sh file and here it is:
 
#!/bin/sh
 
# Mac's don't use LD_LIBRARY_PATH yet its
# required to load shared objects on Linux systems
LD_LIBRARY_PATH=`pwd`/libraries/native/armv6.hfp.32.linux:`pwd`/libraries/nativ$
export LD_LIBRARY_PATH
 
DYLD_LIBRARY_PATH=`pwd`/libraries/native/x86.32.mac:`pwd`/libraries/native/x86.$
export DYLD_LIBRARY_PATH
 
# java -d32  force 32 bit
# -classpath ":myrobotlab.jar:./lib/jar*"  - make note : on Linux ; on Windows $
# -Djava.library.path=./bin - can not change or modify LD_LIBRARY_PATH after jv$
# LD_LIBRARY_PATH needed by Linux systems
# -Djava.library.path= needed by mac
 
# memory change - -Xmx 128m -Xms 128m
 
java -classpath "./libraries/jar/*:./libraries/jar/x86.32.linux/*:./libraries/j$

were you talking about the java -class path command or am i missing something else here?

Thanks again for all your help guys!

-Roboman

kmcgerald's picture

find the right java

I think you're on the right track with the java 1.6 problem.  Your BBB has openjdk 1.6 installed which is what is coming up by default when you try to run MRL.  You need to find the java binary that got installed by the 1.7.0_60 package you downloaded.  On my BBB it got installed in /usr/local/jdk1.7.0_45/bin/java.  I have a symlink from /usr/local/jdk to /usr/local/jdk1.7.0_45 

root@beaglebone:~# ls -l /usr/local/
total 20
drwxr-xr-x 2 root root 4096 Feb 28  2014 bin
drwxr-xr-x 4 root root 4096 Feb 18  2014 include
lrwxrwxrwx 1 root root   23 Jan  9  2014 jdk -> /usr/local/jdk1.7.0_45/
drwxr-xr-x 8 uucp  143 4096 Oct  8  2013 jdk1.7.0_45
drwxr-xr-x 4 root root 4096 Feb 28  2014 lib
drwxr-xr-x 4 root root 4096 Feb 28  2014 share

In my myrobotlab.sh script I have

/usr/local/jdk/bin/java -classpath "./libraries/jar/*:./libraries/jar/x86.32.linux/*:./libraries/jar/x86.64.linux/*:" -Djava.library.path="./libraries/native/arm.32.linux:./libraries/native/x86.32.linux:./libraries/native/x86.64.linux:./libraries/native/x86.32.mac:./libraries/native/x86.64.mac" org.myrobotlab.service.Runtime -service gui GUIService python Python

Hard coding the path to the right java binary should fix things.

GroG's picture

Ya KMC is right ... I would

Ya KMC is right ...

I would see what you have .. I think you probably should clean house a little ... 
your likely to trip over things in a mess house

What does this command give you ?

apt-cache search --names-only '*java*'

and

apt-cache search --names-only '*jdk*'

We should find what all you have installed on it and remove the parts that keep tripping you up. MRL requires "java" 1.7 - it could be the jre or jdk (although I would recommend taking the jdk - Java Development Kit)

If I remember apt-cache it should tell you what parts are installed and what parts are available.

And whenever you want to quickly test what your "default" java is you do this 

java -version

Mine comes back with :
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

 

Roboman's picture

almost there!

ok, so I cleaned out every java package i installed with apt/get and am now just using the downloaded jdk1.7.0_60 and hardcoded that path to the myrobotlab.sh file now it starts but myrobotlab seems to hang in creating the gui service..

 

you can see as I start it the cpu usage jumps up to 100% but after roughly 15 seconds it falls back to idle and the program never advances.. strange.

any more ideas?

GroG's picture

Progress !  Great..The first

Progress !  Great..

The first thing I would do is take out the hardcoded path ;)

For all the slightly strange behavor on different systems .. there are some "standard" things with Java..
One is the JAVA_HOME variable.  Instructions for SETTING JAVA_HOME FOR ALL USERS are @

- http://www.jusuchyne.com/codingforme/linux/set-java_home-environment-variable-linux/ 

adjust with your specific values 

 

Swing .. the graphics part of Java is a bit "heavy" for little boards..  try the webgui first ...  webgui.sh

See how that goes ..

If nothing works - send me the myrobotlab.log to supertick (at) gmail.com

remember .. little steps .. don't panic ..

 

kmcgerald's picture

In my limited experience with

In my limited experience with GUI stuff on the BBB, it takes a long time to load. If the process is still running in the terminal there's a chance that it might still spawn. The other option is to start the webgui script and connect from another computer.

Roboman's picture

maybe worky?

ok, the webgui now starts realibly but it the myrobotlab.mrl page that it hosts will stop showing any services after a while. im gonna try to work on maybe just using straight python to try to implement my robotics projects. i think the bbb just doesnt have the power to keep up with all mrl has to offer.. ill keep checking back on the updates and see if i can get everything 100% worky. im gonna keep experimenting around with my bbb in hopes to use it as a powerful robotics platform. Thanks again for all your help!