Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(14 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
[[File:Ql820nwb.png|400px|Ql820nwb.png]]


Notes for Fablab Label Printer installation
Notes for Fablab Label Printer installation
The following installation is needed for the Fablab Material Management App. The App sends a JSON-File with the label data to a Raspberry Pi which then prints a label using the QL-820NWB Labelprinter.


== 1. Installation of Printer-Server ==
== 1. Installation of Printer-Server ==
Zeile 6: Zeile 10:
- Install Raspberry PI OS Lite (no desktop needed) on Raspberry<br/> - sudo raspi-config (Enable SSH, set wirless password)
- Install Raspberry PI OS Lite (no desktop needed) on Raspberry<br/> - sudo raspi-config (Enable SSH, set wirless password)


=== 1.1 Standard PrinterServer to be used with P-Touch Software ===
1.1 Raspberyy&nbsp;PrinterServer for Brother Label Printers


Step-by-step:
Step-by-step:
Zeile 24: Zeile 28:
<pre>systemctl restart p910nd.service</pre>
<pre>systemctl restart p910nd.service</pre>


Check web-site above for necessary settings in Windows / MacOS<br/> Main steps are:
Check this [https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups web-site ]for necessary settings in Windows / MacOS<br/> Main steps are:


#Install correct Brother Driver for your operating system  
#Install correct Brother Driver for your operating system  
Zeile 30: Zeile 34:
#Un-check Query printer  
#Un-check Query printer  
#Select Customer, Protocol Raw, Port Number 9100&nbsp;  
#Select Customer, Protocol Raw, Port Number 9100&nbsp;  


=== 1.2 Python Print Server for JSON Files ===
=== 1.2 Python Print Server for JSON Files ===
Zeile 35: Zeile 41:
sudo apt install python3-pil python3-flask python3-qrcode
sudo apt install python3-pil python3-flask python3-qrcode
sudo apt install python3-pip
sudo apt install python3-pip
pip install brother_ql</pre>
sudo pip install brother_ql</pre>


Extend Path-variable with /home/pi/.local/bin (sudo nano /etc/profile)
Extend Path-variable with /home/pi/.local/bin (sudo nano /etc/profile)
Zeile 45: Zeile 51:
<pre>sudo shutdown -r now </pre>
<pre>sudo shutdown -r now </pre>


Check unique ID of Brother Printer on USB-Port:
If you have a label-printer connected via USB, check unique ID of Brother Printer on USB-Port:
<pre>brother_ql -b pyusb discover (Should be something like: usb://0x04f9:0x209b)</pre>
<pre>brother_ql -b pyusb discover (Should be something like: usb://0x04f9:0x209b)</pre>
For printers with WLAN, just set-up the WLAN Infrastructure setting on the printer (Network & Password) and reserver the printers IP - Address in your router. The IP-Address needs to be corrected in the attached Python-program.


Copy Arial Font-File arial.ttf in home-directory
Copy Arial Font-File arial.ttf in home-directory
Zeile 52: Zeile 60:
unzip arial.zip</pre>
unzip arial.zip</pre>


Generate or copy python-file (s.a. attached file&nbsp;[http://wiki.zurich.fablab.ch/Datei:BrotherLabelPrinterServer.zip [1]] )<br/> Make sue the unique ID is correct in the program in line "subprocess.run....."
Generate or copy python-file (s.a. attached file [[Media:WL_BrotherLabelPrinterServer.zip|WL_BrotherLabelPrinterServer.py]])<br/> Make sue the unique ID is correct in the program in line "subprocess.run....."
<pre>wget http://wiki.zurich.fablab.ch/Datei:BrotherLabelPrinterServer.zip
<pre>wget http://wiki.zurich.fablab.ch/Datei:WL_BrotherLabelPrinterServer.zip
unzip BrotherLabelPrinterServer.zip
unzip WL_BrotherLabelPrinterServer.zip
</pre>
</pre>


Run server with
Run server with
<pre>python3 BrotherLabelPrinterServer.py</pre>
<pre>python3 WL_BrotherLabelPrinterServer.py</pre>


Test with Postman - Post command:
Test with Postman - Post command:
Zeile 71: Zeile 79:
     "Price": "9 CHF",
     "Price": "9 CHF",
     "Labelsize": "standard"
     "Labelsize": "standard"
    "PrinterIP": "xx.x.x.xx",
&nbsp;  "color": "yes"
}
}
</pre>
</pre>
To autostart the programm at startup add crontab job (don't use rc-local). Call on the raspberry
<pre>crontab -e</pre>
and add the line below:
<pre>@reboot cd ~/ && sudo python3 WL_BrotherLabelPrinterServer.py
</pre>
=== Example Labels: ===
[[File:BrotherLabelSample.jpg|x200px|BrotherLabelSample.jpg]]


=== Further Links: ===
=== Further Links: ===
Zeile 80: Zeile 101:
Using a Raspberry to make a generic printserver for the Brother Label-Printer: [https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups]
Using a Raspberry to make a generic printserver for the Brother Label-Printer: [https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups]


&nbsp;
[[Thunkable_App_für_Materialwirtschaft|Thunkable App für Materialwirtschaft]]


&nbsp;
[[Google_Sheet_für_Materialwirtschaft|Google Sheet für Materialwirtschaft]]

Aktuelle Version vom 18. Mai 2023, 10:19 Uhr

Ql820nwb.png

Notes for Fablab Label Printer installation

The following installation is needed for the Fablab Material Management App. The App sends a JSON-File with the label data to a Raspberry Pi which then prints a label using the QL-820NWB Labelprinter.

1. Installation of Printer-Server

- Install Raspberry PI OS Lite (no desktop needed) on Raspberry
- sudo raspi-config (Enable SSH, set wirless password)

1.1 Raspberyy PrinterServer for Brother Label Printers

Step-by-step:

sudo apt install p910nd
sudo nano /etc/default/p910nd
Edit file p910nd:
# Printer number, if not 0
P910ND_NUM=""

# Additional daemon arguments, see man 8 p910nd
P910ND_OPTS="-f /dev/usb/lp0"

# Debian specific (set to 1 to enable start by default)
P910ND_START=1

Start service:

systemctl restart p910nd.service

Check this web-site for necessary settings in Windows / MacOS
Main steps are:

  1. Install correct Brother Driver for your operating system
  2. Add a printer using TCP/IP address
  3. Un-check Query printer
  4. Select Customer, Protocol Raw, Port Number 9100 


1.2 Python Print Server for JSON Files

sudo apt update
sudo apt install python3-pil python3-flask python3-qrcode
sudo apt install python3-pip
sudo pip install brother_ql

Extend Path-variable with /home/pi/.local/bin (sudo nano /etc/profile)

Grant user access right to USB-port:

sudo usermod -aG lp pi

Restart Raspberry:

sudo shutdown -r now 

If you have a label-printer connected via USB, check unique ID of Brother Printer on USB-Port:

brother_ql -b pyusb discover (Should be something like: usb://0x04f9:0x209b)

For printers with WLAN, just set-up the WLAN Infrastructure setting on the printer (Network & Password) and reserver the printers IP - Address in your router. The IP-Address needs to be corrected in the attached Python-program.

Copy Arial Font-File arial.ttf in home-directory

wget https://www.freefontspro.com/d/14454/arial.zip
unzip arial.zip

Generate or copy python-file (s.a. attached file WL_BrotherLabelPrinterServer.py)
Make sue the unique ID is correct in the program in line "subprocess.run....."

wget http://wiki.zurich.fablab.ch/Datei:WL_BrotherLabelPrinterServer.zip
unzip WL_BrotherLabelPrinterServer.zip

Run server with

python3 WL_BrotherLabelPrinterServer.py

Test with Postman - Post command:

IP: http://10.0.0.81:5000/print_label

Body (raw / json):

{
    "QR-ID": "123",
    "Title": "Sample Product",
    "Size": "4x3 m2",
    "Discount": "5% Discount",
    "Price": "9 CHF",
    "Labelsize": "standard"
    "PrinterIP": "xx.x.x.xx", 
    "color": "yes" 
}

To autostart the programm at startup add crontab job (don't use rc-local). Call on the raspberry

crontab -e

and add the line below:

@reboot cd ~/ && sudo python3 WL_BrotherLabelPrinterServer.py

Example Labels:

BrotherLabelSample.jpg

Further Links:

Description command line tool brother_ql: https://pypi.org/project/brother-ql/0.8.3/

Using a Raspberry to make a generic printserver for the Brother Label-Printer: https://www.splitbrain.org/blog/2020-08/18-raspberry_print_server_for_brother_ql-500_label_printer_no_cups

Thunkable App für Materialwirtschaft

Google Sheet für Materialwirtschaft