RaspberryPi the Arduino Development Tool
Not really too much to say here. There has been much talk on the forums about using arduino and similar systems to provide additional IO capabilities for the RaspberryPi.
So I decided to take things a little further and discover whats needed to use the RaspberryPi itself as a development platform using the Arduino IDE.
Following the simple steps below, it is possible to install, and run the arduino IDE, and then re program your USB connected arduino.
I’m not going to go into too much detail, but simply provide you with the recipe to replicate my success
Firstly log on using the pi user (I did it over ssh). Then it’s a simple matter of grabbing the arduino IDE and installing a few packages.
wget http://arduino.googlecode.com/files/arduino-1.0-linux64.tgz
tar zxvf arduino-1.0-linux64.tgz
sudo apt-get install avr-libc
sudo apt-get install libftdi1
sudo apt-get install avrdude
sudo apt-get install openjdk-6-jre
sudo apt-get install librxtx-java
cd arduino-1.0
for i in $(find . -name "librxtxSerial.so") ; do cp /usr/lib/jni/librxtxSerial.so $i ; done
for i in $(find . -name "RXTXcomm.jar") ; do cp /usr/share/java/RXTXcomm.jar $i ; done
cp /usr/bin/avrdude /home/pi/arduino-1.0/hardware/tools/avrdude
cp /etc/avrdude.conf /home/pi/arduino-1.0/hardware/tools/avrdude.conf
You should now be able to run the arduino IDE (note if you’re using ssh don’t forget the -X option to enable X forwarding)
pi@rasp:~$ cd arduino-1.0/
pi@rasp:~/arduino-1.0$ ./arduino
Here’s the output from running the simple blink test, target an arduino decimilla connected over USB.

And again, this time running the ASCII table to test serial connectivity over USB
This entry was posted by admin on May 22, 2012 at 7:21 pm, and is filed under arduino, RaspberryPi. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
-
-
#2 written by admin 12 months ago
-
#4 written by Oscar B 4 months ago
I’ve not able to make Arduino IDE work on Raspberry pi. I installed from raspbian repository and manually and when I launch it this is the message:
Exception in thread “main” java.lang.ClassFormatError: Truncated class file
at sun.misc.FloatingDecimal.(FloatingDecimal.java:1870)
at java.lang.Double.toString(Double.java:196)
at java.lang.String.valueOf(String.java:2985)
at java.security.Provider.putId(Provider.java:433)
at java.security.Provider.(Provider.java:137)
at sun.security.jca.ProviderList$1.(ProviderList.java:71)
at sun.security.jca.ProviderList.(ProviderList.java:70)
at sun.security.jca.Providers.(Providers.java:56)
at sun.security.util.ManifestEntryVerifier.(ManifestEntryVerifier.java:47)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:331)
at java.util.jar.JarFile.getInputStream(JarFile.java:403)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:706)
at sun.misc.Resource.cachedInputStream(Resource.java:77)
at sun.misc.Resource.getByteBuffer(Resource.java:160)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:266)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)Can you help me?
-
-
#5 written by cmatthews 12 months ago
Thanks for this, great post. Possibly one typo which might confuse newcomers to Linux. There is one tiny space missing between the path to the tarball and the tar command.
i.e. I think that:
wget http://arduino.googlecode.com/files/arduino-1.0-linux64.tgztar zxvf arduino-1.0-linux64.tgz
should read:
wget http://arduino.googlecode.com/files/arduino-1.0-linux64.tgz tar zxvf arduino-1.0-linux64.tgz
-
#7 written by bergie 12 months ago
-
#10 written by bergie 12 months ago
-
#12 written by bergie 12 months ago
Good news. I finally got the Arduino GUI going, and it compiles code. I re-typed the whole code and to make sure I got things correct, I enter a couple of times in between lines, and I got no errors.
However starting Arduino on the Pi, I notice it also complains about some “RANDR missing.” Same as in your screenshot. I have the Uno board on USB and my GUI says that the Arduino is connected to Com1. Tools >> Serial port is greyed out. I notice your screenshot show “devtty1USB0″ which seem to be correct if connected to usb. Is there some setups I must go through to get it working? Is it that “-x” thingy I miss?
Regards -
#14 written by bergie 12 months ago
Thanks for the reply.
I am using Arduino Uno. I have checked and verified my setting with windows, and there is enough power available to run the Arduino. Its just not giving me the required port. When I try and upload, it says in a friendly orange bar “Serial Port Com1 not found. Did you select the right one from Tools > Serial Port?” As I said, the serial port is greyed out.When I do “lsusb” it shows the Arduino as device 004 ID 2341 on bus 1. I verified that this is my Arduino, by unplugging it and doing “lsusb” again. Then its gone. Plugging in again, it becomes device 005 ID 2341.
Much appreciated.
-
#15 written by admin 12 months ago
-
#16 written by jeb365 11 months ago
I’m having similar issues with my rev 2 Uno with the 8u2 chip. I’ve spent night after night trying to find a fix. As a noob I’ve learned a lot by encountering this problem but I’ve ran out of patience now.
Couple of questions. For the non-ftdi Unos is it a case of some clever clogs writing the drivers for them an they’ll work? And, should this board work-
http://www.oomlout.co.uk/breadboard-arduino-compatible-kit-bbac-p-211.html?zenid=fc51e7b8279a3520ad5024d0cb1c6fb8
This board uses an ftdi chip/programming cable to communicate.
Any help would be fantastic.
cheers
-
-
#17 written by Garret T 11 months ago
There’s a little hack you have to do to make the IDE work with UNO. I think it stems from the way the code checks for serial devices.
1) Before running the Arduino IDE, plug in your Arudino UNO.
2) Observe that there is now the device /dev/ttyACM0 writable by the dialout group of which pi is a member.
3) Make a hard link ttyS0 to that device. It’s a little easier if you cd to /dev.cd /dev
sudo ln ttyACM0 ttyS04) Start the Arduino IDE and load a sketch.
5) Under Tools->Serial Port select /dev/ttyS0
6) Upload your sketch. Sweet!When I get a chance I’ll pore through the Arduino/Processing source code and attempt to figure how to make it look for /dev/ttyACM0.
-
#18 written by Erik 11 months ago
-
#19 written by Jonathan Rodgers 10 months ago
Thank you very much, this worked a treat. I stopped the arduino application, then used:
sudo ln ttyACM0 ttyS0
and started arduino again. Clicked on tools>Serial Port and selected /dev/ttyS0
Worked a treat, thanks. Just a quick note: if you unplug the arduino board USB and then plug it in again, then run:
dmesg
You will get output telling you what it has been detected as, in my case:
usb 1-1.3: new full speed USB device number 6 using dwc_otg
usb 1-1.3: New USB device found, idVendor=2341, idProduct=0001
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
usb 1-1.3: Product: Arduino Uno
usb 1-1.3: Manufacturer: Arduino (www.arduino.cc)
usb 1-1.3: SerialNumber: 649323437383514001E1
cdc_acm 1-1.3:1.0: ttyACM0: USB ACM deviceSo here I could see that it was detected as /dev/ttyACM0
I assume that this is what happens on newer revision Arduinos that don’t use the ftdi chip.
-
-
-
#20 written by Daniel 11 months ago
To program the Uno, you need to use the latest librxtx and not the one provided by apt-get.
Run the following;
wget http://ftp.us.debian.org/debian/pool/main/r/rxtx/librxtx-java_2.2pre2-11_armel.deb
sudo dpkg -i librxtx-java_2.2pre2-11_armel.deb
-
This is fantastic info folks. I’m still banging my head though.
What distributions/images are you using?
Here’s what I see:
1. IDE can compile and everything and can “see” ftdi based Arduinos.
2. When downloading, the target resets, but then goes quiet, and the IDE eventually times out either with an out of sync message, or a programmer not responding.I manually ran avrdude, and it can at least verify signatures (I’ll have to try a complete program tonight.
Any guidance much appreciated
-
#23 written by TeeCee 11 months ago
-
Off topic I’m afraid.
I see you are using OS X as X server. Since upgrading to spindle and wheezy if had a a couple of problems:
1) If I start lxsession I no longer have the LXDI panel
2) Most X applications work, except scratch which displays a blank unresponsive window.(I’ve tried the X server in both full screen and windowed mode)
Have you had better results?
Thanks
-
#27 written by David 10 months ago
-
-
#30 written by Phil Johnson 10 months ago
I too am using an Uno; to monitor wine Demijons to calculate the S.G. and hence strength etc. I already have a Arduino shield fitted with a serial RS485 chip that “talks” Modbus to an Ubuntu box running Apache and PHP to display SCADA-like information on Web pages.
This is the project – the Pi will take this task over. Can’t wait!
-
#31 written by Tim B. 10 months ago
Thanks for the tutorial!
I got it working, but can’t compile any sketches. I’ve tried the blink and analog read serial examples.
The errors I get are basically as follows
“Print.cpp: In member function ‘size_t Print::print(const __FlashStringHelper*)”
“error: ‘prog_char’ does not name a type”
“error: ‘p’ was not declared in this scope”Anyone else see that and have a resolution?
-
#33 written by Dan 9 months ago
I found this:
http://lpig.wordpress.com/2012/04/14/arduino-1-0-and-gentoo/
Not tried it yet, but looks promising.
If any one tries before me let us know how you get on.
Cheers
-
#38 written by TideMan 9 months ago
-
#41 written by johnd 5 months ago
Everything works OK till I download (OK, upload!) my sketch to
the Arduino Uno R3 board. It programs OK, then the Arduino IDE
locks up tight. Cannot even use the “X” to close the window! It
give no response to ANYTHING. The Uno board is programmed
correctly and responds exactly as expected, but the IDE is
frozen.Using “top”, I find that the java process is hogging the cpu. Only
way out is to “kill -9″ it. And that kills the Arduino IDE. This only
happens on the Raspberrypi version; windoze version of IDE works fine……..What could be causing that?
cheers,
johnd -
#42 written by Jack 4 months ago
I successfully installed 1.0.1 with your wget/tar method. It successfully installed an entry in the ‘electronics’ menu and ‘programming’ menu.
I have tried to duplicate the process for 1.0.2 and now 1.0.3. 1.0.2 appears to have installed itself in /home/jack/arduino-1.0.2 and 1.0.3 in the /arduino-1.0.3. In both cases, the Arduino icon continues to bring up 1.0.1. Attemps to execute arduino from inside their (1.0.2 or 1.0.3) directories fail wirh a string of error messages.
Can you please list the procedures to update the 1.0.1 installation to 1.0.1 and 1.0.3.
Thank you, Jack
-
- Bald Wisdom » Blog Archive » Preparing for à la mode: Raspberry Pi and Arduino
- Arduino IDE on Raspberry Pi and Arduino Uno « netduinoplusfun
- RaspberryPi @Homelabs » RaspberryPi the Arduino Development Tool | Arduino and Makers world | Scoop.it
- RaspberryPi @Homelabs » RaspberryPi the Arduino Development Tool | Raspberry Pi | Scoop.it
- Raspberry Pi and Frontline SMS | Terence Eden has a Blog
- Raspberry Pi | Pearltrees
- » BRWRY Development List BRWRY.com
Didn't find any related posts :(

Your statement
“note if you’re using ssh don’t forget the -X option to enable X forwarding”
Which command does this refer to ?