# Resin-wifi-connect setup issues

**URL:** <https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827>\
**Category:** Product support\
**Tags:** raspberrypi3\
**Created:** [August 28, 2018, 4:36pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827 "2018-08-28T16:36:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [August 28, 2018, 4:36pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/1 "2018-08-28T16:36:08Z")

</div>

I’m currently trying to get resin-wifi-connect to work within a container on a RaspberryPi 3.

I have got to the stage where running wifi-connect gives: “Error: Cannot find a WiFi device”  
Is there anything else I need to enable that I might have overlooked?

Output of ls -al /etc/NetworkManager/system-connections/ on hostOS shows me resin-wifi-01. Within the other service it returns nothing.

One additional change that I needed to make to get wifi-connect to work at all was to set:

DBUS\_SYSTEM\_BUS\_ADDRESS=unix:path=\*\*/var/\*\*run/dbus/system\_bus\_socket

rather than:

DBUS\_SYSTEM\_BUS\_ADDRESS=unix:path=\*\*/host/\*\*run/dbus/system\_bus\_socket

I am not sure whether this is by design.

ifconfig in hostOS shows wlan0 whereas in the container it does not.

Edit: may need to add net:host in docker-compose.yml I suspect

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [August 28, 2018, 4:49pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/4 "2018-08-28T16:49:57Z")

</div>

OK - my last change to docker-compose.yml resolved it.  
network\_mode: “host”

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [August 28, 2018, 6:10pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/5 "2018-08-28T18:10:21Z")

</div>

@WillFG The correct D-Bus address for running WiFi Connect in a container should be `unix:path=/host/run/dbus/system_bus_socket` on resinOS.

Are you installing the `network-manager` package inside your container? Inside a container WiFi Connect is not able to run with the default D-Bus address (`/var/run/dbus/system_bus_socket`).

The docker-compose.yml additionally needs (in case you have not specified it):

````auto
    labels:
      io.resin.features.dbus: '1'
```
````

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [August 29, 2018, 11:05am UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/7 "2018-08-29T11:05:49Z")

</div>

Thanks, it’s now connecting on the specified path.  
I have not got it to work fully, beyond showing the UI and sometimes available networks, but I’ll research that some more before asking any further questions.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [August 29, 2018, 2:24pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/8 "2018-08-29T14:24:50Z")

</div>

No problem with that as your input is valuable for making WiFi Connect better. Please do not hesitate to ping me if you encounter any issues or have questions.

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [September 11, 2018, 12:26pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/10 "2018-09-11T12:26:53Z")

</div>

I am still encountering reliability problems.

- Often I can curl a request from the Host OS but not from my desktop.
- In addition, I often get “request error = Header” when accessing the form.

See my current docker-compose.yml:

resin-wifi-connect:  
build:  
context: ./resin-wifi-connect  
args:  
- BASEIMAGE\_BUILD=resin/raspberrypi3-debian:stretch  
environment:  
DBUS\_SYSTEM\_BUS\_ADDRESS: “unix:path=/host/run/dbus/system\_bus\_socket”  
restart: always  
privileged: true  
network\_mode: “host”  
ports:  
- 80:80/tcp  
labels:  
io.resin.features.dbus: ‘1’

Is there anything obviously wrong?  
Edit: I will look at masking the network manager service as this was suggested in another thread.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [September 11, 2018, 12:38pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/11 "2018-09-11T12:38:56Z")

</div>

Here is a sample repository with running WiFi Connect in a multicontainer environment:

> **[balena-io-examples/wifi-connect-api](https://github.com/balena-io-examples/wifi-connect-api)**
>
> Example Python web application that uses WiFi Connect's JSON API - balena-io-examples/wifi-connect-api

You may check the docker-compose.yml and the Dockerfiles. I tried to make it as simple as possible

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [September 11, 2018, 1:37pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/12 "2018-09-11T13:37:41Z")

</div>

Thanks, I put systemctl mask NetworkManager.service into my Dockerfile and that _seems_ to have fixed it, in that resin-wifi-connect is now giving me “Internet connectivity established”. The Header errors seem to be a bit of a red herring.  
Additionally I removed 80:80/tcp from docker-compose.yml as this was not in the examples.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [September 11, 2018, 2:47pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/13 "2018-09-11T14:47:03Z")

</div>

Are you using `nmcli` inside the container? If not, most probably you do not need to install NetworkManager inside the container.

---

<div class="post-metadata">

**Author:** ![WillFG](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@WillFG](https://forums.balena.io/u/WillFG)\
**Post date:** [September 11, 2018, 3:16pm UTC](https://forums.balena.io/t/resin-wifi-connect-setup-issues/3827/14 "2018-09-11T15:16:01Z")

</div>

It was indeed installed; I’ll remove it.
