I’m trying to figure out a way to change the NetworkManager configuration for a cellular connection while the device is in the field. In the event that the premade configuration’s APN is wrong, I want to be able to change the APN, test that the new APN works, and have that change applied permanently.
The obvious way is to change the config on the SD card with the ResinOS image and re-flash the board (Beaglebone Black), but I’m trying to steer away from that as the person that would be doing this isn’t technical (and it’s a large time overhead if we need to try a bunch of different APNs).
I’ve thought of include using the Beaglebone’s debug serial port, and writing a Python script to copy over a config file. The problem is that the root filesystem is read-only, so any config I copy over could only be placed in
/etc/NetworkManager/system-connections, which would be overwritten on reboot. Further, I’m reading that the serial port is disabled (or at least, no TTY session is attached to it) on prod images, so this wouldn’t work anyways.
The method mentioned in the docs for runtime configuration changes involves using DBUS, which is a reasonable solution except there’s no good way of allowing a user to input a new APN to a device that isn’t online. The serial port doesn’t work, so they can’t input data through that, and since the device isn’t network connected I can’t use the dashboard to pass in data through an environment variable.
The only way I’ve thought of that sounds like it could work is reading from a text file placed on an SD card, and using a script that runs in my container’s
start.sh to configure the connection using the DBUS API.
I’m starting to feel like my situation is very niche, but if anyone has experience dealing with this kind of thing or has any suggestions as to possible solutions, I’m all ears.
Thanks in advance!