On 30/12/2020 21:33, Chris Green wrote:
I have a Beaglebone Black (SBC like a Pi) on my boat in France that I want to be able to connect to using ssh, how can/should I do it?
I have a number of possible solutions in mind but I won't give them here as that might prevent open and lateral thinking being applied.
Speed is not an issue, a 2400 baud dial up connection would be sufficient. Security is not a big issue, there is no sensitive data on the Beaglebone Black. I guess it needs to be reasonably secure against misuse but thats all. It's inside the boat in a fairly secure marina so the hardware is safe enough.
Cost is important, this isn't something I want to spend lots of money on. A solution costing £7/month seemed a bit expensive to me, I'm aiming at significantly less, one or two pounds a month is fine.
The boat is moored in an urban environment, power is (fairly) freely available. When I visit the boat I have lots of time to do fairly complicated set-up if needed but once I've left it's totally inaccessible, it has to work totally unattended, there's no one to phone up and ask to 'press the reset' or similar.
So, let your imaginations run wild and come up with some ideas! :-)
Obviously you need some sort of network to connect to. This could be a phone network (with a modem?) or a mobile phone network voice or data. Or the internet via A Wifi Network, or Satellite Internet. You could investigate LoRa, but I think you wouldn't be able to transfer enough data, even if it was fast enough.
Without knowing what facilities & networks are at the marina, it's impossible to know the correct way to go, but if there's no wifi in the marina, then I would expect some sort of widgit that uses a data sim to connect to the local mobile phone's data network would be the way to go.
Just as an aside - is there public or payable for wifi anywhere near - close enough that you could connect to it with a long-range wifi antenna?
Connecting to it, you'll either need a VPN, to run an SSH Server, or some other proprietary remote control/connection software. (e.g. Dataplicity https://guide.openenergymonitor.org/setup/remote-access/)
As there's no-one to press reset for you (as you say), you'll need some sort of watchdog device. This monitors that everything is OK. Typically this wouldn't be run on the main device, because if the main device crashes, then the watchdog will crash and not be able to restart the machine. You might be able to use the beaglebone to send a signal to some simple electronics that provided it gets a signal at a regular interval, either keeps the power connected, or perhaps doesn't press a reset button. Possibly a more plausible device would be an arduino. It must receive some sort of regular signal from the beaglebone. If it doesn't get one, it should presumably attempt to shutdown the beaglebone, then kill it's power, then restart it. Restart must automatically attempt to reconnect to your network/the internet. This attempting to reconnect must repeat until connected, or eventually give up and reboot.
An alternative to a intelligent watchdog could be a simple mechanical or electronic power switch which kills the power for a period (10 mins, 15 mins, 1 hour, whatever the minimum is as long as it's at least minute), once a day or once a week. This would ensure the device would try and reconnect to the networking solution every day. It would mean that the device would be inaccessible regularly, but it should mean that it comes back to you afterwards, even if it's crashed. Given a mechanical switch that switched off for 15 minutes once per day, you'd have to run an up-time monitor on the beaglebone. Once it got close to the power-kill time (i.e. after 23 hours and 40 minutes say), it would have to do a controlled software shutdown - that way when the timer kills the power, the machine has already safely saved everything and has logged off. My thinking on this is based on a Raspberry Pi - software shutdown before killing the power.
Steve