Richard Bucker

The Internet of Things - phonehome

Posted at — Jan 15, 2015

During this explosion of the internet of things; the things need care and feeding. Sure, sometimes they are small and every unimportant like a bot following a crayon line but then there are other cases where cash registers, scales, remote printers, wifi gateways, or your toaster needs a hug.

One such system I designed used ssh, bash, and a semaphore file. The amazing thing is that it scaled well when I used OpenBSD as the ssh server. I even designed it with HA in mind such that there were two ssh servers that the remote devices could connect to. One weakness that the system has is that it’s not on-demand. There is a cycle time between the device and the server.

(a) make a connection to the ‘a’ server and set the timeout
(b) if the timeout expired drop the connection
© make a connection to the ‘b’ server and set the timeout

(d) if the timeout expired drop the connection
(e) sleep for 5 min

And from time to time I’ve had to wait 20 minutes to get a connection to the device. So it’s time for a new implementation and this time I want to implement it in go. Right now All I have done is look at the go/ssh library and as many examples as I can find. The problem there is that most of the examples are exactly the same and taken from the test cases provided in the source.

In the next post I will describe the requirements.

UPDATE: This link implements something that might come before a proper terminal session. On the subject the goal of this project is not to replace the ssh client side but to provide a specialized ssh framework where the tunnels and the notification are automated for a little instant gratification.