Hi,

I now have MRL successfully running on a BBB ;-)

I have used python to test the Adafruit  BBB Python modules (linux shared objects .so) for GPIO and successfully switch LEDs on and off . (note need to run as root or sudo due to permissions under default ubuntu user.

>>> import Adafruit_BBIO.GPIO as GPIO

>>> GPIO.setup("P8_14", GPIO.OUT)

>>> GPIO.output("P8_14", GPIO.HIGH)

>>> GPIO.output("P8_14", GPIO.LOW)

Now I want to test this from MRL but cannot get the Adafruit_BBB.GPIO to import.

This is MRL code I have written to test it out

1 egg_path='/home/ubuntu/.python-eggs/Adafruit_BBIO-0.0.19-py2.7-linux-armv7l.egg-tmp'
2
3 sys.path.append(egg_path)
4
5 import Adafruit_BBIO.GPIO as GPIO

It fails on line 5 with

-----Traceback (most recent call last):  File string, line 5, in moduleImportError: No module named GPIO    at org.python.core.Py.ImportError(Py.java:290)    at org.python.core.imp.import_logic(imp.java:785)    at org.python.core.imp.import_nam..........

Can any one suggest a way forward. I have searched the www and there is not a lot of info on trying something like this.

I'm not a coder, so would rather integrate existing modules ;-)

here is the link to Adafruit's BBIO modules

https://github.com/adafruit/adafruit-beaglebone-io-python

thanks in advance

 

Alessandruino

10 years 4 months ago

Hi raydnz... Python in MRL is a java version of python : jython... Actually we can't manage external library, i tried importing a library in jython but it was not sucessfully... 

BUT, if you tell us what is your goal, we can found a walk-around to achieve in your project...so if i were you, i would write what is my goal and what is your project about ( you need access to GPIO pin?why?what is connected to that pin? what kind of hardware you have? (arduino, bbb, servos) are you making a robot??

Welcome in MRL :)

Alessandro

raydnz

10 years 4 months ago

Hi Alessandro - the project is to build an underwater ROV with my 2 teenage boys.

The BBB will be used as the controller on the ROV for the propellers and the buoancy (requires 3 PWMs), a live video feed (using mjpg-streamer) and 12v LED lighting (switched using MOS-FET on GPIO pin)

The ROV will be linked to the surface through a tether (Cat5 cross-over) and have a surface laptop and joystick controlling the motors via tcp/ip with browser window showing the video.

I researched software and found that MRL did everything I wanted - joystick service, remote service between 2 "computers" and controlling of GPIO pins and PWM pins for Escs/motors.

I have a BeagleBone Black running ubuntu 3.8 oracle java 1.7.0_25 and MRL - yes it took some doing ;-)

I will be using pin P9_11 (GPI0_30) to switch the underwater LED lamp on/off

I will be using pins P9_14, P9_21, P9_22 as PWM for the 3x motors/propellers each connected via an ESC. Each ESC must be capable of both forward and reverse.

As mentioned the Python scripts from Adafruit seem to work well, I expect I just need some type of wrapper around them so they are able to be referenced from inside MRL?

Appreciate any help you are able to offer as this is the final hurdle before I build a bench prototype.

thanks & Merry Christmas from NZ

Ray

 

Great Project Ray !

I fortunately have a BBB too, although recently I have been working on a RasPi primarily.   The RasPi project uses Pi4J - it offers GPIO access and higher level protocols such as I2C.  I'd like to do the saem for the Beagle Board Black.   In that way you would load the Beagle Board Black service in MRL and would have the ability to access the pins from any other service (including Python)

Let's get started ! ...  Creating BeagBoardBlack service now :)

GroG

10 years 4 months ago

Thought it might give you some ideas....

looked very cool - full article here - http://www.unmanned.co.uk/unmanned-vehicles-news/unmanned-autonomous-underwater-vehicles-uuv-auv-news/us-department-of-energy-selects-lockheed-martin-auv-to-help-reduce-deepwater-drilling-risks/

BTW - BBB should be good to go if you were to connect it to an Arduino through one of the BBB's uarts, but I know you wanted to conntect through the GPIO - it will take me a little while to figure that out...

a bit beyond my wee workshop smiley

I was wondering about an arduino as an alternate/add-on but the BBB seems to be the complete package for what I want to achive.

If there is no alternative then I will have to go down the arduino route. I am in no real hurry as have to build the rig

thanks