IOIO and Raspberry Pi - Oh Yeah! (And BeagleBone Black too)

1,106 views
Skip to first unread message

Al Linke

unread,
Jan 12, 2014, 4:57:28 PM1/12/14
to ioio-...@googlegroups.com
Hey everyone, wanted to share that with the new V5 Library Ytai has just released, IOIO now works with the Raspberry Pi! This will ONLY work with new V5 library so be sure and upgrade prior.

I've got this up and running on my project now, video here

You'll see a custom IOIO board in the video but it will work the same using a stock IOIO board. In this setup, the Pi is connected to the IOIO over USB. I didn't spend much time on Bluetooth yet but I think it would work over Bluetooth too.

Raspberry Pi Setup over USB

Step 1. Download the latest Raspberry Pi SD card image from http://www.raspberrypi.org/downloads and install Raspbian

Step 2. Download the udev rules file from this page, and copy it to your rules directory (one time step)
sudo cp 50-ioio.rules /etc/udev/rules.d
Then restart udev
sudo restart udev
or
sudo /etc/init.d/udev restart 
Step 3. Plug your IOIO into a free USB port on the Raspberry Pi and check if it’s recognized using this command
ls /dev/IOIO*
Most likely you'll get back either IOIO0 or IOIO1

 

Step 4. Install Java on your Pi

sudo apt-get install openjdk-7-jre
Step 5. Now just run your IOIO app from the command line or X windows (startx)

java -jar -Dioio.SerialPorts=/dev/IOIO0 yourapp.jar    replace 0 with the number returned from step 3

One funny behavior I saw on the Pi is that when using the command above, it won't work the first time but then works subsequent times. Just do a CTRL-C to cancel and run the command again. However if you use this command and don't force the port like this:

java -jar yourapp.jar 

Then actually it does work the first time but just takes a little longer for the port scans to finish. The theory here from talking with Ytai is that this works because the IOIO lib is opening up the port initially during the port scan when there is no port forced using the -Dioio.SerialPorts=<your port> option.

If you want to set the serial port programmatically in your app, here's how to do that:

call System.setProperty("ioio.SerialPorts", "/dev/IOIOx") from your main(), before calling the "go()" method of your app.

I think the low cost nature of the Pi opens up many cool new applications for IOIO where the Pi can be left embedded in a project. Here's a few things to share to take this further:

  • PiUi - turns your Pi in a web server with a mobile friendly UI. The web server back-end is python based. So you can make a java command line call from Python. Essentially this setup puts your IOIO on the network where you can control it from any browser. 

  • Google Coder - Web based IDE for your Pi, supports javascript and node.js. Similar in concept to Protocoder. Someone would need to wrap the IOIO libraries in javascript or node.js framework of Google Coder which would be really awesome, it's a very well done implementation.

BeagleBone Black Setup over USB

Unlike with Raspberry Pi, you’ll login to the BeagleBone Black as root with initially no password. The other difference is that the BeagleBone comes with a Linux distribution pre-installed.
 
Step 1. Download the udev rules file from this page, and copy it to your rules directory (one time step)
cp 50-ioio.rules /etc/udev/rules.d
Then restart udev
restart udev
or
/etc/init.d/udev restart 
Step 2. Plug your IOIO into the USB port on the Beagle Bone Black and check if it’s recognized using this command.
ls /dev/IOIO*
Most likely you'll get back either IOIO0 or IOIO1

Step 3. Visit the Oracle JDK download page and download the “Linux ARM v6/v7 VFP Soft Float ABI” version. 

  • Copy jdk-7u4X-linux-arm-vfp-sflt.gz to your BeagleBone Black. Replace X with the latest version of Java available which was 5 at the time of this writing.
  • Perform ‘tar xzf jdk-7u4X-linux-arm-vfp-sflt.gz’ to extract the JDK
  • Perform ‘export PATH=$PATH:/home/root/jdk1.7.0_4X/bin’ to add the JDK to your path
  • Perform ‘export JAVA_HOME=/home/root/jdk1.7.0_4X′ to set the JAVA_HOME on your installation
  • Perform ‘java -version’ to verify your installation
Step 4. Now just run your IOIO app from the command line or X windows (startx).  

java -jar -Dioio.SerialPorts=/dev/IOIO0 yourapp.jar    replace 0 with the number returned from step 3

Unlike on the Pi, you must force the port on the BeagleBone or you'll get exception errors so be sure and use -Dioio.SerialPorts=/dev/IOIO0 



Ytai Ben-Tsvi

unread,
Jan 12, 2014, 5:26:36 PM1/12/14
to ioio-...@googlegroups.com
Woot!!!
Thanks, Al, for the great work and for the detailed write-up and congratulations on your sky-rocketing PIXEL v2 kickstarter.
I'm leaving you the honor of announcing this feature on the RaspPi and BBB forums (or I will do so if you don't feel like it :D)


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

Richard Wright

unread,
Apr 19, 2014, 1:16:57 AM4/19/14
to ioio-...@googlegroups.com
I have been loving IOIO OTG on my Raspberry Pi. However, sometimes, I just want a little more power. I recently purchased a 'Radxa Rock' (similar to Pi, but quad core 1.6 Ghz), which is also ARM-based. I have followed the steps for applying the udev rules, but they aren't working for me on the Radxa Rock. I don't think it is a problem with me following the instructions properly, because I've been able to get it up and running on multiple Raspberry Pis. My guess is something missing from the kernel I'm using or something like that...

What is happening is that the device is showing up as /dev/usbdev2.6 . And every time I unplug and replug it, it increments and moves to the next number (i.e. usbdev2.7). This makes me think that the udev rules just aren't being applied properly. I have verified that the Rock is properly identifying the VID and the PID of the IOIO.

I also tries (just for fun) passing in the port (java command line parameter) as usbdev2.6  (i.e. -Dioio.SerialPorts=usbdev2.6), and that doesn't work. It just says Waiting for IOIO connection, and then Waiting for underlying connection.

I'm a seasoned developer (but have fairly limited linux experience) and wouldn't mind spending some time figuring out how to get this working. Hopefully the process would be the same on various ARM mini PCs. Could somebody point me in the right direction?

Richard

Ytai Ben-Tsvi

unread,
Apr 20, 2014, 6:38:59 PM4/20/14
to ioio-...@googlegroups.com
You didn't mention which version of Linux you're running.
But anyway, the udev is not critical: all it does is give a friendlier name to the IOIO and givens the device "everyone" permissions. You can do that by hand.

Your command line needs to have -Dioio.SerialPorts=/dev/usbdev2.6


For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Mark M

unread,
Jul 21, 2016, 11:27:20 AM7/21/16
to ioio-users
Hi AI Linke,   Thank you for posting your helpful tutorial.  I have an IOIO-OTG and am thinking of getting a RPi 3B to help with other processing.  Have you played with Pi4J?  http://pi4j.com/     

Malik Atta ur rehman

unread,
Dec 29, 2016, 11:58:30 PM12/29/16
to ioio-users

Al Linke

unread,
Dec 30, 2016, 1:13:55 AM12/30/16
to ioio-users
Yes, tried Pi4J very briefly, seemed to work ok although the UI was a bit slow, but that was like 2 years ago

Ytai Ben-Tsvi

unread,
Jan 7, 2017, 10:53:13 PM1/7/17
to ioio-...@googlegroups.com
I'm assuming your question is the one in the subject and not in the message body. The answer is no, it is not currently supported. At some point I considered adding WiFi dongle support and never got around to it. Should be physically possible but new firmware will need to be written.

Malik Atta ur rehman

unread,
Jan 8, 2017, 11:58:10 PM1/8/17
to ioio-...@googlegroups.com
oky thnks allot sir 

On Sun, Jan 8, 2017 at 8:52 AM, Ytai Ben-Tsvi <yta...@gmail.com> wrote:
I'm assuming your question is the one in the subject and not in the message body. The answer is no, it is not currently supported. At some point I considered adding WiFi dongle support and never got around to it. Should be physically possible but new firmware will need to be written.

--
You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/owX8Zqb2Nj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ioio-users+unsubscribe@googlegroups.com.

To post to this group, send email to ioio-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages