Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP (printervention.app)

78 points by gmac 3 hours ago

morpheuskafka 2 hours ago

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.)

gmac 2 hours ago

Interesting suggestion: I guess that would have been possible. On the other hand I think this is a more general solution, and it does minimal reinventing-the-wheel.

dolmen an hour ago

Or ask the agent to write a Dockerfile (to abstract the build environment) that builds CUPS and all your stuff around it directl in WASM, instead of targeting x86 and then emulating x86 with WASM.

jojomodding 24 minutes ago

Is there a Docker-to-WASM pipeline, and how does it do anything differently from emulating x86?

huflungdung 32 minutes ago

[dead]

bityard an hour ago

Okay, this is reasonably genius. I have quite a few USB devices lying around that are either old enough or were niche enough that they don't work on modern _anything_, even Linux. One of them is a GameBoy Advance flash cartridge.

yjftsjthsd-h an hour ago

Oh, there's a thought - v86 supports lots of old DOS/Windows versions too, so assuming you could get the right port through (probably easy with anything USB, maybe possible with other things?) you could probably use your choice of old drivers:)

DeathArrow 13 minutes ago

I would have asked Claude to write a driver. But this works, too. :)

juancn an hour ago

Thank you, loved this and it made me "duh!".

I have an old-ish Samsung laser printer that works perfectly and a Linux file server at home and the printer no longer supports AirPrint.

I never thought about using the Linux box as an AirPrint server! This will free me from all the odd print requests from my kids! (probably)

mikepurvis 30 minutes ago

I have a Samsung ML-1740 kicking around still that I just can't bear to part with; I've been meaning forever to RasPi-ify it, but it's one of those projects that feels like it's going to end up being a rabbit hole.

SoftTalker an hour ago

I have an old Epson MX80 dot-matrix printer in the closet, have thought about getting a Raspberry Pi and setting that up so we can wirelessly print to it. But... who would really want that?

mrighele 37 minutes ago

For a printer like an Epson MX80 an esp32 should be enough to share the printer on a raw TCP interface (AppSocket I think the protocol is named) on port 9100. It is supported by Windows and CUPS.

Very easy implementation as it essentially it just forwards the data to the printer. Since it's a raw interface you need the proper driver, but luckily Epson provides a Windows 10 driver for the Epson MX-80 (!) [1] CUPS doesn't have driver for the MX-80 but it has a number of generic Epson drivers and my guess is that one of those will work.

The most difficult part is probably the parallel interface (unless you have a printer with a serial interface in which case it will be much easier)

[1] https://epson.com/Support/Printers/Impact-Printers/MX-Series...

monocasa an hour ago

Isn't cups a de facto apple project? What's the VM getting you?

merb an hour ago

monocasa 29 minutes ago

Oh, OK, new information, thanks!

But this driver is older than OpenPrinting's fork from Apple CUPS.

yjftsjthsd-h an hour ago

The gutenprint drivers to support the specific printer don't support darwin

monocasa 27 minutes ago

Gutenprint supports macos as a first class citizen, including this particular printer AFAICT.

gmac 24 minutes ago

hahn-kev 2 hours ago

This is pretty cool! Thanks for sharing.

leptons an hour ago

Too bad Apple is still preventing the WebUSB spec from being standardized. They won't even make suggestions to get it through committee because WebUSB might cut into their native app store.

davsti4 2 minutes ago

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!

hulitu 2 hours ago

Another AI add.

redeeman 2 hours ago

surely a glorious OS like osx would not be without support for hardware that linux supports? when will it be year of osx desktop?

akdev1l an hour ago

wdym?

OSX has literally always been supported only on very limited hardware so how would it support anything else?

redeeman 11 minutes ago

did you read what this is about? support for a printer people buy in stores. the kinda thing people expect working?