Pihole non responsive after running for some time

Please follow the below template, it will help us to help you!

Expected Behaviour:

Pihole not crushing and running nonstop

Actual Behaviour:

Pihole crashes frequently with no warnings, when being used as DHCP server or not being used as DHCP server.

Debug Token:

Your debug token is: https://tricorder.pi-hole.net/q40vhr4p5m

Description:
Using Raspberry Pi Zero W, Samsung 32G SD and a proper 2.5A power supply. I even got a backup board since the problem persisted for my last board.

Pihole will run for an amount of time, then will 'crash'. The web interface is no longer connectable, and the IP address is no longer pingable.

This problem has persisted for a very long time, and I don't know the root cause of this. It's been very frustrating.

I tried to attach a debugger to the FTLDNS per this tutorial:Debugging FTLDNS - Pi-hole documentation,
but every time the pihole will just crash with no warnings or any irregular terminal output. backtrace did not provide anything useful.

Any help will be appreciate.

Your debug log does not indicate a recent crash.

Please have a look in /var/log/pihole-FTL.log if you find any crashes there.

Hi yubiuser,

There's no crashes in the pihole-FTL.log. As I mentioned, it's probably not a real crash. It's just that the device becomes unreachable on the network after a random amount of time.

Is it possible that some devices or my router is interfering with pihole's operation?

Edit: Just to add, once the device is in the unreachable state, I can't ping it, I can't SSH it, all I can do is to press the switch on my power supply and reboot the board.

This has the appearance of an OS level or hardware problem. Ping, SSH are OS level functions, and it is highly doubtful that a Pi-hole problem would prevent those functions.

Also check /var/log/syslog for problems, along with the output of the command dmesg

I don't see anything that looks like a warning or error in syslog...

Content of dmesg:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.83+ (dom@buildbot) (gcc version 8.4.0 (Ubuntu/Linaro 8.4.0-3ubuntu1)) #1379 Mon Dec 14 13:06:05 GMT 2020
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Reserved memory: created CMA memory pool at 0x17c00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] On node 0 totalpages: 114688
[    0.000000]   Normal zone: 1008 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 114688 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 113680
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:E0:A3:9D vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyS0,115200 console=tty1 root=PARTUUID=e530ccbb-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 376180K/458752K available (7816K kernel code, 712K rwdata, 2468K rodata, 508K init, 804K bss, 17036K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 27743 entries in 55 pages
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2a8/0x4d8 with crng_init=0
[    0.000022] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[    0.000088] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[    0.000206] bcm2835: system timer (irq = 27)
[    0.000824] Console: colour dummy device 80x30
[    0.001388] printk: console [tty1] enabled
[    0.001483] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.050393] pid_max: default: 32768 minimum: 301
[    0.050731] LSM: Security Framework initializing
[    0.051098] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.051167] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053379] Disabling memory control group subsystem
[    0.053703] CPU: Testing write buffer coherency: ok
[    0.055488] Setting up static identity map for 0x8200 - 0x8238
[    0.056735] devtmpfs: initialized
[    0.069316] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    0.069856] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.069948] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.079055] pinctrl core: initialized pinctrl subsystem
[    0.081201] NET: Registered protocol family 16
[    0.085851] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.092371] audit: initializing netlink subsys (disabled)
[    0.094583] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.094651] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.094853] Serial: AMBA PL011 UART driver
[    0.098640] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[    0.100744] audit: type=2000 audit(0.090:1): state=initialized audit_enabled=0 res=1
[    0.120831] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-01-08 14:33, variant start
[    0.130852] raspberrypi-firmware soc:firmware: Firmware hash is 194a85abd768c7334bbadc3f1911c10a7d18ed14
[    0.195513] bcm2835-dma 20007000.dma: DMA legacy API manager, dmachans=0x1
[    0.198775] SCSI subsystem initialized
[    0.199101] usbcore: registered new interface driver usbfs
[    0.199255] usbcore: registered new interface driver hub
[    0.199568] usbcore: registered new device driver usb
[    0.202480] clocksource: Switched to clocksource timer
[    1.676814] VFS: Disk quotas dquot_6.6.0
[    1.677041] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.677464] FS-Cache: Loaded
[    1.677888] CacheFiles: Loaded
[    1.699321] thermal_sys: Registered thermal governor 'step_wise'
[    1.700037] NET: Registered protocol family 2
[    1.701554] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.701684] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.701800] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.701925] TCP: Hash tables configured (established 4096 bind 4096)
[    1.702144] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.702222] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.702988] NET: Registered protocol family 1
[    1.704368] RPC: Registered named UNIX socket transport module.
[    1.704437] RPC: Registered udp transport module.
[    1.704472] RPC: Registered tcp transport module.
[    1.704503] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.706132] hw perfevents: no irqs for PMU, sampling events not supported
[    1.706261] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[    1.711199] Initialise system trusted keyrings
[    1.711963] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.729878] FS-Cache: Netfs 'nfs' registered for caching
[    1.731686] NFS: Registering the id_resolver key type
[    1.731800] Key type id_resolver registered
[    1.731841] Key type id_legacy registered
[    1.731898] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.734495] Key type asymmetric registered
[    1.734568] Asymmetric key parser 'x509' registered
[    1.734696] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.734750] io scheduler mq-deadline registered
[    1.734786] io scheduler kyber registered
[    1.738449] bcm2708_fb soc:fb: FB found 1 display(s)
[    1.751028] Console: switching to colour frame buffer device 82x26
[    1.758686] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416
[    1.772371] bcm2835-rng 20104000.rng: hwrng registered
[    1.776087] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    1.783382] vc-sm: Videocore shared memory driver
[    1.787300] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    1.816511] brd: module loaded
[    1.835903] loop: module loaded
[    1.841112] Loading iSCSI transport class v2.0-870.
[    1.845407] usbcore: registered new interface driver smsc95xx
[    1.848501] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.502488] random: fast init done
[    2.583273] Core Release: 2.80a
[    2.586181] Setting default values for core params
[    2.588983] Finished setting default values for core params
[    2.792366] Using Buffer DMA mode
[    2.795306] Periodic Transfer Interrupt Enhancement - disabled
[    2.798223] Multiprocessor Interrupt Enhancement - disabled
[    2.801104] OTG VER PARAM: 0, OTG VER FLAG: 0
[    2.804105] Dedicated Tx FIFOs mode
[    2.807887] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = d7d14000 dma = 0x97d14000 len=9024
[    2.813530] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    2.826338] dwc_otg: Microframe scheduler enabled
[    2.826568] WARN::hcd_init_fiq:457: FIQ on core 0
[    2.829181] WARN::hcd_init_fiq:458: FIQ ASM at c05a0374 length 36
[    2.831780] WARN::hcd_init_fiq:497: MPHI regs_base at dc810000
[    2.834430] dwc_otg 20980000.usb: DWC OTG Controller
[    2.837063] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[    2.839746] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[    2.842370] Init: Port Power? op_state=1
[    2.844958] Init: Power Port (0)
[    2.848055] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    2.853284] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.856057] usb usb1: Product: DWC OTG Controller
[    2.858743] usb usb1: Manufacturer: Linux 5.4.83+ dwc_otg_hcd
[    2.861430] usb usb1: SerialNumber: 20980000.usb
[    2.865452] hub 1-0:1.0: USB hub found
[    2.868206] hub 1-0:1.0: 1 port detected
[    2.872000] dwc_otg: FIQ enabled
[    2.872017] dwc_otg: NAK holdoff enabled
[    2.872028] dwc_otg: FIQ split-transaction FSM enabled
[    2.872053] Module dwc_common_port init
[    2.872791] usbcore: registered new interface driver usb-storage
[    2.876046] mousedev: PS/2 mouse device common for all mice
[    2.880555] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    2.887101] sdhci: Secure Digital Host Controller Interface driver
[    2.889953] sdhci: Copyright(c) Pierre Ossman
[    2.893718] mmc-bcm2835 20300000.mmcnr: could not get clk, deferring probe
[    2.897665] sdhost-bcm2835 20202000.mmc: could not get clk, deferring probe
[    2.900992] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.904939] ledtrig-cpu: registered to indicate activity on CPUs
[    2.908447] hidraw: raw HID events driver (C) Jiri Kosina
[    2.911644] usbcore: registered new interface driver usbhid
[    2.914700] usbhid: USB HID core driver
[    2.919054] vchiq: vchiq_init_state: slot_zero = (ptrval)
[    2.924435] [vc_sm_connected_init]: start
[    2.934893] [vc_sm_connected_init]: end - returning 0
[    2.940683] Initializing XFRM netlink socket
[    2.943580] NET: Registered protocol family 17
[    2.946452] Key type dns_resolver registered
[    2.950400] registered taskstats version 1
[    2.953224] Loading compiled-in X.509 certificates
[    2.971688] uart-pl011 20201000.serial: cts_event_workaround enabled
[    2.974833] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    2.983377] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    2.988689] mmc-bcm2835 20300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    2.991689] mmc-bcm2835 20300000.mmcnr: DMA channel allocated
[    3.022341] sdhost: log_buf @ (ptrval) (97d13000)
[    3.062008] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    3.066730] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.071207] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.073916] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.079884] of_cfs_init
[    3.103386] of_cfs_init: OK
[    3.108011] Waiting for root device PARTUUID=e530ccbb-02...
[    3.111773] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    3.180432] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.189546] mmc0: new high speed SDXC card at address aaaa
[    3.194535] mmcblk0: mmc0:aaaa SB64G 59.5 GiB
[    3.204565]  mmcblk0: p1 p2
[    3.238225] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[    3.241117] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[    3.252449] mmc1: new high speed SDIO card at address 0001
[    3.356102] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs
[    3.371311] EXT4-fs (mmcblk0p2): 1 orphan inode deleted
[    3.374046] EXT4-fs (mmcblk0p2): recovery complete
[    3.391456] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.396665] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    3.411758] devtmpfs: mounted
[    3.420658] Freeing unused kernel memory: 508K
[    3.423697] This architecture does not have kernel memory protection.
[    3.426589] Run /sbin/init as init process
[    4.173643] systemd[1]: System time before build time, advancing clock.
[    4.345613] NET: Registered protocol family 10
[    4.351068] Segment Routing with IPv6
[    4.417877] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    4.429000] systemd[1]: Detected architecture arm.
[    4.458582] systemd[1]: Set hostname to <raspberrypi>.
[    7.225453] random: systemd: uninitialized urandom read (16 bytes read)
[    7.257914] random: systemd: uninitialized urandom read (16 bytes read)
[    7.263013] systemd[1]: Listening on Syslog Socket.
[    7.271512] random: systemd: uninitialized urandom read (16 bytes read)
[    7.279395] systemd[1]: Created slice User and Session Slice.
[    7.289207] systemd[1]: Listening on Journal Socket.
[    7.309138] systemd[1]: Mounting RPC Pipe File System...
[    7.330118] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    7.348123] systemd[1]: Listening on udev Control Socket.
[    7.366216] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    9.523007] systemd[1]: Started Apply Kernel Variables.
[    9.697440] systemd[1]: Started File System Check Daemon to report status.
[    9.788891] systemd[1]: Started Journal Service.
[   11.583757] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   12.146266] systemd-journald[81]: Received request to flush runtime journal from PID 1
[   14.603802] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[   14.606645] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[   14.606675] [vc_sm_connected_init]: start
[   14.631407] mc: Linux media interface: v0.10
[   14.667146] [vc_sm_connected_init]: installed successfully
[   14.865264] videodev: Linux video capture interface: v2.00
[   14.952217] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   14.954369] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   14.957095] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   15.000896] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[   15.020115] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[   15.024280] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[   15.057960] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[   15.073233] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[   15.077013] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[   15.090234] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[   15.097763] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[   15.097817] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[   15.097851] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[   15.097877] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[   15.097902] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[   15.101015] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[   15.222773] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[   15.222881] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[   15.246264] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[   15.246341] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[   15.259507] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[   15.259586] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[   16.935217] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   17.347365] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   17.913035] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   17.933806] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   17.934305] usbcore: registered new interface driver brcmfmac
[   17.966176] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt failed with error -2
[   18.238715] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   18.238939] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   18.240193] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[   25.962910] random: crng init done
[   25.962941] random: 7 urandom warning(s) missed due to ratelimiting
[   27.247223] uart-pl011 20201000.serial: no DMA platform data
[   28.087899] 8021q: 802.1Q VLAN Support v1.8
[   28.507940] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   28.962226] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   30.349175] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   31.882375] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead
[   32.086629] Bluetooth: Core ver 2.22
[   32.086790] NET: Registered protocol family 31
[   32.086802] Bluetooth: HCI device and connection manager initialized
[   32.086834] Bluetooth: HCI socket layer initialized
[   32.086851] Bluetooth: L2CAP socket layer initialized
[   32.086892] Bluetooth: SCO socket layer initialized
[   32.107563] Bluetooth: HCI UART driver ver 2.3
[   32.107583] Bluetooth: HCI UART protocol H4 registered
[   32.107703] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   32.107987] Bluetooth: HCI UART protocol Broadcom registered
[   32.929639] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   32.929657] Bluetooth: BNEP filters: protocol multicast
[   32.929687] Bluetooth: BNEP socket layer initialized

Hi jfb, I know this is an extremely rude thing to say, but after searching deeper on the internet, it seems that many Pi Zero W users had the same problem as I do -- the wifi just drops itself and will not reconnect.

I've tried to turn off the power management, but still no luck. Someone on the raspberrypi.org mentioned that Pihole installing a conflicting dhcpd5 package might be the reason. Would you please raise this to the developers and see if they have anything to say about it?

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=279437&p=1803921#p1803921

dhcpcd5 is installed in the stock image. There is no such thing as a conflicting version of it.

Seems like it’s bad power management, otherwise it wouldn’t affect non Pi-hole users as noted in that forum.

Edit: Disable bluetooth if you aren’t using it. Bluetooth and WiFi in the 2.4 band conflict with each other.

Hi Dan,

I've disabled BT this morning, and pihole ran perfectly fine for a several hours.

Annd it still dropped wifi connection, I can't see the pi zero w in my router's connection list too. I guess I need a dongle for ethernet cable after all...

As a note to everyone who still has this problem, I tried the solution in here and it helped me so far (12+ hours without dropped connection). Will keep updating...

Edit 1: Running pass the 24hour mark, WOOHOO! I think its finally working properly!

For everyone who landed here, please try the link I posted above.

Tested on Pi zero W, wifi only no cable dongle

1 Like

Are you sure it was even on in the first place ?

pi@arcade:~ $ iw dev
phy#0
[..]
        Interface wlan0
[..]

pi@arcade:~ $ iw dev wlan0 get power_save
Power save: on

pi@arcade:~ $ sudo iw dev wlan0 set power_save off
pi@arcade:~ $

pi@arcade:~ $ iw dev wlan0 get power_save
Power save: off

I believe the Pi-OS distro default disabled power saving a long time ago for on-board WiFi ... but I could be wrong.
What distro do you have running ?

hostnamectl | tail -3

And maybe below is nicer for in the /etc/network/interfaces file:

allow-hotplug wlan0
iface wlan0 inet manual
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  wireless-power off

Above allows dhcpcd5 to UP the interface and assign it an IP:

pi@ph5:~ $ tail /etc/dhcpcd.conf
[..]
interface eth0
  static ip_address=10.0.0.4/24
  static routers=10.0.0.1
  static domain_name=dehakkelaar.nl
  static domain_name_servers=10.0.0.1

pi@ph5:~ $ sudo service dhcpcd restart
pi@ph5:~ $

pi@ph5:~ $ journalctl -u dhcpcd
[..]
Jan 29 23:04:10 ph5 dhcpcd[21014]: eth0: using static address 10.0.0.4/24
Jan 29 23:04:10 ph5 dhcpcd[21014]: eth0: adding route to 10.0.0.0/24
Jan 29 23:04:10 ph5 dhcpcd[21014]: eth0: adding default route via 10.0.0.1

Hi,

I'm pretty sure it was on. Yes, I've also read that the power management should be turned off in the first place, but apparently it was never that way? I've installed fresh due to this problem many times, and each time I tried to see the default state, the power management always says on.

I'm running the Raspberry Pi OS lite. Always downloaded fresh from the website.

Anyways, thank you for replying!

1 Like

Hi,

I am having a very similar issue to @godhand2.

Pi-hole has been running on raspberry pi zero W for almost 1 month with no issues.

I recently (approx 1 week ago) updated the pi-hole and since then, the pi has intermittently stopped working.

When this happens I can't perform DNS lookups from any device on the lan, can't ping or ssh into the RPI, can't hit the pi-hole web interface over http.

I have to pull the power on the RPI and it then restarts.

I don't have a wifi dongle, so I'm not sure that 'Disable Wifi Power Management' link is relevant, however, when I run ' iwconfig' on the RPI it indicates:

'Power Management:on'

I've also noticed the following happing repeatedly in /var/log/syslog despite the fact that the RPI has a static IP address.

Jan 30 02:38:55 pi-hole dhcpcd[444]: wlan0: carrier lost
Jan 30 02:38:55 pi-hole dhcpcd[444]: wlan0: deleting address ...
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Withdrawing address record for ... on wlan0.
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Leaving mDNS multicast group on interface wlan0.IPv6 with address ...
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Interface wlan0.IPv6 no longer relevant for mDNS.
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Withdrawing address record for 192.168.0.x on wlan0.
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.x.
Jan 30 02:38:55 pi-hole avahi-daemon[257]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jan 30 02:38:55 pi-hole dhcpcd[444]: wlan0: deleting route to 192.168.0.0/24
Jan 30 02:38:55 pi-hole dhcpcd[444]: wlan0: deleting default route via 192.168.0.1
Jan 30 02:38:56 pi-hole dhcpcd[444]: wlan0: carrier acquired
Jan 30 02:38:56 pi-hole dhcpcd[444]: wlan0: IAID eb:ff:81:37
Jan 30 02:38:56 pi-hole dhcpcd[444]: wlan0: adding address ...
Jan 30 02:38:56 pi-hole avahi-daemon[257]: Joining mDNS multicast group on interface wlan0.IPv6 with address ...
Jan 30 02:38:56 pi-hole avahi-daemon[257]: New relevant interface wlan0.IPv6 for mDNS.
Jan 30 02:38:56 pi-hole avahi-daemon[257]: Registering new address record for ... on wlan0.*.
Jan 30 02:38:56 pi-hole dhcpcd[444]: wlan0: probing address 192.168.0.x/24
Jan 30 02:38:57 pi-hole dhcpcd[444]: wlan0: soliciting an IPv6 router
Jan 30 02:39:01 pi-hole dhcpcd[444]: wlan0: using static address 192.168.0.x/24
Jan 30 02:39:01 pi-hole avahi-daemon[257]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.x.
Jan 30 02:39:01 pi-hole dhcpcd[444]: wlan0: adding route to 192.168.0.0/24
Jan 30 02:39:01 pi-hole dhcpcd[444]: wlan0: adding default route via 192.168.0.1
Jan 30 02:39:01 pi-hole avahi-daemon[257]: New relevant interface wlan0.IPv4 for mDNS.
Jan 30 02:39:01 pi-hole avahi-daemon[257]: Registering new address record for 192.168.0.x on wlan0.IPv4.

I don't see anything amiss in dmesg..

Can anyone suggest where I should be looking (presumably logs) to try and find the issue ?

Thanks

1 Like

It's almost impossible Pi-hole can cause such a failure to the operating system/hardware. The FTL daemon is intentionally started as an entirely unprivileged user (instead of root) so it couldn't even take down your network interface, even not by accident or bug. The worst that can happen is a failure of DNS if the service would die. However, I read

as "it doesn't even work with the (static) IP address". Is my assumption correct?

This may just have pulled some OS updates which caused this. I'm not sure how often you update your system (using apt update / apt upgrade) outside of Pi-hole updates.

So how is your Raspberry connected to the network? Via an Ethernet cable dongle or via WiFi? (I'm guessing the latter)

This looks suspicious. Does it happen more often? Maybe the carrier just cannot be re-acquired by the system when you see the failures. This would make sense.

Another reading: wlan0: carrier lost - Raspberry Pi Forums
An automatic re-connection cron job would be a workaround, but no great solution.

Switching to ifupdown could be tested, as the logs are currently coming explicitly from dhcpcd. For this in /etc/network/interfaces switch the interface from "manual" to "static" and add address, gateway and in case DNS directives, e.g.:

allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.0.9/24
  gateway 192.168.0.1
  dns-nameservers 1.1.1.1
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  wireless-power off

DNS servers here are applied via resolvconf when the interface is brought up. If resolvconf is not installed, the directive is invalid (remove/skip it) and instead you apply DNS servers via /etc/resolv.conf directly.

Then:

systemctl disable dhcpcd
systemctl enable networking
# To apply without reboot but intermediate network outage:
systemctl stop dhcpcd
ifup wlan0

Little bonus is that you save a few MiB RAM as no dhcpcd daemon is running.

To revert:

sed -i 's/static/manual/' /etc/network/interfaces
systemctl enable dhcpcd
# To apply without reboot
ifdown wlan0
systemctl start dhcpcd

The other directives in /etc/network/interfaces can stay, they have simply no effect when the interface is set "manual".
The networking service should be enabled (is on fresh Raspbian?) anyway to invoke wpa_supplicant and apply power management settings, if I'm not mistaken. Else:

systemctl disable networking
1 Like

Don't do that on Raspbian.

Edit:

Changing the Raspbian networking to the exact thing that Raspbian says "Do Not Do This" means that the next update that breaks the bodged networking will cause days of troubleshooting when every web search and Raspberry support forum search asks for /etc/dhcpcd.conf configuration. Days in to the troubleshooting process of why the configuration in /etc/dhcpcd.conf isn't affecting the network. And in the end it will be "But Pi-hole told me to change the network stack!!"

So really, don't do this, it's a bad idea all around.

dan@raspberrypi:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

@DanSchaper , where would you apply the power saving option ?

Its weird that ifupdown has a power saving option and dhcpcd5 doesnt ... to my knowledge.
Only options I can think of/that I found are:
via wireless-power option in ifupdown;
or create a systemd unit with the iw command to disable power saving;
or instruct the driver module to disable power saving when loaded;
or create a hook for dhcpcd that runs the iw command;
or schedule a ping to prevent going into power saver mode.

In the module.

https://www.raspberrypi.org/forums/viewtopic.php?t=61665#p631098

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=193437&p=1212183&hilit=disable+power+savings#p1212183

Yeah that sounds as the obvious place.
But that means there is no one size fits all solution as you have to figure out what module is used for your WiFi and if the option to disable power saving is available.

pi@arcade:~ $ sudo grep '' /sys/module/$(readlink /sys/class/net/wlan0/device/driver/module | xargs -n 1 basename)/parameters/*
/sys/module/brcmfmac/parameters/alternative_fw_path:
/sys/module/brcmfmac/parameters/debug:0
/sys/module/brcmfmac/parameters/roamoff:1
dehakkelaar@laptop:~$ sudo grep '' /sys/module/$(readlink /sys/class/net/wlan0/device/driver/module | xargs -n 1 basename)/parameters/*
/sys/module/iwl3945/parameters/antenna:0
/sys/module/iwl3945/parameters/disable_hw_scan:1
/sys/module/iwl3945/parameters/fw_restart:1
/sys/module/iwl3945/parameters/swcrypto:1

No one from Raspbian tells you to "Do Not Do This" :slightly_smiling_face:. Nothing on Raspbian depends on dhcpcd, except the "wait for network connection on boot" option from raspi-config, but for this, the network-online.target exists. Not sure why RPi devs chose to ship with dhcpcd by default while Debian ships with ifupdown (+ isc-dhcp-client/dhclient as default DHCP client suggestion, natively pulled in by ifupdown, automatically and only if interface is set to "dhcp"), but Raspbian/Raspberry Pi OS (including "Lite" images) is fully prepared to seamlessly switch to ifupdown-based network configuration, as that package + isc-dhcp-client are pre-installed as well and networking.service is indeed enabled by default.

Of course when searching for network related topics on web and RPi forum, it must be kept in mind how the network is set up, but you'll generally find a lot more instructions and help about how to configure networks via /etc/network/interfaces (ifupdown only) than via dhcpcd, based on the fact that the latter is rarely used as default (across all distros I mean).

And I hope Pi-hole debug script contains /etc/network/interfaces to check for network setup? Even among RPi users a lot use their own setup, especially for more complex networks.

Disabling dhcpcd simplifies the static IP network bring-up and no daemon is running that might interfere with the once configured interface + routes and it can be very easily reverted. So worth to at least give it a try to see if it changes something about the connection losses.

@schliden
As you mention iwconfig (instead of iw), could you try:

iwconfig wlan0 power off

Some WiFi chips to not react to all iw instructions. It is the modern replacement for iwconfig but works only with the kernel nl80211 interface that is not fully supported by older/rare WiFi chips. It might indeed be true for the Zero W onboard WiFi, a Realtek chip that at least does not work with upstream hostapd nl80211 driver. I also think that power management should be disabled by default on RPi, but again, worth to give it a try, the effect of the command is temporary until reboot. If it really works, we can make a udev rule from it that applies it automatically during early boot stage.

Not really, all Pi devices use the same wireless chip.