Devnol

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Devnol

  1. Hello, I'm on Unraid 6.11.1 and this method no longer works, since the Unraid Kernel Helper app listed on the google doc has also been delisted. Is there a newer way to get a webcam into a docker?
  2. I believe I have found a rather not very pretty solution. Instead of passing the device busid, you pass the entire bus it is on (e.g. if the printer is /002/012 and unplugging it turns it to /002/013, you can pass /dev/bus/usb/002 to the docker container in the Printer argument of the docker setup). However, for some reason unplugging the printer and plugging it back in does change the busid on the unraid host, but on the docker container you end up with the old busid (such as 012) which no longer exists, and the new one (013) does not get created. Here's where the jank comes in: I added a udev rule that runs a script that, similarly to the udev rule itself is copied from /boot/config on boot and is chmoded to 744 by the gofile. The udev rule is as follows: SUBSYSTEM=="usb", ATTRS{idVendor}=="cafe", ATTRS{idProduct}=="f00b", ATTRS{serial}=="AAAA1234", ACTION=="add", RUN+="/usr/local/bin/printer.sh" The printer.sh script is as follows: #!/usr/bin/bash #Copy LaserJet 1020 firmware to printer, replace lp0 with your own lp name, issue is that it might change on a reboot if you have multiple. If you have just one, you can specify lp* instead. cat /boot/config/cups/sihp1020.dl > /dev/usb/lp0 #restart the cups docker container to pick up the new /dev/bus/usb/ entry docker restart cups then the /boot/config/go code for the above is as such: cp /boot/config/rules.d/99-usb-rules.rules /etc/udev/rules.d/99-usb-rules.rules cp /boot/config/cups/printer.sh /usr/local/bin/printer.sh chmod 644 /etc/udev/rules.d/99-usb-rules.rules chmod 744 /usr/local/bin/printer.sh udevadm control --reload-rules udevadm trigger --attr-match=subsystem=usb (obviously make sure to copy the rule from /etc/udev/rules.d/99-usb-rules.rules to /boot/config/rules.d/ and /usr/local/bin/printer.sh to /boot/config/cups/, creating the required folders with mkdir, before restarting or they will be lost). Now the firmware file (sihp1020.dl), or any other foo2zjs printer for that matter, is kind of a pain to get: - Download the firmware sihp1020.img file (or whichever .img applies for your zjs printer) from https://github.com/koenkooi/foo2zjs (since the original foo2zjs servers are dead) - Move the .img file to somewhere in your unraid machine host - Copy the image to the cups container: - Open a webterminal - Copy the image to the cups container root as such: docker cp /mnt/user/data/sihp1020.img cups:/ - Run the arm2hpdl utility provided by foo2zjs inside the cups container with: docker exec cups arm2hpdl sihp1020.img > sihp1020.dl You should now have a .dl firmware file in your unraid host (do ls and you you should see it) - cp that to /boot/config/cups/sihp1020.dl so that it gets run by the script and is persistent across reboots. Now, every time you plug in your printer or turn it on it should blink a couple times while the firmware is being copied. After that, you should be able to add it to cups. However, there are a few caveats with this process: Due to the fact that the printer busid changes the printer.sh script restarts the cups container every time, effectively resetting it. However, all your cups configs inside /etc/cups will be safe since they are persistent, just a thing to note. Again, if anyone has a less jank way of doing this, I am all ears.
  3. Hi, I have the same laserjet 1020 and the reason why it doesn't work is much funnier than that. You see, that printer is a little stupid. That is to say that the printer doesn't persistently store its own firmware (because reasons). Thus, every time you power it on you actually have to manually copy the firmware file into /dev/usb/lpX (X being the line printer number it gets assigned, probably 0) EVERY TIME you power it on or connect it. I have figured out how to do that and will post instructions later if anyone wants to but I still haven't found how to get the docker container to change the bus ID when the printer gets disconnected. I tried the --device=$(readlink ...) thing that @rpertusio proposed, which worked until I restarted the container and then it failed, throwing an error on startup that it can't find the busid file (which no longer exists since it has changed and it's looking for the old one). It appears that removing --device=$(readlink...) and just providing /dev/printer1 as a printer does not work, probably because the symlink itself cannot be passed to the container. Perhaps a hard link would work instead? How can that be done with a udev rule? I'll see if I can find some solution, but please if you have any ideas I am very looking forward to hearing them.