Python Interface for HTPOW (Cheap Chinese CNC Laser Engravers)
Right now, I'm still prototyping and writing this, the code will be cleaner in the near future.
Hardware
- The laser this is developed against is a cheap sub-$100, shipped, cnc 1000mw laser from China.
- The laser enclosure is unbranded
- It is listed as HW V2, Firmware V2.4
- The software it uses is HTPOW.
- I am not a big fan of this software as it seems to only do raster stuff, and isn't the most user friendly, but it is functional.
- It also goes by the name of SuperCarver (software and laser engraver)
- It looks identical to some cheap chinese NEJE Lasers, but the protocol seems to be different
- Mine came with a bad power supply and EU converter, so I just use a USB power cable and connect it to a 2.4amp power source or powerbank (not very stable, as it seems to go into standby mode with the power bank)
- It uses a CH340 USB to Serial adapter which has drivers for Win, Mac, and Linux (built-in on modern distros)
- The Win driver is buggy with reconnecting to a port if it was opened. If this happens, either reboot or plug it into another USB port.
How to Sniff traffic
-
I used a freeware Serial Port Debugger called SUDT AccessPort, and would set it to listen to traffic on the com port of the laser, run a task, and save the output. I would then sanitize the output using some regular expression replaces and look for patterns and trends in the data. A parser was written to process and analyze the dumps easier. Another tool was created to further process the grey data from samples. Run it against the output of the previous script and it will show coords and grey levels in int values. Warning it bsod crashes if disconnecting usb before unbinding.
-
In order to read the entire payload and for future monitoring, I have moved to BusDog as my serial monitor.
-
You can get it by donating to Realterm
######Greyscale
- I finally got greyscale to work
- See the results of a sample image (Nuke Cola and Fallout Boy from Fallout)
Leather shows some good contrast at darker levels. This was done with 20ms speed.

Below is on cardboard. 60ms
Tweaked the source image and tried again... Greyscale is not super impressive on this cardboard material. 60ms
Some materials show grey better than others. It also depends on laser focus. The test cardboard provided seems to work the best.
Leather shows some good contrast at darker levels. This was done with 60ms speed.
#####Notice
- I thought I screwed up my device when playing with the raster images, it was just I sent some cmds that changed speed to 0 and write speed to 99+
- If you experience the device not moving or responding after resetting/calibrating and power cycling it, send new motor speed and write speed cmds to it to fix it.
#####Notice
- The Nuke Cola Fallout Boy image came from the Internet is only used as a sample image to test against.
- I have no affiluation with the creator of the image or the Fallout game/concept/etc.
- This does not represent their ideas, concepts, etc... I just picked it randomly as a sample image.
The leather greyscale looks better from a distance. Ignore all the other sample etchings, I was using this material to find an optimial cutting speed or contrast of the source image.
Actually don't ignore the sample etchings... look at them to see test results, even though you don't know the timing.

#####Note about offline
- To write offline
- It appears to send fd 00 00 00 00 00 ff to wipe the previous image
- Then reads in 4 null bytes
- then transmit in a single push an entire 512x512, 1 bit, 1 layer, upside down bitmap.
- To preview the box offline, it sends 1d 02 02 00 00 00 ff
- To center offline, it sends 1d 03 02 00 00 00 ff
- To start offline, send 15 01 02 00 00 00 ff
- It will respond with a 00 for every pixel processed
- To pause offline, send 15 00 02 00 00 00 ff
- To start at beginning offline, send 35 00 00 00 00 00 ff
#####Note about Linux support
- I tested a VM of Debian 8
- It mounted as /dev/ttyUSB0 (detected as ch341-uart)
- I had to install python-serial
- pyLaser.py ran without any modification under root.
- /dev/ttyUSB0 is not accessable as a normal user by default.
- Adding the user to the dialout group <usermod -aG dialout user> allowed a standard user to access the usb serial port after logging back in.
- As suspected, the code is OS agnostic provided that Python2 is on it. Likely Python3 is supported as is, since I modified all the print cmds and similar language differences.





