Let's Make Robots!

Arduino Service - almost like "real" software ....

Arduino Service - almost like "real" software ....

"Finally"...  presenting "The Arduino Service - reloaded (again)" -  it's not ready for "prime time" , but it's starting to come together.  It would be great if I could get some testing & feedback..  with enough updates I'm hoping it might even be useful :)

If your interested,
here are the steps to get started in graphic detail..

Step 1 download the latest "bleeding edge" build from the build server...

http://myrobotlab.dyndns.org:8080/job/myrobotlab/ws/myrobotlab/dist/

At the time of this writing it was at intermediate.751.20120901.0645 - press the lastest link..

Download this release by pressing ... (all files in zip)

After its done downloading, extract the contents somewhere...

Double click the myrobotlab.bat or .sh depending on operating system...

If all goes well you should see MRL startup - click over to the Runtime tab (it's the BORG + number tab).
This allows you to select what services you want in MRL.

Many of them require additional components to run.  Arduino needs all the avr stuff and other doo-hickeys..

Right click on Arduino, and select install...

It "should" start downloading the appropriate parts depending on your flavor of operating system...  It won't work through a proxy server, and we have had problems with some of the service components being blocked by anti-virus software...  Some services (opencv) require native libraries (dlls or so's) which some filewalls will not allow...  hopefully, you'll get a happy green check-mark :D

The windows install of Arduino is larger than the Linux one - being that Linux already has many of the components to run avr cross compiler... so if you have windows you'll have to wait a bit...

Restart - now MRL should allow you to start an Arduino service.  Oh... heh, did I mention it was a good time to plug your Arduino in at this point :D

I "think" I can support almost any Arduino, I put some work in to suppor the different pin configuration of the Mega 2560... but let me know if    "it no worky" for you...  I'll try to get more boards supported...

go back to the tab and right-click -> start

Now you'll need to name the service... you could call it George or Mary, or some other silly name..  it does not matter, but it needs to be unique..  This name is used for the different services to talk to one another...

I named my with the un-imaginitive name of "arduino"

Now you should see an Arduino service tab in the GUI.

Select the appropriate board & serial port under the tools menu.

wait for the "good times...." :)

The first sub-tab which comes up is the "editor" and a file called MRLComm.ino
MRLComm.ino is a Arduino script file which allows communication from MRL to an Arduino based board.

The first thing you want to do is compile it - with the arduino compile like button :)

Then upload it to the board.

Please be patient with the serial port ... for some reason it takes a long time to connect - on Windows 7 its the worst...  but I'll look into it (later) 

Next after uploading - you want to re-establish a connection to the boar - the "upload" has to tear down the connection.  But we want to connect - hit the connect button..

Now if everything went correctly, you should be able to tab to the oscope - and turn on a few pins analog or digital and see the results.  Sometimes I plug in a plain wire to an analog pin to see how much it affects noise :) 

Sometimes its more convienent to have different screens showing at the same time or in different positions, most tabbed components you can right click - and detach for more effective screen space

So now hopefully you have a working Arduino service - the service itself is not the gui, but the GUI is a service.  These means it can run just the same without a gui, it can be controlled programmatically.  Jython is a service which you can write scripts to do things with the Arduino service.  Or multiple Arduino services.  Everything in MRL speaks to one another in a standard message format.  So Arduinos can speak to other Arduinos, or OpenCV can tell the Arduino to move Servos or Motors etc etc...

Well, let me know how it works for you or if you have ideas on how to make it better..

Thank you..

good times....

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

So everything can be controlled by Python script..   It's the glue between the services...

If you got your Arduino working previously throught the gui, you "should" be able to use this script & simply copy/paste it to the jython tab - then hit the  execute button..

You'll probably have to adjust the COM setting appropriately, but it "should' start an Arduino - and add a digital & analog trace..
Initial startup is slow - but that's because of a delay in the RXTXComm package - the Arduino IDE has this same delay starting on windows 7 64 bit... 

from time import sleep

from org.myrobotlab.service import Arduino

 

arduino = runtime.createAndStart('arduino','Arduino')

 

# set and open the serial device 

# arduino.setSerialDevice('/dev/ttyUSB0', 57600, 8, 1, 0)

arduino.setSerialDevice('COM6', 57600, 8, 1, 0)

sleep(4)

arduino.pinMode(14, Arduino.INPUT)

# arduino.digitalReadPollingStop(7)

arduino.analogReadPollingStart(14) # A0

arduino.digitalReadPollingStart(7)

 

copy/paste/click

wait & view

Here's a 2560 Mega ...  I had to "zap" the pde in from the Arduino IDE...  this is after fighting Window 7 64bit with drivers for an hour Grrr...  Found some more parts to fix (of course), but it is possible !

Here is my Mega 1280 working....however i had to program the chip with the serial routine before hand..(the sketchupload noworkio for 1280).. and the bleeding comment box appears to have updated my the mrl software YAY.

I'm looking into the upload problem...  It's got the elves flumoxed at the momo...
Can you link me to the Prop resources you use, I'd like to make a Prop service but will need to take a crash course.. 

Fixed ....

  • data sent to the console during upload
  • board, pins, & oscope changes when switching to Mega boards
  • auto-update fixed up
  • "no worky" - button as suggested by TinHead works 

So, theoretically if you got a new enough version you can simply press :

Help -> About -> I feel lucky, give me the bleeding edge !   - to get updates

Thanks.

I always had bad feelings about this particular pin13 on this board. I could tell he was going to be trouble maker. Well, its his loss, he could be triggering a ping or enabling a motor, but HA! You ain't doin' any of that now, are ya, pin13? 

As of now, there is no pin13...   He is dead to me.

I have no idea what the hell is going on with my 13... 

Yup, I have all analogs and all the digitals/ pwm's work via the "pins" tab. I have digital inputs on the scope too. 100%

Oddly enough, I am getting exactly 1.75v on my pin13 when I send it high. Every other digial pins works just fine with a clean 5.04v on each. Once again, the blink sketch works great but when run via MRL, only 1.75v. Friggin' weird, dude.

Oh well, whatever, I don't need to stinkin' pin13 --screw it.

Everything else is working. I am going to go play with it now.

 

 

Post a picture !

Pin 13 saw one to many LEDs ? 

i could switch my 13 led on and off via MRL.