Live data from Hacker News

Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

printervention.app

61–70 of 102 posts

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#61

If you are using an LLM, wouldn't it have been a lot easier to just have the LLM find the relevant CUPS driver decompile or just capture the USB traffic, and rewrite it in Go or something native? (No need to deal with the system printing framework, the goal was just an app that accepts JPEG input.)

That's definitely possible for simpler drivers (CUPS filters) which accept CUPS-raster data for input. That's a majority of drivers for old printers.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#62
post #49

Earlier quoted context omitted.

Given your commercial aspirations, I'm happy to consult on your project as a paid contractor.

Fair enough! I just don’t think I fully understand what you’re suggesting.

> I just don’t think I fully understand what you’re suggesting.

Sure, sure.

Like I said, given your commercial (and closed-source) aspirations, I'm happy to consult on your project as a paid contractor. Doing work for free on a closed-source for-profit project is neither interesting nor in my interest.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#63
post #30

> I must apologise that I haven’t so far open-sourced any part of this that I don’t have to. Mainly that’s because I think this would be an awesomely sticky web property for a printer consumables firm to integrate with their sales site. And I’d much prefer it if they paid me to white-label it for them, rather than just forking a repo and getting it all for free. They might be interested if they cared at all about the…

These printer makers have the source code and the ability to write firmware. If they wanted to support WebUSB, they could and would.

Xerox just removed all the Linux drivers first for the majority of older models (even actual ones, which you can still buy), Windows and macOS drivers second for selected models (yet).

https://discussion.fedoraproject.org/t/xerox-removed-linux-d...

https://forum.support.xerox.com/community?id=community_quest...

Canon, Pantum, Brother, Kyocera, HP, they all still produce new devices on older hardware base, which require driver and does not support AirPrint/Mopria even over USB. They just don't care, they reuse what they wrote 20 years ago and ship it. Xerox and HP use Samsung printing engine and drivers, Pantum uses Lexmark.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#64

Doesn't Apple outright uses CUPS in the first place ? Did they just removed old drivers in their version ?

I'd be curious if cups works on wsl as well...

It does: https://openprinting.github.io/wsl-printer-app/

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#65
post #56

Earlier quoted context omitted.

Which is why Firefox doesn't support it either.

Firefox's non-reasons are just as lame as Apple's non-reasons. These APIs aren't security risks, the user has to explicitly opt-in on every website that requests USB access, just like every other privacy-risky API that a website requests, like microphone and camera access. WebUSB is no different. The only thing that has changed since camera and microphone access was allowed is that Apple now considers web apps to cut…

The user gets spammed with a million permissions popups a day and has no idea what they are actually accepting or what the risks are. The same looking permissions popup usually means something incredibly trivial like notifications or camera, while the webusb spec is exposing you to potentially high risks of damage to hardware or data theft.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#66
post #55
post #28

Earlier quoted context omitted.

From: https://developer.mozilla.org/en-US/docs/Web/API/WebUSB_API "WebUSB provides a way for these non-standardized USB device services to be exposed to the web. This means that hardware manufacturers will be able to provide a way for their device to be accessed from the web, without having to provide their own API." That doesn't sound secure at all!

That's nonsense. You have to opt-in on any website that is requesting USB access, just like every other useful but potentially privacy-risky browser API . Plenty of sites ask for camera access, and that is typically a USB device. Plenty of sites ask for microphone accesss, which can be a USB device. And even if those aren't always USB devices, they are still very much a privacy risk that browsers all allow. USB acces…

It's not about if the camera is a USB device or not, it's about what the capabilities being exposed is. Web browsers aren't just handing over the webcam as an arbitrary USB device, they are presenting a media stream from them. Which means they can't for example send arbitrary commands, flash firmware, or do any of the infinite things a USB device might present.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#67

Doesn't Apple outright uses CUPS in the first place ? Did they just removed old drivers in their version ?

You might think that such an important and long-standing feature as printing would undoubtedly be backed up by a large company. This was true until 2019, when it was backed by Apple. Currently, however, CUPS and all related projects are supported by volunteers, including myself.

Apple abandoned CUPS years ago, and recently have archived the repo on github: https://github.com/apple/cups

All the current development runs in OpenPrinting github: https://github.com/OpenPrinting, and mostly focused on newer projects, such as CUPS v3, PAPPL, Printer Applications.

Recent versions of CUPS v2 are still used in Chrome OS and Chromebooks though (apart from all Linuxes).

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#68
>Perhaps I could set them up a Raspberry Pi as a print server? But that would make it not so cheap. And anyway, I’m not convinced they’d go for the extra plugs and wires.

$35 and it's yours, with tech support and CUPS/SANE development funding included, and all open source: https://printserver.ink

Extra plugs could be eliminated with the help of "IEC320 3 pin C14 TO Male C13+2" cable: https://ae-pic-a1.aliexpress-media.com/kf/S4c8681fb1283499b8...

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#69
I did this with a Raspberry Pi. The printer in question only has WiFi and USB, no ethernet (the WiFi wasn't stable, and I don't trust the TCP/IP stack anyway). So what I did was I connected it to a Raspberry Pi via USB which is connected via ethernet to the living room. I added AirPrint and brscan, and the device can be shared via usbip.

For example, you can use a USB SDR and connect to it via usbip.

Initially, I also had to actually use qemu x86-64 for the scanner part which wasn't ideal.

The only UI computers which use it, are Apple's (iPhone and iPad). In a world where the network is the computer, usbip and iscsi are very cool tech.

The reason I went with a Raspberry Pi is since it already acts as an interface for Valetudo. So it was already in use anyway. Also, I want to add Bluetooth for IoT scanning, considering to run Home Assistant on it.

But yes, what it does lack is a UI. I was thinking of adding something with a reverse proxy, but I have no idea what, and this whole project isn't residing in my house. It is in my mother's apartment.

Re: Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

#70

>Perhaps I could set them up a Raspberry Pi as a print server? But that would make it not so cheap. And anyway, I’m not convinced they’d go for the extra plugs and wires. $35 and it's yours, with tech support and CUPS/SANE development funding included, and all open source: https://printserver.ink Extra plugs could be eliminated with the help of "IEC320 3 pin C14 TO Male C13+2" cable: https://ae-pic-a1.aliexpress-medi…

> 1 GiB LPDDR4

Wouldn't this be a huge problem trying to print anything with images or more than a page or two (most PDFs for example)?

Post reply on HN