From 78b2959725ba8073edcd74d86187fc7e1f2d13ff Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 5 Nov 2024 14:41:25 +0000 Subject: [PATCH] Added a README.md --- Makefile | 12 +++++------ README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/config.yml | 8 -------- 3 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 README.md delete mode 100644 src/config.yml diff --git a/Makefile b/Makefile index c89a97d..eccbc7e 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..f173b05 --- /dev/null +++ b/README.md @@ -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: "" + port: "" +usb: + path: "" +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 diff --git a/src/config.yml b/src/config.yml deleted file mode 100644 index 15fb6c4..0000000 --- a/src/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -use: "socket" -socket: - host: "127.0.0.1" - port: "9100" -usb: - path: "/dev/usb/lp0" -encoding: - capabilities-file: ./capabilities.json