we have a setup with four “Services” containers running on a Raspberry Pi 3 that is connected to the internet with a LAN cable.
This works fine and I am very happy with the quick and ordered deployment with resin.
However one thing has confused me for a few days:
When I am in a terminal within one of our services,
the internet connection does not really go up and down with ifconfig.
When I use “ifconfig eth0 down”, the device stays online in the resin interface.
The only thing that turns different is, that I cannot ping anything anymore from the device.
When I use “ifconfig eth0 up”, I still cannot ping anything anymore from the device.
The network it’s self is controlled via the HostOS, and unless you’ve specified that one of those services should run in permissive mode, they wouldn’t actually have access to hardware or device controls.
That said, networking on ResinOS is controlled via NetworkManager, and can be controlled from the containers via a DBUS connection to the HostOS, details are available at:
thanks a lot for the information.
The documentation is very helpful.
Is there an overview somewhere of what Resin is doing (or not doing) to maintain network connections?
I am trying to get a sense about which points of failiure I will have to take into account in my own code and what already safely works out of the box.
I was looking for the weird reconnection routines, like switching USB power or rebooting if nothing works.
Basically like these guys are doing it in their project:
Do you think that is a good idea to implement?
Are there similar features already in resin OS?
Or is the “default” Network manager switching the only thing going on?
Anyways, thanks a lot for your fast and kind responses!
In most cases the network manager will just do a regular reconnect – some cellular modems are a bit more finicky though and need a real hard reset to come online again (the “Have you tried turning it off, and on again” approach).
So in most cases, provided the hardware is stable and not to finicky, you should be fine with the default setup – otherwise a cronjob that checks the network and issues a device reboot over the DBUS connection, or something more complicated like the above if device reboots are sub-optimal, are great work-arounds.