User avatar
xpineapple
Posts: 4
Joined: Wed Dec 26, 2012 12:01 pm
Location: S/E Asia

Raspberry Pi to Arduino communication

Wed Dec 26, 2012 1:57 pm

I've been trying to make Raspberry Pi talk to Arduino through the USB serial port. I've using Soft-float Debian “wheezy” but will use whatever is recommended. I've gone through numerous articles online to try to ensure that I can compile on Raspberry and download the code to the Arduino. As it compiles, it seems like it's working, and then after about half way, it errors out like this -

...arduino/Print.cpp:44:9: error: ‘prog_char’ does not ...

I get errors related to Print.cpp, even if it's just an empty program with empty loop and setup functions. My power supply and USB powered hub are solid; I do not believe this is a power issue. Can someone provide some suggestions as how I can break apart this problem and troubleshoot each part towards a solution? Somehow, I'm missing a small piece of the puzzle.

Thanks!

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Raspberry Pi to Arduino communication

Wed Dec 26, 2012 4:22 pm

I've written stuff to communicate between Pi and Arduino via USB and it all "just works". (Pi is just another Linux box from that point of view)

One thing though; I use Raspbian on the Pi and I urge you to upgrade too, however I'm also sure that that's not the source of your problems, but you'll soon find yourseif in a minority of 1 soon with regards to the number of people running traditional soft-float on the Pi...

I've no idea about your serial code on the Arduino though. That error at compile time sounds like an error in the library, or your program using it. without more context it would be hard to pin-point the error - e.g. the few lines before & after that line of your own program...

-Gordon
--
Gordons projects: https://projects.drogon.net/

User avatar
xpineapple
Posts: 4
Joined: Wed Dec 26, 2012 12:01 pm
Location: S/E Asia

Re: Raspberry Pi to Arduino communication

Thu Dec 27, 2012 4:43 am

Great, Gordon, thanks for your reply. I've being running linux for a couple years now...several years on and off before that...mostly Ubuntu, but Fedora and Redhat too - so, I'm fairly confortable with Linux. Maybe a couple of the old tutorials messed my config up. I will set something up new again and try to do it the straight forward way. I also have faster SD Disk (class 8) coming soon by mail, plus the newer Pi with more memory). I don't like the soft-float
Debian version - I've already noticed that things are buggier with it, and it's too slow.

As for Raspbian, I did installed it on another SD Disk, and it's great. :-) How do you shell into it? Somehow I did manage to shell into it a couple of times, but I'm not sure what the proper way is? Or is there a way to until XBMC on "hard-float" Debian as well (like I did on my Mint Linux laptop!).

I'm looking forward to doing this tutorial on RPI - http://www.instructables.com/id/Tweet-a ... /?ALLSTEPS. I did this on my Mint Linux laptop, and it works great, but had to rewrite the twitter parsing logic to be less intensive and friendlier with the Twitter API. Happy to share my code with anyone that's interested. :-)

User avatar
xpineapple
Posts: 4
Joined: Wed Dec 26, 2012 12:01 pm
Location: S/E Asia

Re: Raspberry Pi to Arduino communication

Thu Dec 27, 2012 11:56 am

I see some good Raspbmc command line options via the FAQ. As for RPI <> Arduino, I will try the standard Debian Wheezy again, and use a class 8 32GB SD Disk, which should arrive in a week or so...and maybe it will work out better.

User avatar
daremick
Posts: 11
Joined: Mon Dec 17, 2012 5:09 am

Re: Raspberry Pi to Arduino communication

Thu Dec 27, 2012 12:17 pm

I use Arduino for all my projects, and am just now getting into RPi. try this link to the arduino forums (they have helped me many times) and this particular thread mentioned your error code

/home/laurent/Desktop/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp:44:9: error: 'prog_char' does not name a type

http://arduino.cc/forum/index.php/topic,87186.0.html

KarlB
Posts: 4
Joined: Fri Dec 28, 2012 12:56 am

Re: Raspberry Pi to Arduino communication

Sat Dec 29, 2012 2:56 am

I too have had a lot of trouble over the last couple of weeks getting my Raspberry Pi (512) talking to my Arduino Duo via USB. I tried many of the 'fixes' posted online, with differing amounts of success, none of them very stable. Out of curiosity I bought another SD card and today did a fresh download of Raspbian Wheezy, made sure it ran, did any updates etc. The I installed Arduino and after a reboot connected up the Arduino Duo and it works! Just to make sure it wasn't a fluke I went back and formatted the original SD card and reinstalled Wheezy and Arduino on that, it all works as well now. In fact I've just got the humidity and temperature sensor DHT11 running on the DUO along with an LCD readout running the sketch from the Arduino IDE on the Pi. Not sure which version of Wheezy I was running before but 2012-12-16 with the Arduino Duo seems stable, well it has been running most of the day.

User avatar
xpineapple
Posts: 4
Joined: Wed Dec 26, 2012 12:01 pm
Location: S/E Asia

Re: Raspberry Pi to Arduino communication

Tue Jan 01, 2013 1:56 am

Yeah, it does just work! Some old tutorials from last year sold as fixes just mess things up. It works!

jointeffort
Posts: 2
Joined: Fri Feb 15, 2013 1:33 pm

Re: Raspberry Pi to Arduino communication

Fri Feb 15, 2013 2:05 pm

@xpineapple: I'm just starting with Pi and Arduino, which tutorials did you follow?
And is the Arduino powered lonely by Pi's 5V USB?

TylerReed
Posts: 3
Joined: Thu Mar 14, 2013 9:54 pm

Re: Raspberry Pi to Arduino communication

Thu Mar 14, 2013 9:57 pm

Hi. I just posted a video on YouTube where I got this working, going from a PC with Remote Desktop to the Pi and the Pi to Arduino using PySerial. You can check it out here: http://www.youtube.com/watch?v=G59H2Jt0KKQ. Please don't hesitate to ask questions.

-Tyler

Return to “Other projects”