Log to production host over SSH with direct ethernet cable?

Has anyone ever felt the need to connect to a production device over ethernet, locally? For example to troubleshoot a few things on the host OS or restart the modem when the 3G connection is down and the device shows up as Offline on the dashboard?

Just wondering if it is possible to SSH into a production (not development) version of ResinOS.

This post details how to use a USB console cable but I am not sure whether it applies to our use case: Using a Console Cable

This recent post details what can (and cannot) be done remotely, while I am interested in local debugging: Remote access to Raspberry PI 3 in LAN

Could this work? (our fleet is made of 40+ Pi Compute Module 3 devices): http://carbonstone.blogspot.fr/2014/02/connecting-to-pi-from-laptops-ethernet.html

Thanks in advance,

Laurent

Hi. So why can you not follow Remote access to Raspberry PI 3 in LAN for your local debugging purposes?

Hi,

I have not tried it, precisely because of the remote vs. local aspect. But I see your point. I imagine a local debugging setup can be seen as a small LAN. I will try this tomorrow and let you know. Have you tried it yourself?

I was also wondering if ResinOS was going to prevent me from connecting, compared to a standard Raspbian.

Laurent

Hi Lv82, I suspect that you’re right that this might not work on production ResinOS images.

Security is a huge deal to us, and having an network accessible ssh port open could invite various nefarious intrusion attempts. To prevent this, we only make ssh available over the secure VPN connection.

I’m guessing the main problem occurs when the devices network is down, otherwise I assume resin ssh would be sufficient right?

There’s a few approaches that might help to deal with a modem that’s acting up. First of all it’s worth making sure you have autoconnect set: https://docs.resin.io/reference/resinOS/network/2.x/#cellular-modem-setup

if that doesn’t work and the modem needs a reset, you could write a custom script that monitors the modem’s / network status and either reboot the entire device by calling the API on the device supervisor:
https://docs.resin.io/reference/supervisor/supervisor-api/#post-v1-reboot

Or in the case where it’s not acceptable to have random reboots on connectivity failures, you could try to hack up a custom script that resets the modem device, there’s some inspiration here:

1 Like

I was under the same impression after reading Remote access to Raspberry PI 3 in LAN.

That makes perfect sense.

Absolutely. We’d like to be able to debug things locally and run a few commands on the host OS to understand why the device drops the cellular connection. Mostly when we add a new device to the fleet by hanging it up a postlamp, where it is not easily reachable later on.

Our Ublox L210 modem is recognized as an ethernet device so we copy the following file to system-connections whenever we flash a new device:

[connection]
id=public-cellular
type=ethernet
interface-name=usb0

This being said, I am willing to test your approach with type=gsm and autoconnect=true. From what I understand, network management was vastly improved in ResinOS 2.x and the file above was created with Resin 1.x in mind.

Great minds think alike. We already have a pending Jira ticket for this :slight_smile:

I will certainly have a look at this too.

Thanks a lot @chrischabot. While the initial issue is not entirely solved yet, I learned a great deal reading your answer.

Out of curiosity, on what device is this?
For rpi3 we did some work for an ublox L-210 recently: https://github.com/resin-os/resin-raspberrypi/pull/188/commits

Good catch @floion :slight_smile: That was us. Thanks again for your efforts, by the way. And the answer to your original question is Pi Compute Module 3.