# Debugging WiFi connection problem

**URL:** <https://forums.balena.io/t/debugging-wifi-connection-problem/82626>\
**Category:** Product support\
**Created:** [March 20, 2020, 4:57pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626 "2020-03-20T16:57:16Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 3, 2020, 9:07am UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/31 "2020-04-03T09:07:37Z")

</div>

![screen_capture](https://global.discourse-cdn.com/balena/original/2X/0/0265f373bae3984ab678b95b83f99e2c362fa266.jpeg)

---

<div class="post-metadata">

**Author:** ![gelbal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/gelbal/32/1109_2.png) [@gelbal](https://forums.balena.io/u/gelbal)\
**Post date:** [April 3, 2020, 10:13am UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/33 "2020-04-03T10:13:27Z")

</div>

Hi @Nigel, let me ask couple of more clarification questions.

Is the network you are trying to connect is 2.4GHz?  
RPi Zero W can not connect to 5GHz wifi networks (though as you say RPi 3B+ can). So I wonder if you did any changes to your router that would impact the frequency.

Next, so does the same RPi Zero still able to connect to the same wifi network running Raspbian?  
If that’s the case, there is either a configuration issue or a bug on balenaOS.

Could you run the command `cat /mnt/boot/system-connections/resin-wifi-01` and verify that wifi credentials are correct?  
Just to rule out potential typos there.

Next, could you send us the output of NetworkManager’s logs via the following command?  
`journalctl -a -u NetworkManager --no-pager`  
So we see if there are any issues there. It’d also help the logs from `journalctl -a -u resin-supervisor --no-pager`.

Cheers…

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 3, 2020, 10:37am UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/35 "2020-04-03T10:37:55Z")

</div>

Yes, 2.4 GHz. I didn’t make any changes to my router apart from adding ipaddress assignment to MAC addresses. I had tried before adding those entries.

Yes, the RPi Zero connects OK when running Raspian.

I checked the resin-wifi-01 file and it looks correct, it’s the same as I posted earlier.

I ran the commands you requested. They ran off the screen so used the pager and have hopefully captured the appropriate sections, see attached.

 ![screen_capture_2](https://global.discourse-cdn.com/balena/original/2X/d/d47e488ea3b2fee53b83c0ded797ce53df8039c3.jpeg) ![screen_capture_3](https://global.discourse-cdn.com/balena/original/2X/d/d667af1a8f1bcc511bf8b7f09ae8e794e5b8da31.jpeg)

---

<div class="post-metadata">

**Author:** ![AlidaOdendaal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alidaodendaal/32/1641_2.png) [@AlidaOdendaal](https://forums.balena.io/u/AlidaOdendaal)\
**Post date:** [April 3, 2020, 1:23pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/39 "2020-04-03T13:23:15Z")

</div>

Hi @Nigel

I’ve consulted one of our network experts on this matter, and he recommends that you use `wifi-connect` to dynamically set the WiFi configuration. You can find the repository, with associated instructions, here: [https://github.com/balena-io/wifi-connect](https://github.com/balena-io/wifi-connect) .

Please let us know whether this solves the problem!

Kind regards  
Alida

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 3, 2020, 1:57pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/41 "2020-04-03T13:57:44Z")

</div>

That looks complicated. Surely it should work as is?

---

<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:** [April 3, 2020, 2:37pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/42 "2020-04-03T14:37:44Z")

</div>

Hi there, so once you run WiFi Connect in a container, it will create a network connection profile in /etc/NetworkManager/system-connections. The idea is more like to try to connect with WiFi Connect to your network, since it uses some automatics to configure the connection profile for you. You do not have to use it on the long run, it will be useful to verify it is able to connect to your router, and afterwards you may just use the connection profile generated by it.  
Thanks,  
Zahari

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 3, 2020, 4:00pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/44 "2020-04-03T16:00:04Z")

</div>

That looks very long winded. It must be possible to add something to the connection profile which may give more information.

Is there something I can glean from the working Raspbian installation?

How do I disable ipv6? Can I just delete that entry?

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [April 3, 2020, 7:46pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/46 "2020-04-03T19:46:02Z")

</div>

hi @Nigel I agree the suggested methods are probably too long winded. Do you have a keyboard and screen connected to the pi, or possibly the ability to setup a serial cable to console into the device? Then as long as you are running a `.dev` variant of the device you should be able to test the network connection using:

List all wifi networks the device can see:

```auto
nmcli d wifi list

```

pick your network name and then run the following to try connect.

```auto
nmcli d wifi connect my_wifi password <password>

```

obviously replacing `my_wifi` and `<password>` appropriately. If that fails to get you a connection, then I would ask that you grab the logs of NetworkManager using the following:

```auto
journalctl -u NetworkManager --no-pager

```

Let me know how that works out for you!

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 3, 2020, 9:50pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/48 "2020-04-03T21:50:13Z")

</div>

Hi @shaunmulligan,  
Thanks for your comments.  
Now, this is odd. When I use the command ‘nmcli d wifi list’ I can see my neighbours’ WiFis but not my own! If I run WiFi analyser on my phone, it can see my WiFi. This is all on 2.4GHz. So, I can’t understand why that is, especially when running Raspbian on the same board does see it. Just tried using my phone as a WiFi hotspot and that can be seen, so must be something odd with my router, even though all my other WiFi devices see it OK.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [April 3, 2020, 9:55pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/49 "2020-04-03T21:55:01Z")

</div>

That is very interesting. I wonder if perhaps your router is not using all the bands and your neighbours is, that would explain why it would get seen and not yours. I remember there was some previous issue from a user with `n` and `ac` bands on the router AP, but I can’t remember exactly. I will try dig out that issue if i can.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [April 3, 2020, 10:02pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/50 "2020-04-03T22:02:26Z")

</div>

the other thing to try is to pass the `nmcli d wifi list --rescan` option so that it forces NM to do a proper full scan of network. It also might be worth just trying to connect to your network with the `nmcli d wifi connect ...` command and then seeing what the logs say.

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 4, 2020, 11:00am UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/52 "2020-04-04T11:00:40Z")

</div>

Tried the first suggested command and it still only reports other networks. I tried the connect but, unsurprisingly, it says it can’t find that SSID.

I just tried Raspbian again on the same board and that worked fine. It appears in my router with the correctly assigned ip address.

The balena version keeps saying ‘IPv6: ADDRCONF(NETDEV\_UP): wlan0: link is not ready’ implying it is trying to use IPv6. No mention of IPv4 anywhere.

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 5, 2020, 3:46pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/53 "2020-04-05T15:46:18Z")

</div>

Finally solved! My WiFi router’s channel number was set to ‘auto’ and I noticed it had allocated quite a high channel (11 I think). So I manually set the channel to 9 and my Pi Zero W saw it at last and the app now works fine.

What is strange is that the same board running Raspbian was able to see the router when it was running at the higher channel number. Does balena put a narrower number of WiFi channels in it’s driver compared with Raspbian?

Many thanks to all that have helped in tracking down my problem.

---

<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:** [April 6, 2020, 2:47pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/61 "2020-04-06T14:47:14Z")

</div>

That should most probably be related to the WiFi regulatory domain/country setting: [https://github.com/balena-os/meta-balena#country](https://github.com/balena-os/meta-balena#country)

There was a recent issue with the country setting and if you try setting this, please use balenaOS version 2.48.0+rev1 or higher.

---

<div class="post-metadata">

**Author:** ![Nigel](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@Nigel](https://forums.balena.io/u/Nigel)\
**Post date:** [April 6, 2020, 3:59pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/63 "2020-04-06T15:59:58Z")

</div>

I can only see V2.46.1+rev1 as an option.

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [April 6, 2020, 5:01pm UTC](https://forums.balena.io/t/debugging-wifi-connection-problem/82626/64 "2020-04-06T17:01:11Z")

</div>

Hello,  
`2.48.0+rev1` has not been released to production yet.  
You can try it on staging in the meantime if you want [https://dashboard.balena-staging.com](https://dashboard.balena-staging.com)

[Previous page](https://forums.balena.io/t/debugging-wifi-connection-problem/82626.md?page=1)
