Using Connman from inside a container?

I have a peice of software that I need to run inside a container, it’s similar to the wi-fi configuration tool that’s avaialble however for this project I need to use this other software.

The software uses connman to configure wi-fi and connect it to a network, however I haven’t had success with it in a container.

I’ve given the container privileged access, access to dbus and host network access of which when I do then get it started it can control wi-fi devices but breaks communication with Balena Cloud.

Is there any ideas on how to get it to work nicely with the hostos?

Hello @Ryanteck,

Is the software you mentioning open source? When you mention conman, are you talking about this tool?

Cheers,
Nico.

Hi @ntzovanis,

The software I’m trying to containerise is open source at https://github.com/helium/gateway-config

It uses the GNU Linux tool connman (https://01.org/connman) to control wi-fi interfaces, when I get it running inside a container it seems to cause conflicts on the hostos.

Hey Ryan

If you want to make changes to the host OS’ network from the container, you should set network_mode in your docker-comopse similar to what is set in this file. That way you won’t have any conflicts I think.

Check the docker docs for more info on some of the other options - https://docs.docker.com/network/

Edit - I see that you’ve most likely already done the above from your first message - is that right? Can you share your docker-compose file?

Yep already added that.

The compose file is at https://github.com/NebraLtd/helium-miner-software/blob/main/docker-compose.yml , its multiple containers this is specifically the “gateway-config” container,

Hello Ryan, this is Marc. I have built my own diy helium hotspots! let me see if i can help you to solve your problems!

Hi @mpous,

Thanks. We’re looking at manufacturing ready to sell hotspots, essentially two of the containers are the same as DIY Hotspots (the packet forwarder and miner) which are both working fine.

However the last piece of software is the configuration tool for the ready to go hotspots, essentially it advertises on bluetooth for the official helium app to connect to which then allows the customer to connect it to wi-fi and configure the miner.

Yes! I tried some months ago to integrate the BLE configuration container on the DIY but i failed! what do you need to share via dbus?

I had to allow DBUS access I believe for bluetooth, it also hooks into it I think to communicate with the miner (I had to edit the Host OS to add the configuration files to the host DBUS Server to get it to work).

I think it also uses dbus as a communication method from the app to the miner.

Yes, probably during the configuration workflow, to identify the app with the miner this would be needed. And probably for further instructions. I’m releasing the code on a balena app to test myself if that’s ok for you.

Sure,

I can give you support access to my app if that helps as well.

ah! that’s a good idea as well… up to you!

Sure, I’ve granted support access.

Currently I’m using the staging version rather than normal if that’s suitable?

What details do I need to send over?

could you please include me on your app? i’m marc6

Hi Marc,

I’m getting an error that it can’t find your account, is that because I’m using the staging envrionment?

ah! that’s right… i’m marc on staging!

Should be done now. Thanks

One question, why don’t you declare the dbus variable on the gateway_config Dockerfile?

Ok! i see that you do it on the entry.sh script --> exec env DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket

I have it also set in https://github.com/NebraLtd/helium-miner-software/blob/main/docker-compose.yml#L32

Currently I’m not running the entry file as it doesn’t run correctly.