You need to setup xstow in your home before following this tutorial:
Using xstow for local installations
If you don't have it, create the following directory
mkdir ~/local/src/gitlab/arcoslab -p
cd ~/local/src/gitlab/arcoslab
git clone https://gitlab.com/arcoslab/pt1230
cd pt1230
git checkout cable_labelling
sudo apt install libfreetype6-dev libfontconfig1-dev python3-numpy
cd ~/local/src/gitlab/arcoslab/pt1230
make
export PREFIX=${HOME}/local/DIR/pt1230
make install
cd ~/local/DIR/
xstow pt1230
sudo adduser _user_ lp
It is necessary to configure the permisions of the port correctly. Make sure that they are set properly so that pt1230 can access it without problems.
textlabel --font "Times New Roman" "test" | pt1230 -d /dev/usb/lp1 -b
This generates a bitmap image for “test” and it will be sent to the printer using the pt1230 command.
If you want to only get the bitmap image on screen use:
textlabel --font "Times New Roman" "test"
text-multi-line -f "Courier New:bold" -s 100 "line1
line2
line3
line4" | pt1230 -d /dev/usb/lp1 -b -c
This command generates a bitmap image with the text “line1 line2 line3 line4” separated in 4 lines and each centered. It automatically adjusts there size. The result is sent to the printer with pt1230 command.
“-c” option of pt1230 command avoids the printer to “feed” the tape. It conserves tape because for each print it normally feeds a lot of empty tape to allow to cut it correctly. Use the “-c” option as much as possible before ending printing. Then “feed” at the last print to cut correctly.
For printing in vertical orientation use:
text-multi-line -d 10 -i -f "Courier New:bold" -s 100 "line1
line2
line3
line4" | pt1230 -d /dev/usb/lp1 -b
-i is for vertical, and -d 10 is for 10 pixels of spacing between lines
You can print barcodes with this labeler using:
bincodes -e 39 -b "1" "2343452345325452345" | line2bitmap
text-cable-label -s 25 -d 2.7 "text" | pt1230 -d /dev/usb/lp0 -b -c
bmtoa -char 01 filename.xbm
bmtoa -char 01 filename.xbm | pt1230 -d /dev/usb/lp1 -b -c
-Usage example:
auto-cable -i /path/to/file/in.txt -o labelsOut
Make sure to write inside the in.txt file the cables in the following way, for example:
test: 10A, 18awg
You can also print several labels for the same cable:
test1, test2: 10A, 18awg
If you want to print for more than one cable:
test1, test2, test3: 10A, 18awg
test4: 10A, 11awg
Note: this program creats a bash executable file. For the labels to be printed you have to execute the file specifing the location of the usb port to wich the printer is conected. For example:
./labelsOut /dev/usb/lp1
pip install xrld
pip3 install pandas
pip install openpyxl
For this program the input file is a xlsx with the first column being the text that you want to print and the second column the cable. For example: