Issues with WiFi Connect and Raspberry Pi Zero W

Hi there,

I have been working and trying for couple of days and decided to reach here for help as well.

Please note that I’m using OpenBalena on a private VPS.

I am working on a project that needs WiFi Connect and Node Red.

Here you can see my project files, the most important ones,

Currently I’m using OpenBalena: downloaded the latest image available on staging environment.

CLI: 12.44.20
OpenBalenaOS: (latest available on the staging, downloaded via CLI).

Hardware device: Raspberry Pi Zero W.

Steps I have done:

  1. On the root folder of the project, I’m running the following command:
    balena build --deviceType raspberry-pi --arch rpi --emulated
  2. Try to deploy the build to my app (created previously a Raspberry Pi Zero W app via balena app create myApp)
    balena deploy myApp --source ./
  3. After downloading the latest version of the Raspberry Pi Zero W image (on staging environment): balena os download raspberry-pi -o ./image.img --version --version menu,
  4. Try to preload the built app (myApp) to my fresh downloaded image:
    DEBUG=1 balena preload ./image.img --app myApp --splash-image logo.png

The issue that I’m facing is that the WiFi AP never shows up and even more interesting is that on the device when I try to list all the files and folders from the location: /usr/src/ I’m getting an EMPTY folder. How’s that possible?
Am I doing something wrong? Been looking to the documentation and try to understand what I’m doing wrong.

Here’s a full output of the process, It may be useful for someone to help me out!

alex@ubuntu:~/myApp$ balena app create myApp
? Device Type Raspberry Pi (v1 / Zero / Zero W)
Application created: myApp (raspberry-pi, id 26)
alex@ubuntu:~/myApp$ balena build --deviceType raspberry-pi --arch rpi --emulated
[Info]    Building for rpi/raspberry-pi
[Build]   Building services...
[Build]   wifi-connect Preparing...
[Build]   node-red     Preparing...
[Info]    Emulation is enabled
[Build]   wifi-connect Step 1/3 : FROM balenablocks/wifi-connect:rpi
[Build]   wifi-connect  ---> e94cd084778c
[Build]   wifi-connect Step 2/3 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build]   wifi-connect  ---> Using cache
[Build]   wifi-connect  ---> 0c6447cdf0ea
[Build]   wifi-connect Step 3/3 : COPY ["./scripts/","."]
[Build]   wifi-connect  ---> Using cache
[Build]   wifi-connect  ---> 0735c4a4df72
[Build]   wifi-connect Successfully built 0735c4a4df72
[Build]   wifi-connect Successfully tagged myApp_wifi-connect:latest
[Build]   node-red     Step 1/11 : FROM balenalib/raspberry-pi-debian-node:12-stretch-build as build
[Build]   node-red      ---> 0b0610014d32
[Build]   node-red     Step 2/11 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> 0a45e473105d
[Build]   node-red     Step 3/11 : RUN ["/tmp/qemu-execve","-execve","/bin/sh","-c","JOBS=MAX npm install -g --production --unsafe-perm        node-red        node-red-admin        node-red-contrib-balena"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> 8e86d48786c4
[Build]   node-red     Step 4/11 : FROM balenalib/raspberry-pi-debian-node:12-stretch-run
[Build]   node-red      ---> d08fcf28568b
[Build]   node-red     Step 5/11 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> e5c515acb323
[Build]   node-red     Step 6/11 : RUN ["/tmp/qemu-execve","-execve","/bin/sh","-c","apt-get update && apt-get install -yq --no-install-recommends   rpi.gpio   python-dev   python-rpi.gpio   libatomic1   && apt-get clean && rm -rf /var/lib/apt/lists/*"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> 8b0082445584
[Build]   node-red     Step 7/11 : WORKDIR /usr/src/app
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> 336ee18c64be
[Build]   node-red     Step 8/11 : COPY --from=build ["/usr/local/bin","/usr/local/bin"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> f0a04133fe06
[Build]   node-red     Step 9/11 : COPY --from=build ["/usr/local/lib/node_modules","/usr/local/lib/node_modules"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> c8cca47f039f
[Build]   node-red     Step 10/11 : COPY ["./app","./"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> 1ca43a21f468
[Build]   node-red     Step 11/11 : CMD ["bash","/usr/src/app/"]
[Build]   node-red      ---> Using cache
[Build]   node-red      ---> cd6b80b1d68e
[Build]   node-red     Successfully built cd6b80b1d68e
[Build]   node-red     Successfully tagged myApp_node-red:latest
[Build]   wifi-connect Image size: 20.38 MB
[Build]   node-red     Image size: 446.39 MB
[Build]   Built 2 services in 3:15
[Success] Build succeeded!
alex@ubuntu:~/myApp$ balena deploy myApp --source ./
[Info]    Everything is up to date (use --build to force a rebuild)
[Info]    Creating release...
[Info]    Pushing images to registry...
[Info]    Saving release...
[Success] Deploy succeeded!
[Success] Release: 27a395a7012404b222b44754db55bf07

                            _.-(6'  \
                           (=___._/` \
                                )  \ |
                               /   / |
                              /    > /
                             j    < _\
                         _.-' :      ``.
                         \ r=._\        `.
                        <`\\_  \         .`-.
                         \ r-7  `-. ._  ' .  `\
                          \`,      `-.`7  7)   )
                           \/         \|  \'  / `-._
                                      ||    .'
                                       \\  (
                                        >\  >
                                    ,.-' >.'

alex@ubuntu:~/myApp$ DEBUG=1 balena preload ./image.img --app myApp --splash-image logo.png
[debug] original argv0="balena" argv=[/home/alex/balena-cli/balena,/snapshot/versioned-source/bin/balena,preload,./image.img,--app,myApp,--splash-image,logo.png] length=8
[debug] new argv=[/home/alex/balena-cli/balena,/snapshot/versioned-source/bin/balena,preload,./image.img,--app,myApp,--splash-image,logo.png] length=8
Building Docker preloader image. [===                     ] 12%
Step 1/7 : FROM docker:20.10.6-dind
Building Docker preloader image. [======                  ] 25%
Step 2/7 : RUN apk update && apk add --no-cache py3-pip parted btrfs-progs util-linux sfdisk file coreutils sgdisk
 ---> Using cache
Building Docker preloader image. [=========               ] 37%
Step 3/7 : COPY ./requirements.txt /tmp/
 ---> Using cache
Building Docker preloader image. [============            ] 50%
Step 4/7 : RUN pip3 install -r /tmp/requirements.txt
 ---> Using cache
Building Docker preloader image. [===============         ] 62%
Step 5/7 : COPY ./src /usr/src/app
 ---> Using cache
Building Docker preloader image. [==================      ] 75%
Step 6/7 : WORKDIR /usr/src/app
 ---> Using cache
Building Docker preloader image. [=====================   ] 87%
Step 7/7 : CMD ["python3", "/usr/src/app/"]
 ---> Using cache
 ---> 5314c822b44d
Successfully built 5314c822b44d
Building Docker preloader image. [========================] 100%
| Checking that the image is a writable file
| Finding a free tcp port and getting balena settings
| Checking if the image is an edison zip archive
| Creating preloader container
\ Starting preloader container
\ Fetching application myApp
- Reading image informationWaiting for Docker to start...
- Reading image informationDocker started
/ Reading image information
? Select a release current
\ Fetching application 26
- Estimating required additional space
| Resizing partitions and waiting for dockerd to startReplacing splash image
- Resizing partitions and waiting for dockerd to startExpanding extended partition n°4 of /img/balena.img
Expanding logical partition n°6 of /img/balena.img
\ Resizing partitions and waiting for dockerd to startResizing ext4 filesystem of partition n°6 of /img/balena.img using /dev/loop16
- Resizing partitions and waiting for dockerd to startFile system OK
/ Resizing partitions and waiting for dockerd to startWaiting for Docker to start...
\ Resizing partitions and waiting for dockerd to startDocker started

Pulling 2 images [========================] 100%
| Cleaning up temporary files

Looking forward for any hints!

Could be that the io.balena.features.firmware: "1" label is missing. You need to set it up per the readme on this repo: GitHub - balenablocks/wifi-connect: Easy WiFi setup for Linux devices from your mobile phone or laptop, which it seems you have mostly done.

Also note the busybox shebang for the scripts: wifi-connect/ at master · balenablocks/wifi-connect · GitHub. It looks like you have half the balena block wifi connect setup, and half the setup from the wifi-connect standard repo.

1 Like