pklaus / brother_ql_web

A Python-based web service to print labels on Brother QL label printers. Based on brother_ql: https://github.com/pklaus/brother_ql
GNU General Public License v3.0
254 stars 124 forks source link

Printing failure on Raspberry Pi/QL-700 (blinking red LED) #15

Closed DoktorJ closed 4 years ago

DoktorJ commented 5 years ago

So I finally got a chance to upgrade to the latest versions of brother_ql and brother_ql_web, and now am encountering new errors. For reference I'm using a Brother QL-700 on a Raspberry Pi (Raspbian Stretch, kernel ver 4.14.50-v7+) with Python 3.5.3 and pip 18.1.

If I attempt to run it as a non-root user (e.g. pi user), I get "permission denied" errors on /dev/usb/lp0 (I've confirmed this is the correct device for my printer) when attempting to print.

If I attempt to run it as root, the web app says "printing successful", but the console spits out this error

WARNING:brother_ql.raster:Trying to switch the operating mode on a printer that doesn't support the command.
WARNING:brother_ql.raster:Trying to switch the operating mode on a printer that doesn't support the command.

and nothing prints; the LED on the printer blinks red @ 0.5Hz. The full output running loglevel DEBUG is as follows:

Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://:8013/
Hit Ctrl-C to quit.

/usr/local/lib/python3.5/dist-packages/bottle.py:3335: DeprecationWarning: Absolute template path names are deprecated.
  fname = self.search(name, self.lookup)
192.168.1.162 - - [10/Oct/2018 14:27:15] "GET /labeldesigner HTTP/1.1" 200 12519
192.168.1.162 - - [10/Oct/2018 14:27:15] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 0
192.168.1.162 - - [10/Oct/2018 14:27:15] "GET /static/css/custom.css HTTP/1.1" 304 0
192.168.1.162 - - [10/Oct/2018 14:27:15] "GET /static/js/jquery.min.js HTTP/1.1" 304 0
192.168.1.162 - - [10/Oct/2018 14:27:15] "GET /static/js/bootstrap.min.js HTTP/1.1" 304 0
192.168.1.162 - - [10/Oct/2018 14:27:15] "POST /api/preview/text?return_format=base64 HTTP/1.1" 200 4320
WARNING:brother_ql.raster:Trying to switch the operating mode on a printer that doesn't support the command.
WARNING:brother_ql.raster:Trying to switch the operating mode on a printer that doesn't support the command.
DEBUG:brother_ql.raster:raster_image_size: 720x90
192.168.1.162 - - [10/Oct/2018 14:27:18] "POST /api/print/text HTTP/1.1" 200 41856

Here is some information from my system about the printer:

$ lpstat -s
no system default destination
members of class LabelPrinter:
    QL-700
device for LabelPrinter: ///dev/null
device for QL-700: usb://Brother/QL-700?serial=000B5Z809299
$ ls -lZ /dev/usb
total 0
crw-rw---- 1 root lp ? 180, 0 Oct  9 17:17 lp0
logazer commented 5 years ago

Did you check the settings regarding printer model in the config.json? Trying to switch the operating mode on a printer that doesn't support the command. To me this seems like a strong hint in this direction. Maybe post a censored version of your config here, then I might be able to spot the problem.

And, although you don't seem to have the error message I had, your printer address is in the same scheme that caused problems in my case, check out #10 for that!

I would love to know what let's your version work with that address if that's not the cause of your problem. (Which it doesn't seem to be, but who knows)

pklaus commented 4 years ago

Usually those errors are due to an incorrect label being selected on the web frontend. The software doesn't check with the printer that the selected one matches the one in the printer. It just sends the instructions (which succeeds) but the printer then cannot handle the commands for a label type it doesn't have loaded. So it blinks red.

Let me know if you cross-checked you're using the right label type and think there's still an issue here.