-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HP LaserJet P1005: load firmware after power cycle #2
Comments
Thanks for the report and you detailed description of what you did. Now we know at least that the plugin gets correctly installed and on your update from 3.21.8 to 3.21.12 (both as Snap) the automatic download of the new 3.21.12 plugin has taken place. We also know that one can upload the firmware file contained in the plugin into the printer using the This especially means that the upstream HPLIP is OK and the bug is most probably in the script coming with the HPLIP Snap which replaces the missing UDEV rule support in Snaps. So you were right to report the bug in the project. No to how to debug the problem: You will more or less do what I actually had to do but could not do as I do not have a printer which needs firmware (and also no ARM system). So my fake firmware test (see my comment in #1) and that only on amd64 did not cover all the situations. To do the actually needed tests, debugging, and even find a fix you need to rebuild the Snap on your system. If you also have an amd64 PC or laptop and can install a Snap-supporting Linux on it (preferably Ubuntu) you could start on that system, first try to simply install the HPLIP Snap from the Snap Store and test whether there you encounter the bug, too. In this case the bug is most probably not an ARM problem and you could do the Snap rebuilding on the much faster amd64 system. Now continue on the fastest of your systems where you can reproduce the bug. On this system you need to install If it does not solve the bug but at least is healthy, you have your self-built HPLIP Snap running, meaning that you can modify it, build and install it again and see the reactions. The script which is supposed to auto-load the firmware is
which gets installed into
This script most probably contains the bug and needs to get modified, both during the debugging process and for the final fix. Note that you cannot edit the installed copy of the script, not even as root. You need to modify the version in the source tree, rebuild the Snap and install the new version, then the installed script gets replaced by your version and the Snap restarted, so your version will be actually running. First editing step is uncommenting line 3 of the script to switch it into debug mode. Then you see what the script is doing step-by-step in the syslog or the journal. Go through the script, it is well commented (I hope so at least). If the debugging output is not clear enough for you, add If you have a fix and made the automatic firmware load working, copy your debug-enabled version into a space outside the GIT repository, and make sure to create a script version with only your fix and no debug helper additions, comment out line 3 again. Check the Snap with this version. If it works, create a PR with it, if not, compare with your backup of your debugging version of the script to check whether you really have applied your complete fix. Run Turn off and turn on the printer again before each test, to be sure that the firmware is not still loaded from the previous test. I hope this helps you, please ask here whenever you have a question. |
Thanks for your patience with me; I had a busy week! Thanks again for walking me through contributing to this project. I did not have an arm64 computer available; but I did have an amd64 (x86_64) computer already running Ubuntu: I installed the
... and tried another test page. The test page printed. So it seems the problem occurs in multiple architectures, and I'll need to modify / recompile the snap and submit a PR. I have some time this afternoon, so I'll start on that now, and report my progress. |
I've tried inserting |
Did you see the two error messages in the lines right before the
It says "Operation not permitted". We must investigate why: Permissions in files, special restrictions under Snap, ... |
Could you replace lines 70 and 71
by
(Let the This way we repeat One could also try, when a device-appeared event has happened (line 71 gets reached) instead of the current line 71 put the code of the lines 47 to 52, as this code reliably loads the firmware. |
Sorry for the delay in responding. I managed to find something that works:
This seems to work reliably on the 1st or 2nd call to Thank you very much for your patient coaching, @tillkamppeter ! 😄 |
I have merged your pull request now and the Snap Store triggered a rebuild. For everyone running a version of the HPLIP Printer Application from the Snap Store the auto-update should happen in around 1 hour from now. And thanks a lot for testing and finding the solution @mparker17! Rarely the reporter of a bug helps so well solving it, and here it was especially important as I do not have the appropriate hardware for testing. If you are interested in further contributing to OpenPrinting, please tell. Especially you could also code for us in the Google Summer of Code 2022 (and from this year on, you do not need to be a student any more for it). Every kind of help or contribution is highly welcome. |
Problem / motivation
The HP LaserJet P1005 needs some firmware sent to it at least once after it is turned on.
Currently, it appears that the hplip-printer-app snap version 3.21.12 (snap from 2022-01-24; rev 251) with the proprietary plugin installed (HPLIP 3.21.12) doesn't do that automatically.
It appears that I can load the firmware manually from inside the hplip-printer-app snap if I know the USB bus and device number:
lsusb -d 03f0:3d17
- this returns something likeBus 001 Device 004: ID 03f0:3d17 HP, Inc LaserJet P1005
- note Bus001
and Device004
sudo snap run --shell hplip-printer-app
hp-firmware -y3 -s 001:004
-y3
= wait 3 seconds (from this ArchLinux thread - it appears that any value works, including leaving out-y
completely)-s 001:004
= Bus001
and Device004
hp-firmware
returns the messageerror: No device found that support this feature.
, even thoughlsusb
can detect the printer. I can't figure out a way to fix this other than rebooting.If you run with debug messages...
Once the firmware has been loaded at least once, you can print as many times as you'd like to the printer.
It appears you can also load the firmware as many times as you'd like, including before each print job.
Proposed resolution
Either:
Notes
I'm not sure if this issue belongs in this project or upstream, but I'd be happy to submit a patch or pull request if someone's willing to mentor me!
The text was updated successfully, but these errors were encountered: