I am trying to get a Raspberry Pi to print scheduled updates, like a daily family menu, using a thermal receipt printer plugged into the USB port. The scheduling part works fine, but the actual printing seems to get stuck if the printer is doing something else or if I try to print a document while it is out of paper.
Right now, my script just sends the data and then assumes it worked. If the printer is busy, the script just hangs for a long time. I'm looking for a way to check the status before I send the print job. There are a few kernel ioctl calls I've read about that might work, but I am worried about messing up the USB connection or locking the whole link.
Does anyone know a clean way to check if the device is ready or if it is just busy so I can put the job into a proper queue and try again later? I am using the generic usb-to-printer driver so I am avoiding specific printer utilities.