MyRobotLab - Running on Chumby

 

 

Ro-Bot-X and I have decided to get MRL running on a Chumby !

The Chumby is a consumer electronics product made by Chumby Industries, Inc.. It is an embedded computer which provides Internet and LAN access via a Wi-Fi connection.

First step in the process would be to get Java installed on the Chumby.

Chumby has a wiki with a step by step guide to get a JavaVM (Jam) running.  Apparently, JamVM is what the Android OS is based on.

There instructions are will get the JavaVM installed and running from the usb mount point (/mnt/usb/bin/jamvm)

Installation Log


2009-06-06

 

Bubbly:/mnt/storage/myrobotlab-0006 # java -classpath .:myrobotlab.jar:lib/log4j

-1.2.14.jar org.myrobotlab.service.Invoker -service Invoker services
bootclasspath is empty!
Bubbly:/mnt/storage/myrobotlab-0006 #

This has to do with the JamJVM not knowing where the GNU Classpath is - the results probably from an incomplete or incorrectly installation of the JVM..

To confirm this - I would recommend using one of the early tests to see if it returns the same error (hello3.jar)


2009-06-07

 


Ro-Bot-X - with his superior networking skills got me ssh access to the Chumby !

Unfortunately the JVM which is installed only complains about "bootclasspath is empty!"

Looked at a couple forum entries saying unzipping capability of the jvm is wonky.

Went back to the link

http://wiki.chumby.com/index.php/Java

to try to recompile it - found out zlib is indeed missing...
Tried to download from a chumby reference which was stale - found zlib here - 


http://www.zlib.net/
Downloaded - configured - did a make, and it compiled fine - did a "make install" and got

 

mkdir: can't create directory '/usr/local/lib': Read-only file system
make: [install-libs] Error 1 (ignored)
 
did this :
cp libz.so /mnt/storage/gcc/usr/lib
 
Also - using the latest jamvm 1.5.4 not 1.4.3 as the link  http://wiki.chumby.com/index.php/Java
suggests
 
Yargg..  checking for zlib.h... no
configure: error: zlib.h is missing
 
So the paths are all wonky because the Chumby has SD mount point - that explains some of my problems
 
Back to ZLib - need it to install
/mnt/storage/gcc/usr/include and /mnt/storage/gcc/usr/lib
 
	Bubbly:/mnt/storage/test/zlib-1.2.5 # make install prefix=/mnt/storage/gcc/usr
cp libz.a /mnt/storage/gcc/usr/lib
cp libz.so.1.2.5 /mnt/storage/gcc/usr/lib
cd /mnt/storage/gcc/usr/lib; chmod u=rw,go=r libz.a
cp zlib.3 /mnt/storage/gcc/usr/share/man/man3
chmod 644 /mnt/storage/gcc/usr/share/man/man3/zlib.3
cp zlib.pc /mnt/storage/gcc/usr/lib/pkgconfig
chmod 644 /mnt/storage/gcc/usr/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /mnt/storage/gcc/usr/include
chmod 644 /mnt/storage/gcc/usr/include/zlib.h /mnt/storage/gcc/usr/include/zconf.h

that looked better -> trying the JamVM configure again 


	./configure  --build=i386-linux --host=arm-linux --prefix=/usr/arm-linux
make

 

Zoiks ! - it made a bunch of Makefiles

 

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/interp/Makefile
config.status: creating src/interp/engine/Makefile
config.status: creating src/arch/Makefile
config.status: creating src/os/Makefile
config.status: creating src/os/linux/Makefile
config.status: creating src/os/darwin/Makefile
config.status: creating src/os/bsd/Makefile
config.status: creating src/os/solaris/Makefile
config.status: creating src/os/solaris/x86/Makefile
config.status: creating src/os/linux/powerpc/Makefile
config.status: creating src/os/linux/arm/Makefile
config.status: creating src/os/linux/i386/Makefile
config.status: creating src/os/linux/x86_64/Makefile
config.status: creating src/os/linux/parisc/Makefile
config.status: creating src/os/linux/mips/Makefile
config.status: creating src/os/darwin/arm/Makefile
config.status: creating src/os/darwin/powerpc/Makefile
config.status: creating src/os/bsd/powerpc/Makefile
config.status: creating src/os/bsd/arm/Makefile
config.status: creating src/os/bsd/i386/Makefile
config.status: creating src/os/bsd/x86_64/Makefile
config.status: creating src/os/bsd/sparc/Makefile
config.status: creating lib/Makefile
config.status: creating lib/java/Makefile
config.status: creating lib/java/lang/Makefile
config.status: creating lib/jamvm/Makefile
config.status: creating lib/jamvm/java/Makefile
config.status: creating lib/jamvm/java/lang/Makefile
config.status: creating lib/java/lang/reflect/Makefile
config.status: creating lib/java/security/Makefile
config.status: creating lib/gnu/Makefile
config.status: creating lib/sun/reflect/annotation/Makefile
config.status: creating lib/sun/reflect/Makefile
config.status: creating lib/sun/Makefile
config.status: creating lib/gnu/classpath/Makefile
config.status: creating src/config.h
config.status: linking src/arch/arm.h to src/arch.h
config.status: executing depfiles commands
Bubbly:/mnt/storage/test/jamvm-1.5.4 # ls
 

make all

BURNED !

 

/../src -fno-reorder-blocks -g -O2 -MT interp.lo -MD -MP -MF .deps/interp.Tpo -c interp.c  -fPIC -DPIC -o .libs/interp.o
gcc: Internal error: Killed (program cc1)
Please submit a full bug report.
 
drop back to recommended version and following the instructions (this time with zlib support)
 
compiling ..........................................

ran - strip src/jamvm

again with the make install prefix=/mnt/storage/gcc/usr
 

2009-06-07 - 11:27 PST
 
 

Woot .. or rather Wo (partial)

 
Some of this stuff is finally starting to make sense to me - the directory / path structure read-only right stuff is the cause of most of the blocking issues...
 
I have not run through a completely successful build and install of JamVM & GNU Classes - however, in the future I think it might be good in the long run to do this hand have the "latest" from jam & gnu
 
In the interim I'm using the binaries downloaded from http://wiki.chumby.com/index.php/Java which are older versions. I downloaded this and uncompressed it into /mnt/storage/jamvmdl
It turns out the java program is just a script file in this case with a bunch of pathing info.  I made my own script called "makeitwork" - the contents are as follows
 
#!/bin/sh
LD_LIBRARY_PATH=/mnt/storage/jamvmdl/lib /mnt/storage/jamvmdl/bin/jamvm -Xbootclasspath:/mnt/storage/jamvmdl/lib/share/jamvm/classes.zip:/mnt/storage/jamvmdl/lib/glibj.zip $@
 
ok full WOOT ! 
 
java -Djava.library.path=./bin org.myrobotlab.service.Invoker -service Invoker services GUIService gui
Bubbly:/mnt/storage/myrobotlab-0006 # /mnt/storage/jamvmdl/makeitwo
rk -cp .:myrobotlab.jar:lib/log4j-1.2.14.jar org.myrobotlab.service
.Invoker -service Invoker services
0.0.0.0
0
service count 1
 
The Invoker is up and running !
 
Now now experiments in trying to get the OpenCV/Arduino service up and running 
 
Bubbly:/mnt/storage/myrobotlab-0006 # /mnt/storage/jamvmdl/makeitwork -cp .:myrobotlab.jar:lib/log4j-1.2.14.jar org.myrobotlab.service.Invoker -service Invoker services RemoteAdapter remote
 
 

Alright - I started now 2 yes 2 services - Invoker and RemoteAdapter -
The RemoteAdapter is a service you can start when you want other instances of MRL to attach (for example one running from your Windows box)


I have another port forwarding request - could you forward port 6767 (this is the port the RemoteAdpater uses) for protocol UDP ?  I'm curious if I can attach from my MRL instance here and debug them...
 

OpenCV 

Boom

 

java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.constructNative(Native Method)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
 
Which I would figure.....

There will be 2 hurdles here :

 
1. getting the LIBRARY_PATH or -Djava.path or makeitwork script working correctly
2. I don't "have" the native libraries for an ARM processor - but hopefully - thanks to the huge interest in Android, Samuel Audet  has a set of pre-copiled binaries... going to download them to the Chumby...
 
wget http://javacv.googlecode.com/files/OpenCV-2
.2.0-android-arm.zip
 

Looks like the Chumby ARM processor does NOT have a FPU - according to reference - http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/chumby-hacker-board-question-td6259369.html

Samuel built it with and without FPU support - removing n/a binaries and moving the rest into /myrobotlab-0006/bin

Arggh... more jars are required, yet it appears that this version of jamvm DOES NOT support wild card referencing on the classpath e.g.   -cp  .:/lib/*.jar

Boom

 

Bubbly:/mnt/storage/myrobotlab-0006 # /mnt/storage/jamvmdl/makeitwork -cp .:myrobotlab.jar:lib/log4j-1.2.14.jar:lib/javacpp.jar:lib/javacv.jar org.myrobotlab.service.Invok
er -service OpenCV camera
0.0.0.0
0
service count 1
java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.constructNative(Native Method)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
   at org.myrobotlab.framework.Service.getNewInstance(Unknown Source)
   at org.myrobotlab.service.Invoker.invokeCMDLine(Unknown Source)
   at org.myrobotlab.service.Invoker.main(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: java/util/concurrent/ArrayBlockingQueue
   at org.myrobotlab.service.OpenCV.<init>(Unknown Source)
   at java.lang.reflect.Constructor.constructNative(Native Method)
   ...4 more
Caused by: java.lang.ClassNotFoundException: java.util.concurrent.ArrayBlockingQueue not found in java.lang.ClassLoader$1{urls=[file:/mnt/storage/myrobotlab-0006/./,file:/mnt/storage/myrobotlab-0006/myrobotlab.jar,file:/mnt/storage/myrobotlab-0006/lib/log4j-1.2.14.jar,file:/mnt/storage/myrobotlab-0006/lib/javacpp.jar,file:/mnt/storage/myrobotlab-0006/lib/javacv.jar], parent=null}
   at java.net.URLClassLoader.findClass(URLClassLoader.java:992)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:342)
   at java.lang.ClassLoader$1.loadClass(ClassLoader.java:1112)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
   at org.myrobotlab.service.OpenCV.<init>(Unknown Source)
   ...5 more
 
I think I can fix this one.......

Woot(ish)

 

Bubbly:/mnt/storage/myrobotlab-0006 # /mnt/storage/jamvmdl/makeitwork -cp .:myrobotlab.jar:lib/log4j-1.2.14.jar:lib/javacpp.jar:lib/javacv.jar org.myrobotlab.service.Invok
er -service OpenCV camera
0.0.0.0
0
service count 1
 
 
Service stays up - but non of the JNA JCPP functions have been called - should try these, even though I know there is no /dev/video at the moment ...
 

Why I do believe there is some EVIL CACHING GOING ON !  trying to get a file to update somehow wget, google code, or some proxy appears to be caching old files --  OR AM I GOING CRAZY !

Yes .. someone was caching now I get ...

Boom 

 

Bubbly:/mnt/storage/myrobotlab-0006 # /mnt/storage/jamvmdl/makeitwork -cp .:myrobotlab.jar:lib/log4j-1.2.14.jar:lib/javacpp.jar:lib/javacv.jar org.myrobotlab.service.OpenC
V
2 [main] ERROR class org.myrobotlab.framework.Service  - could not find host, host is null or empty !
384 [main] INFO class org.myrobotlab.framework.Service  - os.name [Linux]
393 [main] INFO class org.myrobotlab.framework.Service  - os.version [2.6.28-chumby]
398 [main] INFO class org.myrobotlab.framework.Service  - os.arch [arm]
402 [main] INFO class org.myrobotlab.framework.Service  - java.class.path [.:myrobotlab.jar:lib/log4j-1.2.14.jar:lib/javacpp.jar:lib/javacv.jar]
405 [main] INFO class org.myrobotlab.framework.Service  - java.library.path [/mnt/storage/jamvmdl/lib:/mnt/storage/myrobotlab-0006/bin]
407 [main] INFO class org.myrobotlab.framework.Service  - user.dir [/mnt/storage/myrobotlab-0006]
413 [main] WARN class org.myrobotlab.framework.ConfigurationManager  - file localhost.properties not found
418 [main] WARN class org.myrobotlab.framework.ConfigurationManager  - file localhost.opencv.properties not found
482 [main] INFO class org.myrobotlab.comm.CommunicationManager2  - instanciating a org.myrobotlab.comm.CommObjectStreamOverUDP
550 [main] DEBUG class org.myrobotlab.framework.Service  - opencv registerServices
13354 [opencv_outbox] DEBUG org.myrobotlab.framework.Outbox  - outbox run WAITING 
13359 [opencv] DEBUG org.myrobotlab.framework.Inbox  - inbox getMsg just before synchronized
13365 [opencv] DEBUG org.myrobotlab.framework.Inbox  - Inbox WAITING opencv
13450 [main] INFO org.myrobotlab.service.OpenCV  - starting capture
13675 [main] INFO org.myrobotlab.service.OpenCV  - starting capture
Exception in thread "OpenCV_videoProcessor" java.lang.UnsatisfiedLinkError: getDeclaredAnnotations
 
Arrggh ...  

 

 

First The Bad
Trying to get OpenCV service started gives me 

14547 [main] INFO org.myrobotlab.service.OpenCV  - starting capture
Exception in thread "OpenCV_videoProcessor" java.lang.UnsatisfiedLinkError: getDeclaredAnnotations
   at java.lang.VMClass.getDeclaredAnnotations(Native Method)
I don't know why this would be blowing up here - and I'm pretty sure it's not my code ...  so that can make it difficult.  It might be the guy who wrote the the Java interface to OpenCV  (called JavaCV)  ... I've submitted a issue on his project http://code.google.com/p/javacv/issues/detail?id=74 ...  He's a really sharp guy (a Fellow Canadian living in Japan) ... I think he has his interface running on Android - which is my next target too
 
 
Possibly with the latest release we would not have this issue.  I attempted to compile JamVM 1.5.4 (no dice) fell back now to 1.5.3 - looking on details of installing now.....
 
The Ugly
I mentioned I made the makeitwork script which is a bit kludgy, so are the directory paths to the JamVM and classpath... So is the fact we aren't using the "latest" releases
 
The Good

The Invoker and RemoteAdapter Services came up and stayed ...  Which is great !
This means possibly that you will be able to attach to it from your windows box.
You might start thinking at this point what you want your robot to do?
It would be nice to get port 6767 forwarded to the Chumby too - that way I could connect an instance from here (Portland) and it would allow me to test and debug some of the issues.
Since we are at a point of refactoring, you also might want to think what parts you want on you ChumbyBot - for example you mentioned a larger USB thumbdrive - now would be the time to upgrade those parts...

 

References

 


 

 

 

 

 

 

 

 

 

 

 

Ro-Bot-X's picture

Classpath

I probably messed up the classpath part of the instalation, I am trying to re-install it. Oh well, I'm a noob at linux, easy to mess things up. I'll let you know if it all comes true in the end. 

admin's picture

Woot - I connected

This is one instance of MRL running on a PC in Portland, OR connected to another instance running on a Chumby in Toronto !

Shweet ! - So "theoretically - this should give me the ability to start services such as Speech on the Chumby"

 

admin's picture

Arduino on Chumby

For the Arduino Service its necessary to use rxtxSerial with Java
For the Chumby a librxtxSerial is needed....

Possible list of binaries are http://rxtx.qbang.org/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/

 

Ro-Bot-X's picture

Possible uses for Chumby as a robot brain

I have been trying to make a smaller version of an old butler robot, see my MiniEric robot. I got stuck at mapping and also at vision (color blob recognition by AVRcam). So I was thinking to use Chumby instead of a laptop running Linux to do all the stuff a microcontroller is not able to do. Here is the list of the processes I think will run on the Chumby:

- Vision - color blob, face, objects, etc.

- Speech - TTS or wave files

- Voice recognition (if possible)

- Mapping - keep track of the position in the environment, plot a course to get to a specific point

- Communication (serial) with lower level modules through a Master module (Arduino compatible)

The lower level modules will be connected to the Master module through I2C. There will be at least 2 modules: a Servo module and a Motor module. Perhaps it will be easier if instead of the master module we tap into Chumby's I2C interface.

admin's picture

2009-06-08

Trying to get serial communication working on Java on Chumby.  This means native libraries - specifically rxtx serial library from http://rxtx.qbang.org/wiki/index.php/Download

Downloaded the source as the binaries in the ToyBox did not work.

Downloaded this guy  

http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip

unzipped - and ran configure 

got an error from Jikes and the configure script saying to set CLASSPATH

set the classpath to the old JVM and classes (0.91)

 

export CLASSPATH=$CLASSPATH:/mnt/storage/jamvmdl/lib/share/jamvm/classes.zip:/mnt/storage/jamvmdl/lib/glibj.zip

 

Then got a warning

WARNING: configure is having a hard time determining which
directory contains the file jni_md.h. Edit Makefile and fix the
variable JAVANATINC to point to the correct directory.
 
Downloaded the GNU classes 0.91 to /mnt/usb-E0FD-1813/classpath
 
File exists here - /mnt/usb-E0FD-1813/classpath/classpath-0.91/include/jni_md.h
 
Manually hacked Makefile 
 
Boom - /mnt/usb/bin/javac: No such file or directory  - What the hell it has to have it here?
 
I wished this thing had "where"
 
Bubbly:/mnt/usb-E0FD-1813/classpath # find / -name javac
find: /proc/24805: No such file or directory
/mnt/usb-E0FD-1813/classpath/classpath-0.97.2/tools/com/sun/tools/javac
/mnt/usb-E0FD-1813/classpath/classpath-0.97.2/tools/resource/com/sun/tools/javac
/mnt/storage/bin/javac
/mnt/storage/jamvmdl/javac
 
cp /mnt/storage/bin/javac /mnt/usb/bin/javac
 
path /mnt/usb/bin - does not exist   Arrggh WTF?
 
hacking up Makefile more
 
found - JAVAINCLUDEDIR = /mnt/usb/include  - how the hell did it come up with that?
 
WTF?  - these don't even exist...
 
 

maybe resolved through some symbolic link ... dunno
 
changed to 
 
#JHOME = /mnt/usb/lib                                               
JHOME = /mnt/storage/lib                                            
#JPATH = /mnt/usb                                                   
JPATH = /mnt/storage  JHOME = /mnt/usb/lib
JPATH = /mnt/usb 
 
further .......    next issues
 
 

Boom Issued 2 system warnings:
*** Semantic Warning: I/O warning: "No such file or directory" while trying to open /mnt/storage/lib/classes.zip.
*** Semantic Warning: I/O warning: "No such file or directory" while trying to open /mnt/storage/lib/RXTXcomm.jar.
 
Yikes - lots of crud

Bubbly:/mnt/usb-E0FD-1813/classpath # find / -name classes.zip
find: /proc/25747: No such file or directory
/mnt/storage/share/jamvm/classes.zip
/mnt/storage/jamvm/jamvm-1.5.3/lib/classes.zip
/mnt/storage/gcc/usr/share/jamvm/classes.zip
/mnt/storage/lib/share/jamvm/classes.zip
/mnt/storage/jamvmdl/share/jamvm/classes.zip
/mnt/storage/jamvmdl/lib/share/jamvm/classes.zip
/share/jamvm/classes.zip
 
yuk .. fixing .. propegating sloppyness 
 
/mnt/storage/lib # cp /mnt/storage/jamvmdl/lib/share/jamvm/classes.zip .

/mnt/storage/lib # cp /mnt/storage/myrobotlab-0006/lib/RXTXcomm.jar .
 
Further.......
 

Boom
bin/bash: /mnt/storage/bin/javah: No such file or directory
make: *** [/mnt/storage/rxtx/rxtx-2.1-7r2/gnu/io/CommPortIdentifier.class] Error 127
 
BIG BOOM
shoot - the currently installed classes/jvm does not have a javah 
Bubbly:/mnt/usb-E0FD-1813/classpath # find / -name javah
find: /proc/26911: No such file or directory
/mnt/usb-E0FD-1813/classpath/classpath-0.97.2/tools/com/sun/tools/javah
/mnt/usb-E0FD-1813/classpath/classpath-0.97.2/tools/gnu/classpath/tools/javah
 
Goose-chase over - Objective now is to complete install of the new JamVM & GNU classpath
 
 
admin's picture

GNU Classpath classpath-0.97.2

downloaded classpath-0.97.2 to /mnt/usb-E0FD-1813/classpath

following http://wiki.chumby.com/index.php/Java

using :

 

./configure --build=i386-linux --host=arm-linux --prefix=/usr/arm-linux --with-jikes --disable-gtk-peer --disable-alsa --without-x --with-jni

 

Boom

 

checking for pkg-config... no
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.
*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.
configure: error: Library requirements (gconf-2.0 >= 2.6.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
 
Downloaded pkg-config-0.26
 

Boom

checking for pkg-config... no
./configure: line 13540: --exists: command not found
configure: error: pkg-config and glib-2.0 not found, please set GLIB_CFLAGS and GLIB_LIBS to the correct values
 
Now WTF - that seems to be a rather circular dependency !?!

did not find pkg-config in the Chumby sources here - http://files.chumby.com/source/

Made an account and posted request here in the ChumbySphere http://forum.chumby.com/viewtopic.php?id=6727

Just found Chumby SandBox - http://wiki.chumby.com/index.php/Scratchbox   might be promising...

 

 


 

 

admin's picture

ARRRGGGH !

Caught between a 

ROCK

Sun's embedded Java works great - but rxtxSerial needs javac - which IS NOT PACKAGED WITH SUN'S BINARIES !

AND A HARDPLACE

The open source JamVM 1.5.4 (latest version) needs over 40 Megs of memory to compile ARRGH

 

compiled JamVM 1.5.3 (has enough memory)

 

installed
cp -p inst_classes.zip /usr/arm-linux/share/jamvm/classes.zip
# unzip -o inst_classes.zip -d /usr/arm-linux/share/jamvm/classes
/bin/bash ../mkinstalldirs /usr/arm-linux/lib
 
Current configure options
 
chumby:/mnt/storage/classes/classpath-0.98# ./configure --build=i386-linux --host=arm-linux --prefix=/usr/a
rm-linux --disable-gtk-peer --disable-alsa --without-x --disable-gtk-peer --disable-gconf-peer --disable-pl
ugin
 
ERROR with jamvm not available in configure
 
 
 

admin's picture

Wow ...

This has been a huge learning experience...

I have started a new "clean" post...  some of the things list what you should not do.  Sometimes that's more useful.

The node is currently on the front page here - http://myrobotlab.org/node/96

I do not believe I have ever used a tool chain and cross compiled,   I was avoiding it at all costs, but fortunately the Chumby wiki had an easy to step through installation page (link is on the new post).

I installed a number of toolchains and crosstools, crosstools-ng ect ...  all with varying results..

At this point I have compiled AND TESTED my first cross compiled c program on the Chumby .. (Build on my Linux x86 and run on the Chumby)   IT WORKED !   Yay - hopefully it will work for the bigger programs .. specifically rxtxSerial & OpenCV & GNU Classpath

admin's picture

One step closer

Here I'm connecting to the Arduino Service running on Chumby - So I've made progress.. I've cross-compiled the librxtxSerial.so.   Previously, this service would not even start.  Now it's started but there is still an error.  The "port" selector is blank... So I'll have to tackle this next.... 

These are where values and parameters can be controlled manually on the Arduino, of course they can be controlled by other Services too.  For example a Motor service just attaches to the Arduino.  Once its attached on a set of pins then other Services can control the Motor without having to know about any of the Arduino details.  (Like Bocks ! )  
 

Green tabs are remote (to me) - the arduino tab is green when its not selected.  Alright, progress, but back to the bit twiddling ...

admin's picture

Cross Compiler Environment

 

[gperry@trematode zlib-1.2.5]$ echo $PATH
/usr/arm-linux/bin:/bin:/usr/sbin:/usr/bin
 
Always configure / build / make with :
./configure  --prefix=/usr/arm-linux
 
zlib - the first "install" i did into the cross compiler environment does this :
 
[gperry@trematode zlib-1.2.5]$ make install
cp libz.a /usr/arm-linux/lib
cp libz.so.1.2.5 /usr/arm-linux/lib
cd /usr/arm-linux/lib; chmod u=rw,go=r libz.a
cp zlib.3 /usr/arm-linux/share/man/man3
chmod 644 /usr/arm-linux/share/man/man3/zlib.3
cp zlib.pc /usr/arm-linux/lib/pkgconfig
chmod 644 /usr/arm-linux/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /usr/arm-linux/include
 
admin's picture

Can't get by the configure of JamVM

configure error: zlib is missing

although I build and installed it within the cross compiler environment

it installed into /usr/arm-linux

but the cross compiler appears to be getting the bulk of its material from /usr/arm-linux/arm-none-linux-gnueabi

cp /usr/arm-linux/include /usr/arm-linux/arm-none-linux-gnueabi/include/c++/4.3.2
cp /usr/arm-linux/lib/*.a *.so /usr/arm-linux/arm-none-linux-gnueabi/libc/lib    (YIKES)

Got past the lib missing - but got 

 

checking for zlib.h... no
configure: error: zlib.h is missing
 
Hmmm... missed the correct include - trying again ... (oh yeah its c++ an i'm using c at the moment)
 
 

cp /usr/arm-linux/include /arm-none-linux-gnueabi/libc/usr/include/ (OYE VAY)
 
WORKED !!! - and my bad boy puter has more than 40 Megs memory - so I could compile the Latest & Greatest ! (shweet!)
 
admin's picture

OpenCV cross compile build

Notes:

went through cmake gui build - filled out cross compile flags (will upload CMake files)

had to move /usr/include to /usr/include_gcc and
link /usr/include  --->  /usr/arm-linux/include (Yikes)

several times got frustrated with get_time_day not linking - seems there was no -lrt   "realtime" lib reference ... AND THIS all came about because I had "linux" instead of "Linux" as platform !!!!! (YARG)

Problems with jpeglib - no .h found .. tried downloading source <reference>  compiled and installed but no library was built (yarg) ... just took suport out of the cmake file...

BUILDING BUILDING BUILDING ..  and then   undefined reference to `cv::SIFT::SIFT(double, bool, bool, int, int, int, int)'

 

LOOK AT THIS -> https://code.ros.org/trac/opencv/ticket/910
 
I love good developers ... who poke projects  !   -- applied patch   That's right a bug for a non-android arm ...  android android .. its all about android
 
built OpenCV - have a library for OpenCV 2.2.0 + SIFT patch
 
JavaCV now needs jni so's    
 
Down loaded JavaCV and loaded into NetBeans (I usually use Eclipse) - JavaCV uses JavaCPP another exceptionally clever project by Samuel Audet.  The JavaCPP is an interface using JNI to C++ - read more here http://code.google.com/p/javacpp/
 
JavaCV project generated the JavaCPP files and I have begun to cross-compile them with Chumby's toolchain
 
command for successfully creating  libjniopencv_core.so is
 
g++ -I/usr/arm-linux/arm-none-linux-gnueabi/include/c++/4.3.2/ -I/home/gperry/javacv-read-only/javacv/src/com/googlecode/javacv/cpp -I/home/gperry/chumby/OpenCV-2.2.0/modules/core/include -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/include -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/include/linux /home/gperry/javacv-read-only/javacv/build/classes/com/googlecode/javacv/cpp/jniopencv_core.cpp -Wall -O3 -fPIC -shared -s -o libjniopencv_core.so -L/home/gperry/chumby/opencv.build/lib -lopencv_core
 
To generate the interface use javacpp
java -cp "/home/gperry/javacv-read-only/javacpp/dist/javacpp.jar" com.googlecode.javacpp.Builder
 
The build failed because it was making x86 parameters use a arm cross compiler
 
I will generate the source in x86 and attempt to correctly cross compile it for the arm.
 

admin's picture

Remember to remove Android jars

Just so there is not (more) confusion regarding which jni interface libraries to use.

admin's picture

ARM JNI builds

The following commands were used to build the jniopencv_* shared objects in an arm-2008q3 environment

g++ -I/home/gperry/chumby/OpenCV-2.2.0/modules/imgproc/include/ -I/home/gperry/chumby/OpenCV-2.2.0/modules/calib3d/include/ -I/home/gperry/chumby/OpenCV-2.2.0/modules/features2d/include/ -I/home/gperry/javacv/javacv/src/com/googlecode/javacv/cpp/ -I/usr/arm-linux/arm-none-linux-gnueabi/include/c++/4.3.2/ -I/home/gperry/chumby/OpenCV-2.2.0/modules/core/include -I/home/gperry/chumby/OpenCV-2.2.0/modules/flann/include -I/home/gperry/chumby/OpenCV-2.2.0/modules/video/include -I/home/gperry/javacv-read-only/javacv/src/com/googlecode/javacv/cpp -I/home/gperry/chumby/OpenCV-2.2.0/modules/video/include -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/include -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/include/linux jniopencv_video.cpp -Wall -O3 -fPIC -shared -s -o libjniopencv_video.so -L/home/gperry/chumby/opencv.build/lib -lopencv_video