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.
lp operation trashing the text due to the driver?
cat operation not appropriate to listen?
How do I test the interface and send data?