Page 1 of 1

Arduino Uno and Raspberry Pi 3 SSH

Posted: Fri Mar 23, 2018 4:20 pm
by itsacoolaccount
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.

Re: Arduino Uno and Raspberry Pi 3 SSH

Posted: Sat Mar 24, 2018 10:17 am
by samighi11
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

Re: Arduino Uno and Raspberry Pi 3 SSH

Posted: Sat Mar 24, 2018 11:23 am
by SurferTim
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.