This is a simple ESCPos Server written in NodeJS. This project use node-escpos as the printer driver. If you have any issue with the printer driver, please refer to their site.
- Download the compiled server on the release page (Currently available on Windows, you can compile the server by yourself)
- Install the usb adapter (Please refer to this section)
- Open the
escpos-server.exe
- Set your port (default
3000
) - Click
Start Server
button - Wait until the server started
- Now you can send http post request to the server to execute node-escpos commands
Example Commands:
{
"commands": [
{
"command": "text",
"args": ["Hello World"]
},
{
"command": "cut", // this command is important, because cut will flush the buffer printer
"args": []
},
{
"command": "close", // this command is important to close the printer connection
"args": []
}
],
"options": {
"encoding": "GB18030"
}
}
- On Linux, you'll need
libudev
to build libusb. - On Ubuntu/Debian:
sudo apt-get install build-essential libudev-dev
- On Windows, Use Zadig to install the WinUSB driver for your USB device
- Download Zadig
- Connect your printer
- Open Zadig
- Select Options -> List all devices
- Select your printer from the dropdown list (Note: Be careful! select the right printer, because this software will replace your device driver)
- Select WinUSB
- Replace Driver, wait until the process finished
if you have any trouble or issue, please refer to the Zadig site
you can try the example here
- Install NodeJs (I'm using version
12
) - Install the dependencies
npm install
oryarn install
- Run
npm run make
- Check the
out
directory, your binary files will be there
this project use ElectronJS to create the GUI