# Using Connman from inside a container?

**URL:** <https://forums.balena.io/t/using-connman-from-inside-a-container/229835>\
**Category:** Product support\
**Tags:** bluetooth, wifi, network\
**Created:** [December 29, 2020, 4:55pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835 "2020-12-29T16:55:31Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 12:26pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/29 "2020-12-30T12:26:52Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 12:33pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/30 "2020-12-30T12:33:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 12:41pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/31 "2020-12-30T12:41:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 12:42pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/32 "2020-12-30T12:42:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 12:43pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/34 "2020-12-30T12:43:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 12:46pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/35 "2020-12-30T12:46:08Z")

</div>

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.

 ![Screenshot_20201226-153439](https://global.discourse-cdn.com/balena/original/2X/0/05b7974d3cfb36c39451fba4d317e63acea08e4e.jpeg)

 ![Screenshot_20201226-153712](https://global.discourse-cdn.com/balena/original/2X/6/6b3a0dd2f605f2431bf380b322228be1e1607c95.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 12:51pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/36 "2020-12-30T12:51:28Z")

</div>

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](https://forums.balena.io/t/turn-off-bluetooth-and-wifi-on-a-running-device/5268/5)

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 12:52pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/37 "2020-12-30T12:52:44Z")

</div>

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

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 12:55pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/38 "2020-12-30T12:55:33Z")

</div>

keep me updated!

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 2:16pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/40 "2020-12-30T14:16:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 3:46pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/41 "2020-12-30T15:46:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 4:31pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/43 "2020-12-30T16:31:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 4:56pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/44 "2020-12-30T16:56:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 5:01pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/45 "2020-12-30T17:01:55Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [December 30, 2020, 5:07pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/46 "2020-12-30T17:07:18Z")

</div>

looks like you are connected via Ethernet?

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 5:08pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/47 "2020-12-30T17:08:27Z")

</div>

Currently for testing yes.

---

<div class="post-metadata">

**Author:** ![Ereski](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@Ereski](https://forums.balena.io/u/Ereski)\
**Post date:** [December 30, 2020, 6:11pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/58 "2020-12-30T18:11:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 6:16pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/60 "2020-12-30T18:16:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ereski](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@Ereski](https://forums.balena.io/u/Ereski)\
**Post date:** [December 30, 2020, 6:25pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/61 "2020-12-30T18:25:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ryanteck](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ryanteck/32/5108_2.png) [@Ryanteck](https://forums.balena.io/u/Ryanteck)\
**Post date:** [December 30, 2020, 6:34pm UTC](https://forums.balena.io/t/using-connman-from-inside-a-container/229835/63 "2020-12-30T18:34:58Z")

</div>

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

I do see this on the hostos.

````auto
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)```
````

[Previous page](https://forums.balena.io/t/using-connman-from-inside-a-container/229835.md?page=1)

[Next page](https://forums.balena.io/t/using-connman-from-inside-a-container/229835.md?page=3)
