Hidden Network issue with balenaOS

For fathers day I wanted to give my dad a Raspberry Pi 3 B running balenaOS so we could make our old audio setup into a “smart” one. The first time I tried to install the OS, the microSD card I was using had some sort of corruption issue, so I reinstalled balenaOS on a new SD card and it works fine. The issue I am having now is I can’t get the Raspberry Pi to connect to my WiFi. When I plug the Pi into an Ethernet cable, it works great and all the updates installed correctly. My WiFi is a hidden network, so I’m not sure if this could be the issue? I made sure that the password is definitely not incorrect. Thanks for anyone’s help.

Hey @zachg, sounds like a great gift :smile:

You need to update the wifi configuration file and set that wifi network as hidden=true. It’s explained here: https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup

Let us know how it goes.

I checked the config file for the WiFi, everything was correct. I plugged it in and it worked? Magic?

Glad to know it’s working :wink:

And it stopped working. I can see that it has an IP Address for both WiFi and Ethernet. So i’m not sure why its refusing to use WiFi. It says “Online (Heartbeat Only)”

Update: when I go into my routers listed ip’s, the raspberry pi isn’t present, so it is still a WiFi configuration problem. When the Ethernet cable is connected it grabs an IP for both the WiFi and the Ethernet, but when the Ethernet is unplugged, it receives neither?

@Ereski @gelbal

Maybe NetworkManager requires a restart after setting the configs, I’m not sure. Could you test connecting to something like your phone’s hotspot?

How do I connect to my mobile hotspot? Do I have to put “_” in where the spaces would be for the SSID? I have tried rebooting the whole system, plus and un-plug and replug in.

Another thing I realized is my WiFi is setup so only one SSID is listed and it has both the 2.4GHz and 5GHz bands under it. I’m not sure if this could be an issue with the Ras-pi not telling the Access Points which band it needs? I know the Access Points automatically add every device to 2.4GHz and then ask the device 5 times to switch to 5GHz and the device is supposed to refuse or not reply if it can not switch.

@Ereski @gelbal

Hello @zachg

The device should be able to connect to the network even if the SSID is the same for both frequencies.

To connect your mobile hotspot you just need to modify the config as mentioned above to match the WiFi configuration in your mobile phone. There’s no need to add “_” to the SSID, just write it with normal spaces.

Let us know when you’ve had the chance to test it that way.

@ntzovanis I tried it with both the space and with the underscore before with no luck. I would think it is the WiFi chip on the Ras-pi but I already saw it had two IP addresses when it was plugged into ethernet before.

@zachg I would suggest that you try re-flashing the SD card with the mobile hotspot and see what happens. If you can’t still connect to the wifi network, could you plug the ethernet cable and run the following commands on the host OS from balenacloud and paste the results?

nmcli dev status
nmcli connection show

The WiFi hotspot did not work either. I re-flashed the drive again with the WiFi network that I would like to use. Here are the results:

@ntzovanis

Hi,

Can you tell us more about the application you’re running? Perhaps there’s a connection manager running in a container that’s conflicting with the HostOS?

John

Also, do you know which channel your Wifi router is using? Make sure to check that the 2.4 GHz channel is set to something less than 11, since the firmware on the Raspberry Pi doesn’t support channel 12 and 13.

John

Channel is set to “Auto” on the Access Points. You can only select a maximum of channel 11 on the access points anyway. I’m not sure what you mean by application or what the connection manager container thingy is either. Sorry.

@jtonello

The WiFi config file is set like this:
[connection]
id=resin-wifi-01
type=wifi

[wifi]
hidden=true
mode=infrastructure
ssid=GiardinaHome

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=***********

Let’s try connecting to your phone’s hotspot first as we can rule out multiple possible issues. The wifi config should be something like this:

[connection]
id=balena-wifi
type=wifi

[wifi]
ssid=<ssid>

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=<password>

(replace <ssid> and <password> with the appropriate values)

If this doesn’t work, could you try adding interface-name=wlan0 to the [connection] section?

As for the connection manager thing, could you post your Dockerfile? Or at least the FROM image? It might be running something that’s conflicting with the system’s network manager

I tried to connect it to the mobile hotspot by just switching the ssid and the password with no luck, then I changed the file to reflect exactly what you have, that didn’t work either. Adding in the argument “interface-name=wlan0” didn’t work also. What I’ve been noticing is that when its connected to Ethernet it will also connect to WiFi and will grab 2 IP addresses, but when there’s no Ethernet plugged in, the WiFi doesn’t work. Could it be favoring Ethernet over WiFi, which would cause a hold up?

Where would I find those things?

Take a look here: https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup. Ethernet is indeed prioritized, but that shouldn’t be an issue if the cable is not connected.