• Re: How to wake up the WiFi on a Zero 2W (it was working but has stoppe

    From The Natural Philosopher@3:633/10 to All on Wednesday, March 18, 2026 13:12:51
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    On 18/03/2026 12:55, Chris Green wrote:
    I have a new[ish] Pi Zero 2W running in a building close to our house
    (close means about 30 yards away). When I installed it I configured
    one of the possible WiFi SSIDs with rpi-imager, then after installing
    I added the other possible SSID (using nmcli I think).

    It has run quite happily for a few days but as of yesterday afternoon
    shows no sign of being connected.

    I have tried restarting it, no effect. I have checked both of the
    routers it might connect to and they're both running and haven't
    moved. I've even moved one of them into what is effectively line of
    sight to the Zero 2W. Still no connection.

    What might be wrong and what can I do to get it to connect?

    Bring it in and put a terminal and keyboard on it so you can look at the
    logs.

    I have a 30 metre pi Pico and it connects anywhere between -80dM and
    'not at all' for no visible reason - maybe its leaves blowing in the
    wind. I dunno.

    Right now its a happy little -84dBm. Its having a good day.

    30 metres is pretty tough for a pi.


    --
    Ideas are more powerful than guns. We would not let our enemies have
    guns, why should we let them have ideas?

    Josef Stalin


    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris Green@3:633/10 to All on Wednesday, March 18, 2026 15:45:31
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    Chris Green <cl@isbd.net> wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 18/03/2026 12:55, Chris Green wrote:
    I have a new[ish] Pi Zero 2W running in a building close to our house (close means about 30 yards away). When I installed it I configured
    one of the possible WiFi SSIDs with rpi-imager, then after installing
    I added the other possible SSID (using nmcli I think).

    It has run quite happily for a few days but as of yesterday afternoon shows no sign of being connected.

    I think I have discovered the problem, the SD card is faulty/wearing
    out. I just tried to boot the system with a display attached and it
    sits repeating an error message about "bcm2835 timeout waiting for
    hardware interrupt".

    Putting the card in a reader in my desktop machine it gets read
    **very** slowly and times out before the automount completes.

    I think a (some?) new SD card is on the agenda! :-)

    --
    Chris Green
    ú

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Wednesday, March 18, 2026 16:22:07
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    On 18/03/2026 15:45, Chris Green wrote:
    Chris Green <cl@isbd.net> wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 18/03/2026 12:55, Chris Green wrote:
    I have a new[ish] Pi Zero 2W running in a building close to our house
    (close means about 30 yards away). When I installed it I configured
    one of the possible WiFi SSIDs with rpi-imager, then after installing
    I added the other possible SSID (using nmcli I think).

    It has run quite happily for a few days but as of yesterday afternoon
    shows no sign of being connected.

    I think I have discovered the problem, the SD card is faulty/wearing
    out. I just tried to boot the system with a display attached and it
    sits repeating an error message about "bcm2835 timeout waiting for
    hardware interrupt".

    Putting the card in a reader in my desktop machine it gets read
    **very** slowly and times out before the automount completes.

    I think a (some?) new SD card is on the agenda! :-)


    Somewhere in my documentation is what I did to my pi zero in order to
    avoid any SD card writes at all

    Basically I created a ram disk and mounted it on /var/log. And disabled systemd as much as possible.

    Then ensure the SD card is mounted with noatime etc.


    --
    It is the folly of too many to mistake the echo of a London coffee-house
    for the voice of the kingdom.

    Jonathan Swift



    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Wednesday, March 18, 2026 15:50:13
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    On 18/03/2026 13:56, Chris Green wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 18/03/2026 12:55, Chris Green wrote:
    I have a new[ish] Pi Zero 2W running in a building close to our house
    (close means about 30 yards away). When I installed it I configured
    one of the possible WiFi SSIDs with rpi-imager, then after installing
    I added the other possible SSID (using nmcli I think).

    It has run quite happily for a few days but as of yesterday afternoon
    shows no sign of being connected.

    I have tried restarting it, no effect. I have checked both of the
    routers it might connect to and they're both running and haven't
    moved. I've even moved one of them into what is effectively line of
    sight to the Zero 2W. Still no connection.

    What might be wrong and what can I do to get it to connect?

    Bring it in and put a terminal and keyboard on it so you can look at the
    logs.

    That's not very easy, it's a bit of a 'fixed' installation. It might
    be easier to move one of the routers nearer to it.

    Well keyboards are portable enough. HDMI screen - not so much.


    I have a 30 metre pi Pico and it connects anywhere between -80dM and
    'not at all' for no visible reason - maybe its leaves blowing in the
    wind. I dunno.

    Right now its a happy little -84dBm. Its having a good day.

    30 metres is pretty tough for a pi.

    I just checked the WiFi signal strength using an Android tablet right
    next to the Pi Zero and the better of the two SSIDs is around -70dBM
    so it **should** be OK I would have thought.


    I get up to 20dB variation. Try rebooting it and see if you can get it
    back on target
    --
    Climate is what you expect but weather is what you get.
    Mark Twain


    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Ian@3:633/10 to All on Thursday, March 19, 2026 10:00:02
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    On 2026-03-18, The Natural Philosopher <tnp@invalid.invalid> wrote:

    Somewhere in my documentation is what I did to my pi zero in order to
    avoid any SD card writes at all

    Basically I created a ram disk and mounted it on /var/log. And disabled systemd as much as possible.

    Then ensure the SD card is mounted with noatime etc.

    If you replace /sbin/init (usually symlinked to /lib/systemd/systemd) with a bash script you get to run in a truly read-only environment (root filesystem still mounted ro). Of course nothing in userland works at that point, so
    your script has to do some initialisation - setting up a ramdisk for a copuple of directories, as you said, mounting procfs, creating some device nodes, configuring IP, loading kernel modules if you need them (e.g. for wifi).
    Useful for small applications (forget running a GUI, obv.).

    Brutal, but effective. Here's an example:

    ----------------------------------------------------------------------------
    # cat init-ro
    #!/bin/bash

    clear
    echo "Running ${0}..."


    #
    # Config...
    #

    source /etc/ro-config

    export OUR_BC="${OUR_IP%.*}.255"
    export OUR_GW="${OUR_IP%.*}.1"


    #
    # Need to set these so we can prime PS1 for bash...
    # (see nonsense in /etc/bash.bashrc)...
    #

    export SUDO_USER=0
    export SUDO_PS1="-"


    #
    # Mount tmpfs filesystems on /run and /tmp,
    # as these need to be rw...
    #

    mount -t tmpfs -o size=256m tmpfs /run
    mount -t tmpfs -o size=10m tmpfs /tmp

    mkdir /run/lock
    mkdir /run/log


    #
    # Need /dev/pts for ssh...
    #

    mkdir /dev/pts
    mount -t devpts devpts /dev/pts


    #
    # Need loopback...
    #

    ifconfig lo up


    #
    # Need /proc...
    #

    mount -t proc none /proc


    #
    # Set host name and domain name...
    #

    hostname "${OUR_HOSTNAME}"
    domainname "${OUR_HOSTNAME#*.}"


    #
    # If wifi, set up the wireless interface...
    #

    [ "${WIRED}" != "1" ] && /ro/init-wifi


    #
    # Wait for interface to appear before
    # configuring it...
    #

    while [ ! -d "/proc/sys/net/ipv4/conf/${OUR_IF}/" ]
    do
    echo "Waiting for interface \"${OUR_IF}\"..."
    sleep 1
    done


    #
    # Bring the interface up...
    #

    ip link set "${OUR_IF}" up


    #
    # Check if the MAC address matches the config. If not, don't
    # bring up the network, just pop up a shell to allow the config
    # to be updated (allows cloning of the image)...
    #

    real_eth="$(ip addr list ${OUR_IF} | awk '/link\/ether/ {print $2}')"

    if [ "${real_eth^^}" != "${OUR_ETH^^}" ]
    then
    echo "This MAC address (${real_eth^^}) doesn't match config (${OUR_ETH^^})"
    echo ""
    echo "Please edit config and reboot..."
    echo ""

    cd /ro
    mount -o remount,rw /dev/root /

    PS1="RW-SHELL \h:\w# " /bin/bash

    reboot -f
    fi


    #
    # Set the IP address and default route...
    #

    echo "Setting IP address for ${OUR_IF}: ${OUR_IP}/24, gw: ${OUR_GW}"

    ip addr add "${OUR_IP}/24" brd "${OUR_BC}" dev "${OUR_IF}"
    ip route add 0/0 via "${OUR_GW}"


    #
    # Wait for network, check by pinging our default gateway...
    #

    while ! ping -c 1 -q -w 1 "${OUR_GW}" > /dev/null 2>&1
    do
    echo "Waiting for network, ping gw (${OUR_GW})..."
    sleep 1
    done


    #
    # Start ntpd to get the time...
    #

    echo "Starting ntpd..."

    /usr/sbin/ntpd -g

    echo "Waiting for time sync..."
    ntp-wait -n 30 -s 1
    date


    #
    # Start sshd
    #

    echo "Starting sshd..."

    mkdir /run/sshd
    /usr/sbin/sshd


    #
    # Now start application screen sessions...
    #

    echo "Starting applications..."

    cd /ro

    ./start-screens


    #
    # Shell for testing...
    #

    while true
    do
    PS1="RO-SHELL \h:\w# " /bin/bash
    done


    #
    # We can't exit from init (causes kernel panic), so force a reboot if we get here...
    #

    reboot -f

    ----------------------------------------------------------------------------

    --
    Ian

    "Tamahome!!!" - "Miaka!!!"

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris Green@3:633/10 to All on Wednesday, March 18, 2026 13:56:10
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 18/03/2026 12:55, Chris Green wrote:
    I have a new[ish] Pi Zero 2W running in a building close to our house (close means about 30 yards away). When I installed it I configured
    one of the possible WiFi SSIDs with rpi-imager, then after installing
    I added the other possible SSID (using nmcli I think).

    It has run quite happily for a few days but as of yesterday afternoon
    shows no sign of being connected.

    I have tried restarting it, no effect. I have checked both of the
    routers it might connect to and they're both running and haven't
    moved. I've even moved one of them into what is effectively line of
    sight to the Zero 2W. Still no connection.

    What might be wrong and what can I do to get it to connect?

    Bring it in and put a terminal and keyboard on it so you can look at the logs.

    That's not very easy, it's a bit of a 'fixed' installation. It might
    be easier to move one of the routers nearer to it.

    I have a 30 metre pi Pico and it connects anywhere between -80dM and
    'not at all' for no visible reason - maybe its leaves blowing in the
    wind. I dunno.

    Right now its a happy little -84dBm. Its having a good day.

    30 metres is pretty tough for a pi.

    I just checked the WiFi signal strength using an Android tablet right
    next to the Pi Zero and the better of the two SSIDs is around -70dBM
    so it **should** be OK I would have thought.

    --
    Chris Green
    ú

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thursday, March 19, 2026 16:00:02
    Subject: Re: How to wake up the WiFi on a Zero 2W (it was working but has stopped)

    On Wed, 18 Mar 2026 17:48:19 -0000 (UTC), Ian wrote:

    # Need /proc...

    Don?t you need udev on /dev, and sysfs on /sys, as well?

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)