LowieGoossens / octolabel

MIT License
7 stars 3 forks source link

Octoprint-OctoLabel 1.0

OctoLabel is a plugin allowing Octoprint to print labels. This is a fork of the amazing pluggin Octorant by @bchanudet. This is a fork of the amazing pluggin Octotweet by @Jean Pierre GARCIA. This is a fork of the amazing api label_api by @Philipp Klaus.

What is this?

This plugin makes it possible to print a label with a brother label printer each time a print is ready. On this label stands the name of the printer so we know to witch printbed we have to go to collect a print, And the name of the printed file so we know for who the print is. This is a preview of a printed label: (This is a die cut 62x29 label from brother) preview

How does this work?

how

(Multiple Octoprint instances can send data to one single label instance)

This plugin wil only send the required data to the computer connected to the label printer. On the computer connected to the label printer runs another api that you need to manually install. THis api is included in the label_print_api directory. In the plugin settings you need to specify the ip-address of the computer connected to th label printer. In this example this is: ip-settings

SETUP

Install the plugin manually

Install manually using this url :
https://github.com/LowieGoossens/octolabel/archive/refs/heads/master.zip

After installing enable the plugin on the plugin manager and on the first checkbox in the settings tab.

Install the plugin through the octoprint plugin manager

Search for Octolabel in the plugin manager and press install. After installing enable the plugin on the plugin manager and on the first checkbox in the settings tab.

change the label-printer settings

Label Settings

Here you can customize the timing of every Label handled by Octoprint.

screen setup 1 screen setup 2

Scripts Settings

Octotlabel allows you to launch scripts everytime a message is sent:

Script configuration was deliberately made a little harder, as running scripts exposes much more the host computer. You can find more indications on the wiki.

Message format

Messages are regular twitter messages, which means you can use:

Some events also support variables, here is a basic list:

Printing process : started event

Printing process : failed event

Printing process : done event

Printing process : failed event

Printing process : paused event

Printing process : resumed event

Printing progress event

Printer state : error

about the label api

Included in the folder label print api, there you find the api writen by Philipp Klaus. Run this api on a seperated raspberry connected to an brother label printer and modify the namebadge plugin. It is possible to change the lettertype, textposition, de label type,... It is important to change the ip-adres and printer settings in the file label_api. (Do not change the port)p

The following printers are claimed to be supported (✓ means verified by the author or by contributors):

QL-500 (✓), QL-550 (✓), QL-560 (✓), QL-570 (✓), QL-580N, QL-650TD, QL-700 (✓), QL-710W (✓), QL-720NW (✓), QL-800 (✓), QL-810W (✓), QL-820NWB (✓), QL-1050 (✓), and QL-1060N (✓). The new QL-800 series can print labels with two colors (black and red) on DK-22251 labels.

Note: If your printer has an 'Editor Lite' mode, you need to disable it if you want to print via USB. Make sure that the corresponding LED is not lit by holding the button down until it turns off.

The available label names can be listed with brother_ql info labels:

 Name      Printable px   Description
 12         106           12mm endless
 29         306           29mm endless
 38         413           38mm endless
 50         554           50mm endless
 54         590           54mm endless
 62         696           62mm endless
 102       1164           102mm endless
 17x54      165 x  566    17mm x 54mm die-cut
 17x87      165 x  956    17mm x 87mm die-cut
 23x23      202 x  202    23mm x 23mm die-cut
 29x42      306 x  425    29mm x 42mm die-cut
 29x90      306 x  991    29mm x 90mm die-cut
 39x90      413 x  991    38mm x 90mm die-cut
 39x48      425 x  495    39mm x 48mm die-cut
 52x29      578 x  271    52mm x 29mm die-cut
 62x29      696 x  271    62mm x 29mm die-cut
 62x100     696 x 1109    62mm x 100mm die-cut
 102x51    1164 x  526    102mm x 51mm die-cut
 102x152   1164 x 1660    102mm x 153mm die-cut
 d12         94 x   94    12mm round die-cut
 d24        236 x  236    24mm round die-cut
 d58        618 x  618    58mm round die-cut

Setup the label api

(the zipped version included on my github has some minor changes)

Extract the zipped folder on the computer connected to the label printer in the directory you want to run it from.

setup label_api

In the label_api-master directory you find the file label_api, in this file you can change some variables according to your setup.

label_api

setup init.py

label_api

install and run

Install requirements:

pip install -r requirements.txt

Run:

./label_api
# for more info:
./label_api --help

The CLI signature of label_api is as follows:

Usage: label_api [OPTIONS]

  Start the label_api software

Options:
  --host TEXT     Host / IP to listen on
  --port INTEGER  Port to listen on
  --model TEXT    brother_ql model
  --backend TEXT  brother_ql backend
  --printer TEXT  brother_ql printer
  --debug         Enable verbose debugging output
  --help          Show this message and exit.

For more reference, you can go to the Octoprint documentation on Events.