I have a RPi Zero W as a printer gadget, and it shows up as a printer on my Macbook (solved here in comments https://unix.stackexchange.com/questions/408293/how-to-make-g-printer-usb-gadget-printer-work-in-raspberian-pi?noredirect=1#comment731094_408293). I have it set on the Mac as an Epson 9-pin (a very basic printer).
If I send data from my Macbook with lp -d linux_g_printer some_text_file.txt
and listen on the RPi as sudo cat /dev/g_printer0
the RPi receives garbage characters.
Is the lp
operation trashing the text due to the driver?
Is the cat
operation not appropriate to listen?
How do I test the interface and send data?
strings /dev/g_printer0
strings
on the file on the Macbook displays the lines of the file. Running it on the RPi displays nothing. It looks like the data arriving atg_printer0
is being corrupted (or modified) so mostly non-printable data (binary) is being returned, and thus no output from strings. It's like a classical serial port baud rate problem, but that should not apply here.http://localhost:631