Makeblock arduino library and raspberry pi via serial


#1

I have the Robot Starter kit V2.0 and I am looking to expand on the basic system to build a robot controlled via a web interface/mobile app using a raspberry pi to control the baseboard I/O over serial. I’ve done this for other applications using nanpy (https://github.com/nanpy/nanpy) to use an Arduino board as a slave I/O board.

I’m not sure how to get the makeblock library to work with nanpy, does anyone know how to do this or, if not, a different way to do much the same? Has anyone gotten the makeblock baseboard to play nice with an rpi?


#2

To do Serial control, the usual approach is to Flash the Arduino with something like the “Standard Firmata” (that comes with the Arduino IDE) and then trigger the I/O capabilities of the Arduino via Serial from the PI. I couldn’t find info on this on the nanpy site, but I’m assuming it’s something similar. If so, you’ll have to extend Firmata to use the custom software/hardware that MakeBlock uses. See the Firmata site for info on this.

It would of course be much easier if you told exactly what you are making as it might be that controlling an Arduino over serial to a Raspberry Pi and then to web or something is a slightly clumsy way to solve something like this. A piece of hardware like Adafruit’s CC3000 could probably let you bypass the entire PI if that’s what you’re after.


#3

Thanks,

I don’t know why I’ve never seen firmata before, even though it comes as an example with the arduino IDE. I’m going to familiarize myself with it and see if it will work for my project.

My project needs the pi to do the computational heavy lifting for the video and audio. I have a pi camera module and will be setting it up to stream video so that the video feed will show the robot’s POV and the user can control it remotely while observing the camera feed. I also want the pi to be able to process audio both ways if possible (mic and speaker). I may have the pi run the web-hosting directly, but since this will be a batt powered robot, I may have to consider alternative configurations to reduce power load when idle.


#4

Yeah. For crunching audio & video, a PI is the way to go. The core idea of Firmata is that you’re reducing the Arduino to a “hardware-slave” that does whatever the PI says. You just send commands via Serial to control stuff & the Arduino reports back status of it’s ports.

If you require some specific hardware that is not in the standard version of Firmata, you can add things to it as well.


#5

do you know if there is a way to use the makeblock library functions with firmata, or will I have to replace those manually?


#6

You’d have to add them to the default distribution as Firmata does not know anything about Makeblock. It shouldn’t bee too hard if you’re used to programming. I’d try using this as a starting point: http://sourceforge.net/p/firmata/mailman/message/30238158/

It would be great if you could post your findings and eventually result here if you go down that path :smiley:

J


#7