Using Connman from inside a container?

Ryan i have been speaking with a balena colleague. Connman will not work out of the box with balenaOS as we are using Network Manager to manage all the connectivities.

There are 2 possibilities here:

  1. configure balena NM to ignore the WiFi and use Connman
  2. change the code to talk to NM instead of Connman

Ryan at what moment is not working? At the setup? what i see now in the logs is running properly (packet-forwarder).

Ahh unfortunately that’s what I suspected that it’d be conflicting.

Currently when I do get Connman to run in the container, it causes NM on the host to have issues connecting with the VPN I believe.

At the moment for development I have the units connected via ethernet for development which is why the packet forwarder works fine, however most customers would be using wi-fi of which is what it crashes out on.

I suspect the solution then might be to see if the code can be changed to use NM to get it to work with Balena.

why do you want to use Connman? is this being used on the helium gateway-config?

Yeah it’s what is used by that software to configure network interfaces.

do you think you can change to wifi-connect? https://github.com/balena-io/wifi-connect

Unfortunately I don’t think so as the idea is that the user can configure it from the helium mobile application.

Screenshots from running on native Pi OS.

I suspect as maybe a worst case senario it might be possible to get the user to connect with wi-fi connect and then in the app say that the user clicks use ethernet instead but it wouldn’t then be as smooth of a process.

Yes! it’s not the best situation! if we try to disconnect the balena Network Manager. Did you try this? Turn off Bluetooth and WiFi on a running device

I don’t think I’ve tried that yet so will give it a shot shortly.

Thanks for the help.

keep me updated!

1 Like

Ok so,

I didn’t have a wi-fi configuration file on the hostos at all as I didn’t write the ethernet + wifi image as it requires details (something that wouldn’t be possible when shipping the product to customers).

I have connmand start in the container when it launches, this allows the gateway-config tool to scan for wi-fi networks but seems to break balena control. (Control of containers seems to not work and I get Online (VPN only) show.) and updating containers breaks.

Henc I think it seems to cause a conflict somewhere which potentially means running connmand is out of question unfortunately.

Could you please share more details about the error that you get please?

Currently to get it to work I run connman in the container, but by doing that takes control of the interfaces and seems to cause the supervisor to not work.

The dashboard only allows me to open a terminal in it and the buttons to reboot and stop containers doesn’t work along with it not fetching the latest version of the containers.

at that moment, you can’t see the hotspot on the helium app? or whatever you use to test connman?

the device blue-thender is the one with that problem?

When I run the service for connman I can then get it to see wi-fi networks in the helium app.

However as soon as the service starts the supervisor seems to loose communication. (Blue-thunder is the one I’m testing on and as you can see is reporting issues).

looks like you are connected via Ethernet?

Currently for testing yes.

Hi. Which kind of hardware are you using? Any dongles? Is Helium using the same adapter to both create a hotspot and connect to a wifi?

I’m currently only using a Wi-Fi dongle as our hardware doesn’t have wi-fi (Raspberry Pi Compute Module 3 Based).

The Wi-Fi adaptor doesn’t produce a wifi hotspot, instead a bluetooth dongle advertises as a device a phone can connect to. Then with the application this communicates with the device to provide it with Wi-Fi details and connect it up.

Could you post the specific error messages from both the conman container and the hostOS’ journalctl?

I’m not seeing any errors on the container running connman.

I do see this on the hostos.

Dec 30 18:33:49 88887cb resin-supervisor[16559]: [error]   LogBackend: unexpected error: Error: getaddrinfo EAI_AGAIN api.balena-staging.com
Dec 30 18:33:49 88887cb 63155923f0bc[1483]: [error]         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)
Dec 30 18:33:49 88887cb resin-supervisor[16559]: [error]         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)```