phomemo-tools
phomemo-tools copied to clipboard
Info about M02S
Thank you a lot for your work, which I'm going to use as a base for what I'm trying to do (I don't really want a CUPS driver, but I'm trying to make a command line program so I can run label "Some String"
and get exactly that printed on one of the 1/3 or 1/2 width sticky labels.
Anyway, I just bought a Phonemo M02S, and it seemed that I just wasn't able to print anything - until I realized the M02S has 512 pixels full width, instead of the 384 that the M02 seems to have.
When I changed the 0300 in the initialization code to 0400, and the 384 from the width adjuster to 512, printing on the 1/3 width label worked great.
Unfortunately, there doesn't seem to be an easy way to autodetect if you have a M02 or a M02s - the lsusb
has exactly the same device identifier:
Bus 001 Device 099: ID 0493:b002 MAG Technology Co., Ltd
and it doesn't look like the log from plugging the printer in has any useful distinction either:
Aug 27 15:35:11 natascha kernel: [862343.900189] usb 1-1.4.4: new full-speed USB device number 99 using xhci_hcd
Aug 27 15:35:12 natascha kernel: [862344.275498] usb 1-1.4.4: New USB device found, idVendor=0493, idProduct=b002, bcdDevice= 3.00
Aug 27 15:35:12 natascha kernel: [862344.275505] usb 1-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 27 15:35:12 natascha kernel: [862344.275508] usb 1-1.4.4: Product: USB Virtual COM
Aug 27 15:35:12 natascha kernel: [862344.275510] usb 1-1.4.4: Manufacturer: Nuvoton
Aug 27 15:35:12 natascha kernel: [862344.275512] usb 1-1.4.4: SerialNumber: A02014090305
Aug 27 15:35:12 natascha kernel: [862344.334555] cdc_acm 1-1.4.4:1.0: ttyACM0: USB ACM device
Aug 27 15:35:12 natascha kernel: [862344.338797] usblp 1-1.4.4:1.2: usblp1: USB Bidirectional printer dev 99 if 2 alt 0 proto 2 vid 0x0493 pid 0xB002
The MAC address for the BT interface is from a different range however, and the device name does include the S:
gbl@natascha$ hcitool scan
Scanning ...
04:7F:0E:56:12:17 M02S
If you're interested in supporting that printer, and want any more information, feel free to contact me. Else, feel just as free to just close and ignore this issue.
Thanks again for your work, it's going to help me a lot!
Hey @gbl, would you mind sharing where exactly you changed the "initialization code"? I tried looking through the source code to find 0300
, but wasn't very successful. Thanks!
It's a bit hidden, because the source uses 0x0030.to_bytes(2, 'little')
, and repeats this twice in lines 15 and 16.
What the printer really wants is 1d 76 30 00 xx xx yy yy
where the xx xx
is the number of bytes per row (pixels divided by 8) and yy yy
is the number of lines.
Also, I found out later, when writing my own code (https://github.com/gbl/phomemo/) that the M02S has actually 576 pixels, not 512, which translates to 72 bytes (hex 48). So you should replace the 0x0030
in line 16 (not in 15!) by 0x0048
, and then the 384 in line 78 by 576, twice.