Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does all this magic actually work? 🖍️ #62

Open
krtschmr opened this issue Nov 9, 2023 · 0 comments
Open

How does all this magic actually work? 🖍️ #62

krtschmr opened this issue Nov 9, 2023 · 0 comments

Comments

@krtschmr
Copy link

krtschmr commented Nov 9, 2023

Since i have zero background on this printing stuff but it's all fun to set this up for my wifes hair salon, i tried looking behind the doors a bit.

ESC/POS commands are quite nasty with all this bytecode, but glad we have this library.

eventually it becomes cpj.binaryPrinterCommands = escposCommands; where the commands are just a list of commands and that's about it.

when i played with the printer of my wife around, i realized i can GET/POST the IP address of it, and it'll print infos about the request.
i realized, i can open just a socket to IP:9100 and send commands, so i tried to print hello world.
this might have worked sometimes, but i still don't know how. definitely i wasn't able to send a cut command.

now using this library to build the escpos commands should be enough, at the end those are just commands in order.

how can i convert those commands now to actually then print on it via socket connection?

eventually in ruby i wanna do this

socket = TCPSocket.new "192.168.0.150", 9100
socket.write (bytecode)

and i'm failing to understand how this magic works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant