itsacoolaccount
Posts: 19
Joined: Sun Mar 18, 2018 8:04 pm

Arduino Uno and Raspberry Pi 3 SSH

Fri Mar 23, 2018 4:20 pm

Im currently working on a project which uses raspberry pi 3 as a server and an arduino uno as a controller for the raspberry's power. Im trying to use the arduino to restart the pi if it crashes and use it as an alternate way to use SSH if I get locked out.



I'd just like to know if its possible to contact the Arduino via SSH or another remote control software.

If it is then could someone point me the way to do it?

Thanks.

Code: Select all

sudo apt-get install coffee

samighi11
Posts: 46
Joined: Wed Apr 17, 2013 8:27 pm

Re: Arduino Uno and Raspberry Pi 3 SSH

Sat Mar 24, 2018 10:17 am

SSH implies networking and Uno doesn't have it (speaking loosely). You can certainlyconnect the RX/TX using the USB TTL cable to the PI. I do it currently. It shows up as /dev/ttyUSB0. What you can do is write a heartbeat from the PI to Arduino waiting on serial read. (I don't have
a setup handy to get you the exact code). If you don't get, say, 3 heartbeats, you could restart the PI, however you think you can. You can also try to write from Arduino to Raspi to see if you missed a heartbeat. I would put a safe guard to ensure you don't reboot more than 1 hour at a time. Since the Raspi won't heartbeat till booted. You will also need to initd the job as a service to it starts on boot (or crontab it)

link to cable for communicating - https://www.adafruit.com/product/954

there are tricks to ensure you are talking at 9600 baud open both sides, so research that

Let me know if this all works. I can help later today

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Arduino Uno and Raspberry Pi 3 SSH

Sat Mar 24, 2018 11:23 am

I use a standard usb cable with a Mega2560. It shows as /dev/ttyACM0.

My code wouldn't be much help. It is quite complex, using one RPi Zero W to send commands and receive data from the Mega via serial, and the other RPi 3 sends the commands and receives data vis UDP wireless to the Zero W.

Return to “Advanced users”