0

I've been trying to debug this issue, with great frustration as I'm printing using (Rasbian based) OctoPi and cannot reboot the Pi during printing. I have two similar setups running OctoPi on their own Pi. One works great, the other doesn't. My temporal fix is plugging in an Ethernet cable to get connectivity back.

I had twice now that after about 3-5 hours of printing the Pi simply loses WiFi connectivity for some reason. Below some information in a mostly working state where WiFi functioned properly. As I cannot consistently reproduce it and wait 3-5 hours for it to happen. It just happened two days in a row.

Below I've tried to include as much information I could think of as potentially relevant:

# Linux fox 6.1.21-v7l+ #1642 SMP Mon Apr  3 17:22:30 BST 2023 armv7l
# OctoPrint version : 1.9.3
# OctoPi version    : 1.0.0

# --
# cat /proc/version
Linux version 6.1.21-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642 SMP Mon Apr  3 17:22:30 BST 2023

# --
# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

# --
# vcgencmd bootloader_version
2023/01/11 17:40:52
version 8ba17717fbcedd4c3b6d4bce7e50c7af4155cba9 (release)
timestamp 1673458852
update-time 1704363769
capabilities 0x0000007f

# --
# cat /proc/cpuinfo | grep Model
Model           : Raspberry Pi 4 Model B Rev 1.4

# --
# free -h
               total        used        free      shared  buff/cache   available
Mem:           1,8Gi       172Mi       1,2Gi       5,0Mi       430Mi       1,5Gi
Swap:             0B          0B          0B

# --
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# --
# vcgencmd version
Mar 17 2023 10:51:33
Copyright (c) 2012 Broadcom
version 82f3750a65fadae9a38077e3c2e217ad158c8d54 (clean) (release) (start_x)

# --
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether e4:5f:01:41:6f:45 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.205/24 brd 192.168.50.255 scope global dynamic noprefixroute eth0
       valid_lft 67053sec preferred_lft 56253sec
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether e4:5f:01:41:6f:47 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.207/24 brd 192.168.50.255 scope global dynamic noprefixroute wlan0
       valid_lft 86399sec preferred_lft 75599sec

# --
# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11  ESSID:"xxx"
          Mode:Managed  Frequency:5.3 GHz  Access Point: 24:xx:FE:xx:02:9C
          Bit Rate=390 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-40 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

# --
# dmesg | grep brcmfmac
[    6.306369] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.315924] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.316933] usbcore: registered new interface driver brcmfmac
[    6.626924] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov  1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60
[    8.679733] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[19350.660439] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled

# --
# dmesg | grep cfg80211
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  smsc95xx.macaddr=E4:5F:01:41:6F:45 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=62ac6853-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=NL
[    5.950147] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    6.067332] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.083142] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[    8.679733] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[19350.660439] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled

# --
# service networking status
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2024-01-04 11:23:04 CET; 5h 29min ago
       Docs: man:interfaces(5)
    Process: 298 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
   Main PID: 298 (code=exited, status=1/FAILURE)
        CPU: 251ms

jan 04 11:23:03 fox systemd[1]: Starting Raise network interfaces...
jan 04 11:23:04 fox ifup[362]: command failed: No such device (-19)
jan 04 11:23:04 fox ifup[343]: run-parts: /etc/network/if-up.d/powersave_off exited with return code 237
jan 04 11:23:04 fox ifup[298]: ifup: post-up script failed
jan 04 11:23:04 fox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
jan 04 11:23:04 fox systemd[1]: networking.service: Failed with result 'exit-code'.
jan 04 11:23:04 fox systemd[1]: Failed to start Raise network interfaces.

# --
# ls /sys/class/net/
eth0  lo  wlan0

# --
# lsmod | grep cfg80211
cfg80211              811008  1 brcmfmac
rfkill                 32768  6 bluetooth,cfg80211

# --
# lsmod | grep brcmfmac
brcmfmac              335872  0
brcmutil               20480  1 brcmfmac
cfg80211              811008  1 brcmfmac

# --
# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
ap_scan=1
network={
        ssid="xxx"
        psk="xxx"
}

# --
# rfkill list
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

# --
# service --status-all
 [ + ]  alsa-utils
 [ + ]  avahi-daemon
 [ + ]  bluetooth
 [ + ]  change_hostname
 [ + ]  change_password
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ + ]  dhcpcd
 [ - ]  dphys-swapfile
 [ + ]  fake-hwclock
 [ + ]  haproxy
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ - ]  networking
 [ - ]  nfs-common
 [ + ]  nginx
 [ - ]  paxctld
 [ + ]  procps
 [ + ]  raspi-config
 [ + ]  rng-tools-debian
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  screen-cleanup
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  triggerhappy
 [ + ]  udev
 [ - ]  x11-common

# --
# dhclient -v wlan0
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/e4:5f:01:41:6f:47
Sending on   LPF/wlan0/e4:5f:01:41:6f:47
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.50.207 from 192.168.50.1
DHCPREQUEST for 192.168.50.207 on wlan0 to 255.255.255.255 port 67
DHCPACK of 192.168.50.207 from 192.168.50.1
RTNETLINK answers: File exists
bound to 192.168.50.207 -- renewal in 38623 seconds.

# --
# ping 192.168.50.1
PING 192.168.50.1 (192.168.50.1) 56(84) bytes of data.
64 bytes from 192.168.50.1: icmp_seq=1 ttl=64 time=1.05 ms
64 bytes from 192.168.50.1: icmp_seq=2 ttl=64 time=1.04 ms
64 bytes from 192.168.50.1: icmp_seq=3 ttl=64 time=1.04 ms
64 bytes from 192.168.50.1: icmp_seq=4 ttl=64 time=1.02 ms
64 bytes from 192.168.50.1: icmp_seq=5 ttl=64 time=0.905 ms

# --
# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=7.72 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=7.45 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=7.95 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=58 time=8.31 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=58 time=8.20 ms
64 bytes from 1.1.1.1: icmp_seq=6 ttl=58 time=7.77 ms

# --
# traceroute 192.168.50.1
traceroute to 192.168.50.1 (192.168.50.1), 30 hops max, 60 byte packets
 1  RT-AX56U-7E70 (192.168.50.1)  1.176 ms  1.100 ms  1.096 ms

# --
# uptime
 17:08:08 up  5:44,  2 users,  load average: 0,20, 0,16, 0,18

# --
# vcgencmd measure_temp
temp=50.1'C

# --
# date
## date is correct at moment of writing
do  4 jan 2024 17:22:11 CET
# journalctl --since "yesterday" -u networking.service

-- Boot 819271c4c7b64b18a0aad7e5c72b1cd7 --
jan 03 14:05:08 fox systemd[1]: Starting Raise network interfaces...
jan 03 14:05:09 fox ifup[361]: command failed: No such device (-19)
jan 03 14:05:09 fox ifup[325]: run-parts: /etc/network/if-up.d/powersave_off exited with return code 237
jan 03 14:05:09 fox ifup[257]: ifup: post-up script failed
jan 03 14:05:09 fox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
jan 03 14:05:09 fox systemd[1]: networking.service: Failed with result 'exit-code'.
jan 03 14:05:09 fox systemd[1]: Failed to start Raise network interfaces.
-- Boot 1bb9fea5f1344b5c9a4eea9c93d333e9 --
jan 03 15:54:42 fox systemd[1]: Starting Raise network interfaces...
jan 03 15:54:42 fox ifup[348]: command failed: No such device (-19)
jan 03 15:54:42 fox ifup[323]: run-parts: /etc/network/if-up.d/powersave_off exited with return code 237
jan 03 15:54:42 fox ifup[271]: ifup: post-up script failed
jan 03 15:54:43 fox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
jan 03 15:54:43 fox systemd[1]: networking.service: Failed with result 'exit-code'.
jan 03 15:54:43 fox systemd[1]: Failed to start Raise network interfaces.
jan 03 22:54:28 fox systemd[1]: Starting Raise network interfaces...
jan 03 22:54:28 fox systemd[1]: Finished Raise network interfaces.
jan 03 23:11:30 fox systemd[1]: Stopping Raise network interfaces...
jan 03 23:11:31 fox systemd[1]: networking.service: Succeeded.
jan 03 23:11:31 fox systemd[1]: Stopped Raise network interfaces.
jan 03 23:11:31 fox systemd[1]: Starting Raise network interfaces...
jan 03 23:11:32 fox systemd[1]: Finished Raise network interfaces.
jan 03 23:20:16 fox systemd[1]: Stopping Raise network interfaces...
jan 03 23:20:16 fox systemd[1]: networking.service: Succeeded.
jan 03 23:20:16 fox systemd[1]: Stopped Raise network interfaces.
jan 03 23:20:16 fox systemd[1]: Starting Raise network interfaces...
jan 03 23:20:16 fox systemd[1]: Finished Raise network interfaces.
jan 03 23:24:14 fox systemd[1]: Stopping Raise network interfaces...
jan 03 23:24:14 fox systemd[1]: networking.service: Succeeded.
jan 03 23:24:14 fox systemd[1]: Stopped Raise network interfaces.
jan 03 23:24:18 fox systemd[1]: Starting Raise network interfaces...
jan 03 23:24:19 fox systemd[1]: Finished Raise network interfaces.
jan 03 23:38:42 fox systemd[1]: Stopping Raise network interfaces...
jan 03 23:38:42 fox systemd[1]: networking.service: Succeeded.
jan 03 23:38:42 fox systemd[1]: Stopped Raise network interfaces.
jan 03 23:38:42 fox systemd[1]: Starting Raise network interfaces...
jan 03 23:38:45 fox systemd[1]: Finished Raise network interfaces.
-- Boot 0384efd058c843f0aa65c9fe36897fe5 --
jan 04 10:17:03 fox systemd[1]: Starting Raise network interfaces...
jan 04 10:44:36 fox ifup[357]: command failed: No such device (-19)
jan 04 10:44:36 fox ifup[330]: run-parts: /etc/network/if-up.d/powersave_off exited with return code 237
jan 04 10:44:36 fox ifup[289]: ifup: post-up script failed
jan 04 10:44:36 fox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
jan 04 10:44:36 fox systemd[1]: networking.service: Failed with result 'exit-code'.
jan 04 10:44:36 fox systemd[1]: Failed to start Raise network interfaces.
-- Boot e73badd20a2445dc9e33d6de318a7590 --
jan 04 11:23:03 fox systemd[1]: Starting Raise network interfaces...
jan 04 11:23:04 fox ifup[362]: command failed: No such device (-19)
jan 04 11:23:04 fox ifup[343]: run-parts: /etc/network/if-up.d/powersave_off exited with return code 237
jan 04 11:23:04 fox ifup[298]: ifup: post-up script failed
jan 04 11:23:04 fox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
jan 04 11:23:04 fox systemd[1]: networking.service: Failed with result 'exit-code'.
jan 04 11:23:04 fox systemd[1]: Failed to start Raise network interfaces.
jan 04 17:04:05 fox systemd[1]: Starting Raise network interfaces...
jan 04 17:04:05 fox systemd[1]: Finished Raise network interfaces.
# journalctl --since "yesterday" -u dhcpcd -p 3

-- Journal begins at Sun 2023-12-31 23:20:00 CET, ends at Thu 2024-01-04 19:34:06 CET. --
jan 03 05:30:12 fox dhcpcd[847]: ipv6_addaddr1: Permission denied
jan 03 05:30:28 fox dhcpcd[847]: wlan0: DHCP lease expired
-- Boot cdc0a8a786854f96bcaca815a18b3cfc --
jan 03 13:53:32 fox dhcpcd[382]: ipv6_addaddr1: Permission denied
-- Boot 819271c4c7b64b18a0aad7e5c72b1cd7 --
jan 03 14:05:16 fox dhcpcd[403]: ipv6_addaddr1: Permission denied
-- Boot 1bb9fea5f1344b5c9a4eea9c93d333e9 --
jan 03 15:54:50 fox dhcpcd[384]: ipv6_addaddr1: Permission denied
jan 03 23:54:46 fox dhcpcd[852]: ipv6_addaddr1: Permission denied
jan 04 05:30:43 fox dhcpcd[852]: eth0: DHCP lease expired
-- Boot 0384efd058c843f0aa65c9fe36897fe5 --
jan 04 10:44:41 fox dhcpcd[413]: ipv6_addaddr1: Permission denied
jan 04 10:44:43 fox dhcpcd[413]: ipv6_addaddr1: Permission denied
-- Boot e73badd20a2445dc9e33d6de318a7590 --
jan 04 11:23:10 fox dhcpcd[524]: ipv6_addaddr1: Permission denied
jan 04 11:23:11 fox dhcpcd[524]: ipv6_addaddr1: Permission denied
jan 04 18:47:40 fox dhcpcd[814]: wlan0: DHCP lease expired
# last few lines of /etc/sysctl.conf (custom change to disable IPv6)
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Also, the Pi isn't particularly busy, htop output below: htop output

From the footer of the OctoPrint Web GUI:

OctoPrint 1.9.3 Python 3.9.2 OctoPi* 1.0.0 (build 2023.10.09.151442)

Note that when it didn't work iwlist wlan0 scan showed an error like Interface doesn't support scanning and in working state it shows normal output wlan0 Scan completed: ..... Also note that restarting the networking service worked now, and runs normal now, but last night I couldn't get it to restart. Also, running as sudo ip link set wlan0 down and ip link set wlan0 up and wpa_cli -i wlan0 reconfigure didn't work. I also used raspi-config to make sure the Localization Options (Locale, Timezone, WLAN Country) were correct for The Netherlands (NL). So, while during printing (sometimes 10-20 hours) I cannot restart the Pi, all functions properly but WiFi just stops working and I didn't manage to get it back on so far, without a full restart.

In my Asus RT-AX56U router DHCP is enabled and the network works fine for many devices, both Raspberry Pi's are in the 'IP Binding List', where they get a static IP based on their wlan0 MAC address.

What can possibly cause this, what can I still check or change in a working state and what should I check or do additionally when it happens again?

Is there a way to test if the (wifi) hardware is functioning properly?

7
  • Have you looked at the service logs?
    – goldilocks
    Jan 4 at 18:01
  • I've added the logs of the last two days of the networking service. Perhaps the cause of the FAILURE is run-parts: /etc/network/if-up.d/powersave_off exited with return code 237 but that doesn't tell me much. All the start/stop attempts of Jan 3, are what I described, attempts to get WiFi back online, without success.
    – Bob Ortiz
    Jan 4 at 18:12
  • Perhaps relevant? github.com/guysoft/OctoPi/issues/508
    – Bob Ortiz
    Jan 4 at 18:17
  • Have you done something to disable dhcpcd?
    – Seamus
    Jan 6 at 20:20
  • No. I'd rather be as closed to mainstream as possible. My router is the DHCP server and gives the same IP to the Pi's every time they connect, no static config on the Pi's, they should just adhere to the routers DHCP.
    – Bob Ortiz
    Jan 6 at 21:17

1 Answer 1

0

It appears you have mis-configured your /etc/dhcpcd.conf file - or perhaps you're using dhclient instead of dhcpcd?

Based on the assumption that you are using dhclient, I offer the following:

I saw in your Q that you're on 'bullseye', and AIUI dhcpcd was the default DHCP client application for that release. I'm (personally) not familiar with dhclient, so I won't try to help you with that. As an answer here however, I would suggest that you restore dhcpcd as your DHCP client. I think that may do two things for you: 1) put you back in the mainstream where there's a larger group of people who may be able to help, and 2) the default version of /etc/dhcpcd.conf usually works well for just about everyone*.

* The exception being those who don't read the documentation and decide they need a fixed IP address.

3
  • How do I check which is currently being used? And is there a way to get back to default without a full config backup restore and reflash action of OctoPi?
    – Bob Ortiz
    Jan 6 at 21:18
  • Have you made any changes to /etc/network? Maybe run ls -l /etc/network, and edit your Q to add that output.
    – Seamus
    Jan 7 at 0:01
  • I just reflashed a clean OS and restored my OctoPrint config as described here: 3dprinting.stackexchange.com/a/22936/36802. I also installed cockpit-project.org and there are two service warnings: '/lib/systemd/system/dphys-swapfile.service - set up, mount/unmount, and delete a swap file' and '/lib/systemd/system/networking.service - Failed to start Raise network interfaces'. My bet is that there is a hardware failure, although I don't know how to confirm and test that. I switched entirely to ethernet cable instead, as WiFi is simply not reliable anymore on this Pi.
    – Bob Ortiz
    Jan 11 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.