Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:


Notes for Fablab Label Printer installation
Notes for Fablab Label Printer installation
Zeile 7: Zeile 6:
- 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)


&nbsp;


=== 1.1 Standard PrinterServer to be used with P-Touch Software ===
=== 1.1 Standard PrinterServer to be used with P-Touch Software ===
Zeile 33: Zeile 33:
#Add a printer using TCP/IP address  
#Add a printer using TCP/IP address  
#Un-check Query printer  
#Un-check Query printer  
#Select Customer, Protocol Raw, Port Number 9100&nbsp;
#Select Customer, Protocol Raw, Port Number 9100&nbsp;  


&nbsp;


=== 1.2 Python Print Server for JSON Files ===
=== 1.2 Python Print Server for JSON Files ===
Zeile 57: Zeile 58:
unzip arial.zip</pre>
unzip arial.zip</pre>


Generate or copy python-file (s.a. attached file BrotherLabelPrinterServer.py)<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:https://pypi.org/project/brother-ql/0.8.3/|BrotherLabelPrinterServer.py]])<br/> Make sue the unique ID is correct in the program in line "subprocess.run....."
<pre>sudo nano BrotherLabelPrinterServer.py</pre>
<pre>sudo nano BrotherLabelPrinterServer.py</pre>


Zeile 75: Zeile 76:
     "Labelsize": "standard"
     "Labelsize": "standard"
}</pre>
}</pre>
=== Further Links: ===
[https://pypi.org/project/brother-ql/0.8.3/]
&nbsp;

Version vom 16. April 2023, 13:15 Uhr

Notes for Fablab Label Printer installation

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 Standard PrinterServer to be used with P-Touch Software

Web-site: [1]

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 web-site above 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
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 

Check unique ID of Brother Printer on USB-Port:

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

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 BrotherLabelPrinterServer.py)
Make sue the unique ID is correct in the program in line "subprocess.run....."

sudo nano BrotherLabelPrinterServer.py

Run server with

python3 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"
}

Further Links:

[1]