Networkmanager in multicontainer apps

raspberrypi3
wifi
network

#1

Hi,

I am having very uncommon problems with networkmanager. I don’t know the source of the problem: network-manager? resin-supervisor? raspberry-pi hardware? router which my device is connected to?

The exception I had is the following:

<class 'dbus.exceptions.DBusException'>; org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

After this error, I had to reboot my device (raspberry-pi 3) because it appeared disconnected in the resin dashboard. Do you know what the problem would be?

PD: I am using a Raspberry-pi3 model B, the HOST OS VERSION is Resin OS 2.12.5+rev2 and the SUPERVISOR VERSION is 7.1.18.

Thank you in advance!


#3

Just if it provides more information to you:

  1. 15 minutes before this error, I got this one:
<class 'dbus.exceptions.DBusException'>; org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/Devices/223
  1. Every 5 minutes, I am using a device rescan to refresh detected wifi networks, even if the device is connected to anyone (just for statistics purposes). I am using this (python code, using the package NetworkManager):
    for device in NetworkManager.NetworkManager.GetDevices():
        if device.DeviceType != NetworkManager.NM_DEVICE_TYPE_WIFI:
            continue

        ssid_configs = device.GetAccessPoints()

        # rescan if only finds 1 (the connected one) or less APs
        if len(ssid_configs) <= 1:
            # rescan ssid
            device.RequestScan(options=dict())
...

#4

To provide some more debugging info, here’s some idea:

  • if you can provision a development image, that has a debug serial that you can connect to, with some extra hardware. Do you think that would be possible? Because in that case, when the device seems disconnected, but still running, the internal logs should be still present and readable through the debug connection, and should provide some more clues what happens.

  • do you have a chance to try any newer resinOS version, just in case? I think there were some networking related fixes in 2.12.7 (newer NetworkManager), which might help. How reliably you can reproduce this issue? (wondering if it was a good way to see if one version exhibits it and the other is safe)

  • at which point of the code the error appeared? In device.GetAccessPoints() or device.RequestScan(options=dict())? Just wondering for more info.

  • after the device appears disconnected in the dashboard, is it visible on the local network? do any of the LEDs blink in a 4-blink-pause… pattern?

Hopefully this would let us have some ideas. Alternatively can enable persistentLogging (see the docs), and thus after the reboot, the logs might have some more info (checking journalctl in the host OS).


#5

Well, it is hard to reproduce it (the device is placed in a different city and it is in production, used by a client of mine). The problem happens to the same device once a month approximately. I have other devices in the same app and they never had this problem, so I suspect that it is related to the router in that place.

I know that the device is working because I generate some logs, and I can check that the device is not connected to a network until I reboot it (not the router, just the raspberry pi 3). The error is thrown when I use this: NetworkManager.NetworkManager.CheckConnectivity().

Any ideas? Is there a way to “reboot” the wifi interface through NetworkManager, equivalent to reboot the device? It might solve this problem when it happens.

Thank you very much!


#6

The application container can communicate with NetworkManager via DBUS (https://docs.resin.io/reference/resinOS/network/2.x/#changing-the-network-at-runtime) which probably has an endpoint to do what you want, it has endpoints for most things.