4G and local lan networks

Good evening,

I have a device connected to an isolated local LAN consuming a data stream from sensors. I also have a 4g modem on the device. I followed the cellular modem instructions dropped the file into /resin-boot and it ends up in /etc/NetworkManager/system-connections. After a reboot I see no IP assigned to the wwp0s20f0u2i12 device, which is my modem. manually configuring the modem seems to work:

    root@8fde118:~#  mmcli -b 0
  --------------------------------
  General            |  dbus path: /org/freedesktop/ModemManager1/Bearer/0
                     |       type: default
  --------------------------------
  Status             |  connected: yes
                     |  suspended: no
                     |  interface: wwp0s20f0u2i12
                     | ip timeout: 20
  --------------------------------
  Properties         |        apn: telstra.internet
                     |    roaming: allowed
  --------------------------------
  IPv4 configuration |     method: static
                     |    address: 10.106.128.70
                     |     prefix: 30
                     |    gateway: 10.106.128.69
                     |        dns: 10.5.80.241, 10.5.209.36
                     |        mtu: 1500
  --------------------------------
  Statistics         |   duration: 510

I need both the modem and the ethernet to be configured. The ethernet needs a static IP to communicate with the local LAN and the 4g modem is used for balena VPN.

To test things out I need to be able to change the contents in /resin-boot so that needs to be rw. I believe I did a mount -o remount,rw resin-boot / to get that done.

So where can I look for guidelines on the above ?

Thanks for your time

Hello, could you please expand on the steps you took to configure the modem manually, I would expect this to work following the steps in the cellular modem setup guide. Also, the command you link should correctly remount resin-boot as writable, but could you clarify why you need the partition to be writable?

I remount the /resin-boot rewritable so I can add and update the files on the disk. Balena OS is installed to the devices fixed disk, its a Dell 7212 industrial tablet. Re-installing every time I need to change a network config while debugging is not a option. Is there a better way of adding files to /resin-boot. Or perhaps more pertinently, setting config in /etc/NetworkManager/system-connections ? My understanding is that the contents of /resin-boot/system-connections is mount-binded at boot time to the active partition.

So from my notes:

root@8fde118:~# mmcli -m 0 --simple-connect="apn=telstra.internet,number=*99#"
successfully connected the modem
root@8fde118:~# mmcli -m 0                                                    
  -----------------------------
  General  |         dbus path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: d72e399c23c72c017ce17085209cc6c77e54f938
  -----------------------------
  Hardware |      manufacturer: Sierra Wireless, Incorporated
           |             model: DW5816e Snapdragon? X7 LTE
           | firmware revision: SWI9X30C_02.24.05.03
           |    carrier config: default
           |      h/w revision: EM7430
           |         supported: gsm-umts, lte
           |           current: gsm-umts, lte
           |      equipment id: 355201082019766
  -----------------------------
  System   |            device: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2
           |           drivers: cdc_mbim
           |            plugin: Dell
           |      primary port: cdc-wdm0
           |             ports: cdc-wdm0 (mbim), wwp0s20f0u2i12 (net)
  -----------------------------
  Status   |    unlock retries: sim-pin2 (3)
           |             state: connected
           |       power state: on
           |       access tech: lte
           |    signal quality: 0% (cached)
  -----------------------------
  Modes    |         supported: allowed: 3g; preferred: none
           |                    allowed: 4g; preferred: none
           |                    allowed: 3g, 4g; preferred: 3g
           |                    allowed: 3g, 4g; preferred: 4g
           |           current: allowed: 3g, 4g; preferred: 4g
  -----------------------------
  Bands    |         supported: utran-1, utran-6, utran-5, utran-8, utran-9, eutran-1, 
           |                    eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
           |                    eutran-21, eutran-28, eutran-38, eutran-39, eutran-40, eutran-41, 
           |                    utran-19
           |           current: utran-1, utran-6, utran-5, utran-8, utran-9, eutran-1, 
           |                    eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
           |                    eutran-21, eutran-28, eutran-38, eutran-39, eutran-40, eutran-41, 
           |                    utran-19
  -----------------------------
  IP       |         supported: ipv4, ipv6, ipv4v6
  -----------------------------
  3GPP     |              imei: 355201082019766
           |     enabled locks: fixed-dialing
           |       operator id: 50501
           |     operator name: Telstra
           |      registration: home
  -----------------------------
  SIM      |         dbus path: /org/freedesktop/ModemManager1/SIM/0
  -----------------------------
  Bearer   |         dbus path: /org/freedesktop/ModemManager1/Bearer/0
  root@8fde118:~#  mmcli -b 0
  --------------------------------
  General            |  dbus path: /org/freedesktop/ModemManager1/Bearer/0
                     |       type: default
  --------------------------------
  Status             |  connected: yes
                     |  suspended: no
                     |  interface: wwp0s20f0u2i12
                     | ip timeout: 20
  --------------------------------
  Properties         |        apn: telstra.internet
                     |    roaming: allowed
  --------------------------------
  IPv4 configuration |     method: static
                     |    address: 10.106.128.70
                     |     prefix: 30
                     |    gateway: 10.106.128.69
                     |        dns: 10.5.80.241, 10.5.209.36
                     |        mtu: 1500
  --------------------------------
  Statistics         |   duration: 510

ta for your attention mate

Hi, from your comment I take it you are running balenaOS on a Dell 7212 tablet, is that correct? If so can you share what device type and base images are you using? I would think that there could be missing support for that tablet, but since you say manual configuration works ok it’s probably not the case.

Regarding network config changes while debugging, the easiest that comes to mind is using DBus to talk to NetworkManager, admittedly it can be a bit cumbersome. We have a section on the docs that covers it: https://www.balena.io/docs/reference/OS/network/2.x/#changing-the-network-at-runtime
Note that we do not advise to do any essential networking configuration on a container for production environments because containers can fail to start and leave your device offline.

I’m running Linux 8fde118 5.2.10-yocto-standard #1 SMP PREEMPT Fri Jan 31 07:23:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, the latest balenaOS 2.47.0+rev1, NUC variant in local mode.

Yes is a Latitude 7212 Rugged Extreme Tablet from Dell with embedded basically everything. Its a company standard IP rated device that runs our stack adequately.

Seems I have gaslighted myself into believing changing files in /resin-boot/system-connections/ and then rebooting gets the config updated. How do I change network config, add new connection files and so on on a installed device ? iirc last year I could just drop the new config in /resin-boot/system-connections/, new files or changed old files, and the change would propagate to /etc/NetworkManager/sytem-connections after a reboot. This does not happen anymore. How am I supposed to work this problem ?

So a colleague set me straight, adding config files to /mnt/boot/system-connections gets propagated to /etc/NetworManager/system-connections on boot.

The only way I could make the modem auto start was to specify the interface-name=cdc-wdm0 explicitly.

So I drop a file telstra in /mnt/boot/system-commands/

[connection]
id=telstra
type=gsm
autoconnect=true
interface-name=cdc-wdm0

[gsm]
auto-config=true
apn=telstra.internet
number=*99#

[serial]
baud=115200

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

Hi @sthysel , indeed your colleague is correct, the files in /resin-boot/system-connections/ will always be copied to /etc/NetworkManager/system-connections and is just a simple copy so will not delete any existing files in that destination. It is strange that you would need to specify the interface name, we haven’t come across that type of issue before but I am glad you have it working automatically now. Let us know if you need further help.

The take here is that /mnt/boot/system-connections is rw already, so rather use that than /resin-boot/system-connections/ which is not, the latter being a ro bind mount. If you follow the docs as they stand you will be surprised that /resin-boot/system-connections/ is ro, the assumption seems to be that the user is fiddling with a sdcard and then plugging it in. That’s just not a workable solution while debugging.

Yes indeed, fiddling with the SD card is only meant for pre-configuration and definitely not for debugging. For debugging connections the recommend way would be to have a serial console (or keyboard and screen) on a development version of balenaOS, then it would be a matter of using the nmcli tool to create connections, etc and this writes to /etc/NetworkManager/system-connections . Once one has found a working configuration files that can be copied out and used across other images by pre-configuring on the SD card. I think the challenge in this thread is that we don’t have much experience with tablets and don’t know what interfaces are available to you for debug, its far easier on boards where serial and ethernet are exposed.

Yes that in a nutshell is more or less how I worked it. fwiw the tablet is basically a powerful board with a embedded screen. In my case a coral tpu hangs of the usb port and I do real time video inferencing on a number of HD streams. A usb->nic hangs of it as well. I ssh to it balena ssh 10.0.0.69 and go about my business (btw, bash auto-completion is broken in vi mode, do set -o vi and hit TAB to autocomplete, you get a TAB in vi-mode, that’s pretty annoying).

Hope that helps someone else.

Thanks for the additional info, the team should have asked you for all that information upfront as it helps a ton to with recommending how to go about debugging, I assume they just recommended the way they knew would work for any device as they probably assumed a tablet PC didn’t have usb and usb->nic . For the bash auto completion, is that in the OS? if it is, could you open a github issue on https://github.com/balena-os/meta-balena/issues and im sure the team will fix it asap. Thanks for all the feedback

Sure, raised a issue https://github.com/balena-os/meta-balena/issues/1848

perfect, thank you!