Added a README.md

This commit is contained in:
2024-11-05 14:41:25 +00:00
parent 89a5061105
commit 78b2959725
3 changed files with 60 additions and 14 deletions
+6 -6
View File
@@ -1,19 +1,19 @@
build:
docker buildx build -t esilva-printer .
docker buildx build -t thprinter .
clean:
docker container rm esilva-printer-container-test --force
docker container rm thprinter-container-test --force
attach:
docker exec -u root -it esilva-printer-container zsh
docker exec -u root -it thprinter-container zsh
attach-test:
docker exec -u root -it esilva-printer-container-test zsh
docker exec -u root -it thprinter-container-test zsh
test: clean
docker run \
--name esilva-printer-container-test \
--name thprinter-container-test \
-p 9099:9099 \
-it esilva-printer zsh
-it thprinter zsh
debug: clean test
+54
View File
@@ -0,0 +1,54 @@
# About
This is still an early stage of the project. Its usable but it still has no
proper build system up.
I use it daily as it is, but I do hope I can make it something more accessible
in this learning adventure.
# TODO
- Submit the profile of the HZ-8360 thermal printer to the escpos-printer-db
project (I still need to properly configure the printer with its full features)
- Add a build system
- ...
# Usage
## Configuration
Configure your `config.yaml` in the `src` directory:
```yaml
use: "socket"
socket:
host: "<printer-ip>"
port: "<printer-port>"
usb:
path: "<printer-usb-device>"
encoding:
capabilities-file: ./capabilities.json
```
## About the `capabilities.json` file
For this, I decided to use the [escpos-printer-db](https://github.com/receipt-print-hq/escpos-printer-db)
project already available on GitHub. It's a project where one can configure its
thermal printer and then use a script to collate its code pages data.
I have copied the profile for my printer into this repo `HZ-8360.yml`, if you
have a different thermal printer you should check the original repo for
something compatible and if there isn't, write your own based on other profiles.
Copy the `capabilities.json` file you generated into the `src` directory of this
project.
## Running it
Go to the `src` directory and try it with:
`$ echo "Something, something" | go run .`
# Relevant links
https://github.com/receipt-print-hq/escpos-printer-db
https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/dle_eot.html
https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/commands.html
https://en.wikipedia.org/wiki/Code_page_860
https://en.wikipedia.org/wiki/Windows-1258
-8
View File
@@ -1,8 +0,0 @@
use: "socket"
socket:
host: "127.0.0.1"
port: "9100"
usb:
path: "/dev/usb/lp0"
encoding:
capabilities-file: ./capabilities.json