I really have to post my
I really have to post my trials because I think I could use some experience from your build.
I’m building from a DFRobot 4WD with a Romeo board (arduino) and I’m planning to add on top a Raspberry Pi to have some OpenCV stuff.
Could you explain what you used to interact between your 2 boards ?
Thanks
This was a little bit
This was a little bit tricky, since i wanted to use PHP as the server language on the Raspberry Pi.
My first try was to connect them via I²C - connected via the GPIO pins (RasPi as master, Arduino as slave), here is a quite nice tutorial: http://blog.oscarliang.net/raspberry-pi-arduino-connected-i2c/
I’ve written commands via a bash-call “i2cset”.
Since i could not read over I²C for some reason (i2cget just didn’t triggered the “read”-event on Arduino) i started to connect them over a USB cable. (Serial communication)
Here is a quite nice tutorial as well: http://blog.oscarliang.net/connect-raspberry-pi-and-arduino-usb-cable/
The only thing i had to add was a bash call after every boot:
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
After this call the serial communication worked quite fine, i’m using simple fopen/fread/fwrite commands from PHP to access the /dev/ACM0 usb device.
P.S.: Do not power your Arduino from an external power source when connecting it via USB cable with your Raspberry Pi because it will get powered over the normal USB port without a fuse.
If you are having any problems you are welcome to contact me!
That’s the tutorial I wanted
That’s the tutorial I wanted to follow!
If I understand what is explained in the tutorial, there’s no voltage issue if the Pi is the master and the Arduino the slave.
But as I tend to bump on each “that’s not going to happen” in my experiments, so I’ll be carefull and find the way to protect the physical connection
Thanks
In my case the I²C
In my case the I²C connection worked fine (except of the problem with the onRequest on Arduino not getting triggered via i2cget) when connecting the SCI/SCL/GND directly to Arduino/Raspberry Pi GPIO.