Using EmonScripts on a Pi Zero W

I ‘etched’ a new image of Buster Lite on my Raspi Zero W, added the ssh and wpa_supplicant.conf files and then followed the instructions here:

(Including the raspberry pi sub section, here: EmonScripts/ at master · openenergymonitor/EmonScripts · GitHub)

Installation goes fine and I can access emoncms but I’m struggling with connecting to the pi zero W after a reboot; I think there may be something going on with DHCP on my router or it could be an issue with wifi configuration of the pi zero W. When I have it figured out, I’ll update, but things are looking good for using the script on a pi zero W.


I’ve run the emonscript a few times for installation on the raspberry pi zero w and every time it works great right after the installation but if I perform a reboot, the pi will not connect to my wifi network and I cannot access the raspberry pi zero w…

I’ve checked the /etc/wpa_supplicant/wpa_supplicant.conf before initiating a reboot and it has my SSID and password in there; so i’m thinking that at start up it is changing the network configuration to something that is not my SSID.

I also get an error that the hostname raspberry.local is invalid at the end of installation, per the script. I’ll investigate a little more.

Do you have a USB/Ethernet dongle by any chance?

Don’t install the WiFi modules (edit the ini) and comment out any ref to wifi in the scripts before you run it and see what happens. It might be related to this Unable to start HOSTAPD on Pi Zero W - Raspberry Pi Forums

Hi @ajw85 I moved it to a new thread so I could actually find it!

I have been thinking about this @TrystanLea, I think the scripted WiFi installation needs some modification. For the prebuilt image, what is done is correct, but if a user is running the script, they must either have Console or SSH access to the Pi command line. In this case the raspi-config utility can be used.

I think the default position for the scripts should be that the WiFi AP is not installed but the module to manage WiFi is. The installation and setup of the AP should be a separate script that is usually only needed for pre-built images.


In the install config.ini set


I tried a few times to edit the config.ini and flag install_wifiap=false, and again, installation was fine but upon first reboot after installation is complete, something happened in the network configuration and the raspi zero w wouldn’t connect. I tried a USB OTG → USB Ethernet adapter and it also wouldn’t connect to my network. The LEDs on the ethernet adapter and my network switch would light I could not connect to the raspi zero w through ethernet after the first reboot after installation is complete.

I then tried disabling all the emonSD items in config.ini and it works and i can reboot it as many times as I want! Great success! I’ll report back if anything changes.


Progress. There are a few lines in the file relating to network. If it works with the wifiap disabled and and then the emonsd install disabled, try commenting out those lines.

Firmware and lcd should not be impacting network.