The officially official Devuan Forum!

You are not logged in.

#1 2019-05-17 13:37:03

GNUser
Member
Registered: 2017-03-16
Posts: 561  

unreliable wireless network printer after power off/on cycle [SOLVED]

All my Devuan ASCII computers at home print to an HP printer on my wireless network. The printer is always at the same local IP address.

I have noticed that if the printer reconnects to the network for any reason (e.g., one of my kids turns it off and I have to turn it back on), sometimes none of the Devuan computers can print unless I first reboot them. It's difficult to reproduce.

I have tried restarting cups on the computers after the printer reconnects to the network, but it makes no difference. Some other service or daemon probably needs to be restarted, but I have no idea which one.

So here is my question, fellow VUAs: Short of rebooting the computer, what can I do in order for a Devuan machine to able to print to a wireless printer (via CUPS) after the printer has gone through a network disconnect-reconnect?

Last edited by GNUser (2019-05-24 13:24:25)

Offline

#2 2019-05-18 02:35:27

GNUser
Member
Registered: 2017-03-16
Posts: 561  

Re: unreliable wireless network printer after power off/on cycle [SOLVED]

Here is some basic printer information:

eileen@vaio:~$ lpstat -s
system default destination: HPWireless
device for HPWireless: hp:/net/Photosmart_7520_series?zc=HPA0D3C1E1E36F

Ping and traceroute can't reach the printer when the problem occurs. Strangely, I cannot reproduce the problem at will--it seems to happen randomly.

Here are results when I can print:

eileen@vaio:~$ ping -c 1 -W 2 192.168.10.7
PING 192.168.10.7 (192.168.10.7) 56(84) bytes of data.
64 bytes from 192.168.10.7: icmp_seq=1 ttl=255 time=1.86 ms

--- 192.168.10.7 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.861/1.861/1.861/0.000 ms

eileen@vaio:~$ traceroute 192.168.10.7
traceroute to 192.168.10.7 (192.168.10.7), 30 hops max, 60 byte packets
 1  HPE1E36F (192.168.10.7)  4.685 ms  4.918 ms  4.886 ms

Here are results when I cannot print:

eileen@vaio:~$ ping -c 1 -W 2 192.168.10.7
PING 192.168.10.7 (192.168.10.7) 56(84) bytes of data.

--- 192.168.10.7 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

eileen@vaio:~$ traceroute 192.168.10.7
traceroute to 192.168.10.7 (192.168.10.7), 30 hops max, 60 byte packets
 1  192.168.10.187 (192.168.10.187)  1069.930 ms !H  1069.884 ms !H  1069.869 ms !H

Why is it that I need to reboot the computer (not the printer) in order to be able to print again?

Last edited by GNUser (2019-05-18 02:48:09)

Offline

#3 2019-05-18 03:13:32

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: unreliable wireless network printer after power off/on cycle [SOLVED]

I just replaced my router, which seemed to be a crappy one. Among its brokenness, it "forgot" about the statically configured printer when the printer went into low power mode. But this got resolved with printer restart, rather; I never tried rebooting my computer.

The thought I had now though, was that possibly the DHCP service of the router makes a more forceful broadcast when the computer reclaims its IP in order to confirm that the IP is available, and that it then also address the DHCP registered MAC (not merely its ARP MAC list) with the result to bring the printer out of its economy mode. It's a theory smile

Offline

#4 2019-05-18 13:28:53

GNUser
Member
Registered: 2017-03-16
Posts: 561  

Re: unreliable wireless network printer after power off/on cycle [SOLVED]

Thank you, ralph.ronnquist. That's an interesting theory. Next time I can't print, I'll try just disconnecting/reconnecting the computer from the wireless network instead of rebooting the computer. I'll report the results.

Offline

#5 2019-05-18 13:50:11

GNUser
Member
Registered: 2017-03-16
Posts: 561  

Re: unreliable wireless network printer after power off/on cycle [SOLVED]

Hmm, I was curious about the ?zc= suffix in the printer's URI. An internet search tells me the zc stands for zeroconf and is related to avahi-daemon.

https://bugs.launchpad.net/hplip/+bug/521909

The strange thing is that avahi-daemon is not running on my machines because I disabled it (it is privacy-unfriendly). (Maybe I disabled avahi-daemon after installing the printer? I installed ASCII and setup the printer a long time ago and can't remember.) Maybe the ?zc= suffix has something to do with the flaky connection to the printer. I'll try re-creating the printer with the ?ip= suffix in its URL followed by its local ip address.

UPDATE:
I reconfigured the printer:

eileen@vaio:~$ lpstat -s
system default destination: HPWireless
device for HPWireless: hp:/net/Photosmart_7520_series?ip=192.168.10.7

Not sure if the new URI will cause the printer to be reachable more consistently, but it sure looks better!

Last edited by GNUser (2019-05-18 14:15:45)

Offline

#6 2019-05-24 13:11:47

GNUser
Member
Registered: 2017-03-16
Posts: 561  

Re: unreliable wireless network printer after power off/on cycle [SOLVED]

TL;DR version:
    This HP printer's dhcp client is flaky. If the printer's dhcp lease expires while printer is off, the printer cannot reliably get back on the network after being powered on--despite what its friendly beeps and lights might lead one to believe. Configuring router's dhcp server (dnsmasq) to give the printer a non-expiring ("infinite") lease solved the problem.

-----

Detailed version:
    I was able to consistently reproduce the problem by turning printer off, revoking printer's dhcp lease (in router: # pkill dnsmasq,  delete the line in /var/lib/misc/dnsmasq.leases that shows printer's lease, # dnsmasq), then turning printer back on. After printer fully powers on, its blue network light blinks for a little while then printer makes a friendly beep and blue light goes steady to indicate it has a network connection--which I found to be a big lie. In my experiments I found one of three things to always be true:

1. Printer takes a long time to negotiate a new dhcp lease--no new lease shows up in router's dnsmasq.leases (and printer is not reachable by ping or traceroute) until several minutes after printer's blue light is steady
2. Printer does not negotiate a new dhcp lease at all until I push some buttons on its little screen asking it to display its network settings
or
3. Printer never actually negotiates a new dhcp lease and reports that it has an ip address that is not even on my network (169.254.227.111)

Explaining the problems I was experiencing:
    Sometimes the kids turn off the printer and it is off for a few days until we find ourselves having to print again, by which time the printer's 24-hour dhcp lease has certainly expired. Those times it seemed that I needed to reboot my laptop before I could print again were probably due to situation #1 above--me rebooting was simply giving the printer enough time to finish negotiating a new lease with my router.

The solution:
    Configure printer to do as little as possible network-wise (in its settings, choose "get address automatically", provide the wireless network password, and that's it) and let the router not only assign the desired static IP but also make the lease non-expiring. This line in dnsmasq.conf takes care of both things: dhcp-host=aa:bb:cc:11:22:33,192.168.10.7,infinite (where aa:bb:cc:11:22:33 is the printer's MAC address, of course).
    Now when I turn the printer off and back on, it quickly gets on the network (can be reached by ping and traceroute) and can print reliably.

I hope this helps someone. I've been scratching my head on and off because of this for well over a year at this point.

Last edited by GNUser (2019-05-24 13:23:06)

Offline

Board footer