# Raspberry Pi 4 Wifi Connectivity Issues

**URL:** <https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972>\
**Category:** Project help\
**Created:** [September 20, 2019, 3:33pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972 "2019-09-20T15:33:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 20, 2019, 3:33pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/1 "2019-09-20T15:33:55Z")

</div>

Hi team,

My Raspberry Pi 4 is not picking up on the WiFi connection I specified when adding the device to my project. On top of that, the Wifi-Connect container does not function. When I SSH into the Host OS, the wifi credentials file (resin-wifi-01) is not present, even after I put it there manually. Ethernet works perfectly.

This issue is not present in any of my Pi 3s. Any thoughts?

---

<div class="post-metadata">

**Author:** ![thgreasi](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/thgreasi/32/454_2.png) [@thgreasi](https://forums.balena.io/u/thgreasi)\
**Post date:** [September 20, 2019, 3:38pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/2 "2019-09-20T15:38:26Z")

</div>

Hi,  
That’s strange indeed.  
Is the RPi4 on a pre-existing application?  
Can you try creating a new RPi4 application, setting your wifi settings in the download image modal and try provisioning a fresh device, so that we can be sure that all steps were done correctly?

---

<div class="post-metadata">

**Author:** ![thgreasi](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/thgreasi/32/454_2.png) [@thgreasi](https://forums.balena.io/u/thgreasi)\
**Post date:** [September 20, 2019, 3:57pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/5 "2019-09-20T15:57:54Z")

</div>

Could you provide some extra info about the steps that you followed.  
Could you also grant us support access to that application from the actions page of the dashboard, and send us the application or device url with the issue so that we can take a closer look?

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 20, 2019, 5:43pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/7 "2019-09-20T17:43:53Z")

</div>

Sure thing! The RPi4 is running a pre-existing application, so I can try building the project on a new application and see if that works. I’ll be able to check that in a couple hours.

I was able to get the Pi to connect over WiFi again after starting the device while plugged in to Ethernet, then unplugging Ethernet after a few minutes. Because of this symptom, I’m beginning to think that the issue may be my own WiFi connection, but the problem is seen across three separate networks.

In order to replicate the issue, I simply went to my Application, clicked Add Device, selected Pi 4 64-bit BETA, and flashed the image via Etcher.

Here is a link to the device, with Support Access granted for 1 week: [proud-forest](https://dashboard.balena-cloud.com/devices/932e17cc092a4198d4845623a85cb4e8/summary)

EDIT: More info on WiFi-Connect. The container launches just fine, but will not create a wireless connection. Because of this, I can’t connect to it and specify a new WiFi network to connect to.

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 20, 2019, 9:47pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/10 "2019-09-20T21:47:01Z")

</div>

Hi @thgreasi

I was able to confirm issues when building a new Application. I am using the official [Balena Electron project](https://github.com/balena-io/resin-electronjs#getting-started).

> **Error Log**
>
> ```
> [Error] Some services failed to build:
> [Error] Service: electron
> [Error] Error: The command '/bin/sh -c install_packages apt-utils clang libxcb-image0 libxcb-util0 xdg-utils libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev libsmbclient libssh-4 libexpat-dev' returned a non-zero code: 100
> [Info] Built on arm01
> [Error] Not deploying release.
> 
> ```

Another error that pops up a few times says this:  
`E: Unable to locate package libgnome-keyring-dev`

Any ideas on where to start?

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [September 23, 2019, 7:05pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/16 "2019-09-23T19:05:15Z")

</div>

Hi @cpollock ,

So the reason for the electron project build failures are twofold:

1. The current `balenalib/raspberrypi4-node:10-build` tag is based on Debian Buster. Unfortunately, the `libgnome-keyring-dev` package isn’t available on Buster. You could go use `10-stretch-build` instead (and `10-stretch-run`) in the Dockerfile, but this runs into:
2. The version of electron used in the project is `v1.6.18` and unfortunately there isn’t an aarch64 release for this version. You could, technically, specify to use the armv7 version by using `--arch=armv7l` in the `npm install` line, but the issue here is that everything else is aarch64, so the project would be extremely limited (and would not have the right bindings)

The best way of getting the project to run currently is to actually use the Arm7 version of the project, by using the Pi3 version, ie. replacing:

```auto
%%BALENA_MACHINE_NAME%%

```

with

```auto
raspberrypi3

```

This should run happily on your Pi4, but obviously will run as 32bit and not 64bit.

For the WifiConnect issue, I believe the default startup conditions for it is to not start if it detects a wifi network connection already exists (see this start script: [https://github.com/balena-io/wifi-connect/blob/master/scripts/start.sh#L23](https://github.com/balena-io/wifi-connect/blob/master/scripts/start.sh#L23) ). What’s curious is if your Wifi connection you’ve already installed isn’t working, Wificonnect should start up.

I’ve just had a brief look at your device, and it does appear that currently, the settings you’ve created are present in the `system-connections` directory (`/mnt/boot/system-connections/resin-wifi-01` does exist and is filled in). I’m a little confused by the ethernet discussion. Am I correct in saying wifi wasn’t connecting when ethernet was unplugged, but you had to plug ethernet in, wait, then disconnect it and wait again for wifi to start working?

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 24, 2019, 1:03am UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/18 "2019-09-24T01:03:24Z")

</div>

Hi @hedss

Thanks for the quick response. I made a new project and replaced %%BALENA\_MACHINE\_NAME%% with raspberrypi3 but the issue persists. This is while utilizing the Pi 4 64-bit image-- should I switch to the 32-bit Pi 3 image beforehand?

More detail about the Ethernet:  
Consistently, the initial cold boot will result in a white page. The device will stay here, not connect to the designated WiFi, and also not utilize the Wifi-Connect container to try establishing a connection. The only way to get it out of this state is to connect the device to my laptop via Ethernet (with internet sharing on) and restart the Electron container. Once I do that, the device comes online and will correctly connect to wifi. Restarting the containers will not break the connection, but unplugging power will.

Thanks for your time,  
-CJ-

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [September 24, 2019, 2:07pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/20 "2019-09-24T14:07:24Z")

</div>

Hi, so these are likely two issues:

- Debian Buster not having that image, and thus will need to update the project (or downgrade to Stretch)
- Pi4 being 64-bit ARM device, might not have the same packages available, so switching to 32-bit raspberrypi3 image, `balenalib/raspberrypi3-node:10-stretch-build` and similar might unblock you.

For the Wifi, the Pi4 that we have at hand we could connect successfully all the time. Can you share what exact project are you deploying? Because [https://github.com/balena-io/resin-electronjs](https://github.com/balena-io/resin-electronjs) does not have any wifi connect so it’s harder to check your particular use case.

But it definitely feels like both the electronjs project needs a refresh, and wifi-connect needs more looking into for 64-bit ARM (in case).

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 30, 2019, 3:32pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/22 "2019-09-30T15:32:29Z")

</div>

Hi @imrehg  
Sorry for the delay. The Wifi-Connect container I am adding to this project can be found [here](https://github.com/balena-io/wifi-connect).

---

<div class="post-metadata">

**Author:** ![samothx](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samothx](https://forums.balena.io/u/samothx)\
**Post date:** [September 30, 2019, 8:39pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/23 "2019-09-30T20:39:40Z")

</div>

Hi @cpollock it looks like we are discussing 3 problems here that might or might not be connected.  
The usual strategy would be divide & conquer meaning to separate the problems and see if they exist individually. If so look at them one by one and see if we can solve them.  
So my suggestion would be to install the RPI4 into an empty application (no release) with the wifi credentials set and give it ample time to connect.  
If it does not connect, it would be interesting to connect it via your ethernet and let us take a look at it.

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [September 30, 2019, 11:14pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/26 "2019-09-30T23:14:35Z")

</div>

Hi @samothx  
I followed a [fork in the Electron project for Debian Buster](https://github.com/balena-io/resin-electronjs/tree/buster-pi4-support-build-e62036bd010e56431b6f71ff5df3d26a419a863c), and that seems to be working without issue now. The Pi4 will also now connect to the WiFi network first try and load everything perfectly.

The only remaining issue is that [Balena’s WiFi-Connect](https://github.com/balena-io/wifi-connect) container does not create a wifi connection on the Pi4 when a wireless network is not found.

I apologize for jumping around these three issues, but I was having difficulty isolating the problem. I have granted remote support for the [new application](https://dashboard.balena-cloud.com/devices/f5061776f61235ce62a6843e1060856e) with the new Buster Pi4 Electron container.

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 7:52am UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/27 "2019-10-01T07:52:44Z")

</div>

Hi,

I’ve raised the issue with our Wifi-Connect maintainer, we will get back to you as soon as we have any updates.

---

<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:** [October 1, 2019, 10:02am UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/32 "2019-10-01T10:02:14Z")

</div>

Hi @cpollock,

The maintainer of WiFi Connect here. I am a bit confused by the symptom you described - “when a wireless network is not found”. Once you enter the WiFi Connect captive portal through your cell phone, is the network listed in the drop-down box? For WiFi Connect to work, it needs NetworkManager to be seeing the network nearby.

Thanks,  
Zahari

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [October 1, 2019, 4:39pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/34 "2019-10-01T16:39:21Z")

</div>

Hi @majorz nice to meet you,  
To clarify, when the trusted network (the one designated on initial setup) is no longer found, WiFi-Connect should create a new WiFi connection for my phone or any other device to connect to.

While this works on a Pi3, the Pi4 will not create a new WiFi connection if the initial network is not found. For example in the [Balena Dash](https://github.com/balena-io-projects/balena-dash/tree/master/wifi-connect) project, the Pi should create a network called “balenaDash”. This is the function that is not working on the Pi4.

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [October 1, 2019, 7:06pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/36 "2019-10-01T19:06:48Z")

</div>

@cpollock I suspect this is something to do with your `wifi-connect` Dockerfile. If you’re pulling the `wifi-connect` folder from the balenaDash project and adding it to your own Pi 4 project it’s not going to work. The reason for this is that it’s using the `balenalib/raspberrypi3` image but then further down on [line 10](https://github.com/balena-io-projects/balena-dash/blob/master/wifi-connect/Dockerfile.template#L10) you can see it’s using the `%%BALENA_ARCH%%` template variable, which in the case of the Pi 4 is going to be `aarch64`. This ultimately means you’re going to end up trying to run a 64-bit binary on a 32-bit image.

To fix this, change the base image to `balenalib/raspberrypi4-64`, or `balenalib/%%BALENA_MACHINE_NAME%%`. It’s almost the opposite to what you had to do above to get Electron working! This is because Wifi connect is compiled for `aarch64` and will work fine, we just need to use the correct base image for the correct architecture.

I hope this makes sense and let me know how you get on!

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [October 2, 2019, 10:39pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/38 "2019-10-02T22:39:44Z")

</div>

So as a test, I made a new application called WiFi, then added the [basic WiFi Connect code from Github](https://github.com/balena-io/wifi-connect) on a base Pi 4 64-bit BETA build-- not using the [Balena Dash script and dockerfile](https://github.com/balena-io-projects/balena-dash/tree/master/wifi-connect). I didn’t change any of the code, and the service is still not creating a wifi connection on my Pi 4.

I noticed in [Balena’s Pi 4 documentation](https://www.balena.io/blog/balena-releases-first-fully-functional-64-bit-os-for-the-raspberry-pi-4/) that a change in the NVRAM broke a WiFi driver. Do you think that is related to this issue in any way?

---

<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:** [October 3, 2019, 12:28pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/40 "2019-10-03T12:28:04Z")

</div>

Hi @cpollock, I just ordered a RPi 4 as I personally do not have one yet. I will follow up with my findings once I receive the package.  
Thanks,  
Zahari

---

<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:** [October 24, 2019, 11:45am UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/50 "2019-10-24T11:45:46Z")

</div>

Hi @cpollock,

I did not had any issues with WiFi Connect on balenaOS 2.41.0+rev4 and RPi 4.

What I did is:

1. Cloned the WiFi Connect repo
2. Created a new application called `wifi-connect-test` on the balena dashboard
3. Using our balena CLI I did `balena push wifi-connect-test` from inside the cloned wifi-connect folder
4. After the image was downloaded on the RPi 4 device, I used WiFi Connect to successfully connect to a network

---

<div class="post-metadata">

**Author:** ![cpollock](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cpollock](https://forums.balena.io/u/cpollock)\
**Post date:** [October 25, 2019, 6:39pm UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/52 "2019-10-25T18:39:17Z")

</div>

Glad to hear that worked-- I’ll troubleshoot on my end to see what the issue is. Thanks for taking the time to look into this.

---

<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:** [October 28, 2019, 10:31am UTC](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972/53 "2019-10-28T10:31:22Z")

</div>

Thanks, please let me know how that worked for you and if you still have any issues with it.

[Next page](https://forums.balena.io/t/raspberry-pi-4-wifi-connectivity-issues/32972.md?page=2)
