I've started the Arduino service, because I want to control some servo motors and get some sensors inputs, but I can't connect MRL and Arduino together, because it's not finding the serial port. So, what to do?

Note 1: I'm able to upload sketches to Arduino board with the IDE of Arduino.

Note 2: During the process of installation of each new service (for example: Arduino, Joystick) occurred an error, but in the end shows the message that the service is installed.

GroG

9 years 11 months ago

Hi Mech.  My first guess is that the starting script is out of sync with the raspi's /libraries/native

ARM can be a bit more complex than x86.  They have come out with multiple instruction sets and the native code has not been compatible. So, that means we have to identify each "type" of ARM processor now. armv6 is Raspberry Pi  armv7 is odroid.  To add to the complexity is hard floating point versus soft floating point.  These are incompatible with one another too :P

Step 1: check to see what mrl has downloaded under the libraries/native/???  A Raspberry PI "should" be identified as armv6.hfp.32.linux  (arm architecture version 6 hard floating point 32 bit linux).  If you see it and librxtx so's then your half way there.

Step 2: the other half is the startup script.  If you use myrobotlab.sh it has the incorrect directory path in the LD_LIBRARY_PATH  .. it needs to be changed to this

LD_LIBRARY_PATH=`pwd`/libraries/native/armv6.hfp.32.linux:`pwd`/libraries/native/x86.32.linux:`pwd`/libraries/native/x86.64.linux:${LD_LIBRARY_PATH}

The sad part of this is the scripts are bundled in a release - but I can no longer post releases on googlecode :P

Let me know how it goes, but I think when you change the script it should work for you Mech

GroG

9 years 11 months ago

#!/bin/sh
 
LD_LIBRARY_PATH=`pwd`/libraries/native/armv6.hfp.32.linux:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
 
java -classpath "./libraries/jar/*" -Djava.library.path="./libraries/native/armv6.hfp.32.linux" org.myrobotlab.service.Runtime -service webgui WebGUI python Python
 

 

This is webgui.sh - inside there are 2 (yes TWO) places where the pathing needed correcting.
In this case I removed all the excess kruft and high-lighted the 2 areas needing correction.

On Linux systems the environment variable LD_LIBRARY_PATH lists all the directories which shared libraries can be loaded from (there is no equivalent on windows).  So it needed correcting along with the -Djava.library.path - which is a JVM environment variable which tells the JVM what directories shared libraries can be loaded from. 
 
I hope to change this in the future so that there will only be a libraries/native (and nothing more) .. but for the moment - changing the scripts will make it work.
 
I tested by plugging in an Arduino and starting one from the Runtime.
 
I don't use the desktop anymore, just a ssh console and the web gui.
 
This is how I created an Arduino - it looks very similar to the Python code - but is a one liner URL
 
and to see my ports I did another one liner URL
 
Which comes back with a JSON response of my Mega's port
[
  "/dev/ttyACM0"
]

Yay !

You should be able to make the same mods in the myrobotlab.sh script if you want to continue to use the gui.