Link to home
Start Free TrialLog in
Avatar of John Dinning
John DinningFlag for Australia

asked on

ESC/POS FS q command causes printer to freeze.

I'm trying to save an image in the non-volatile memory of a mobile printer using the ESC/POS FS q command, but after sending the command, the printer just freezes. 


The printer is a Citizen CMP-30II but is emulates ESC/POS which is an Epson standard.
All printer settings are default.


For testing I am just trying to save a black square image 32 x 32 pixels.
The data looks like this when printed on the printer in HEX-DUMP mode.

1c 71 01 32 00 32 00 ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff

Can anyone tell me what is wrong with this command?

My FS p print command, to print the saved image looks like this:
1c 70 01 30

If this looks wrong, does anyone have a working sample FS q command that I could try to send to the printer?


Avatar of Scott Fell
Scott Fell
Flag of United States of America image

It's been more than a few years since I used ESC/POS for an Epson receipt printer. As bad as the documentation is now, it was worse then because all of the documentation was behind a log in area you had to ask access for.

Anyway, I looked on the Espon site and it shows the command fs q is obsolete https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=90 but it does not show that on your printer https://www.citizen-systems.com/resource/support/Mobile/Command_Reference/CMP-30_ESC_ComMan.pdf it is possible the issue is just not documented with Citizen.

I wonder if it would be easier to print a series of characters instead https://reference.epson-biz.com/modules/ref_charcode_en/index.php?content_id=10


Avatar of John Dinning

ASKER

Thanks Scott, it would be easier to print characters, but unfortunately our retailer customer is very attached to their logo!

The citizen CMP printers (and POS printers) have been around for a long time so I would haver thought someone would know if there was an issue. I suspect it is a simple error om my part as the other commands I have tried work fine.

I don't know why Citizen have not implemented the GS ( L commands that have superseded the LS q and LS p commands but maybe they have decided there is no demand. There are examples of code using these functions out there that would be helpful if it was available to me.

I have successfully printed the logo using the ESC * command but you get lines through the image which looks terrible.

You are right in saying the documentation is bad, and every printer manufacturer that has implemented ESC/POS has just copied it. Some examples would have been nice.

Anyway, I have asked Citizen support for help but no response yet. I will also try through our printer distributor who may have a contact. I will report back if I find a solution. Thanks again for responding.


Ok, I thought you wanted a black square. No promises, but I have my code used for an Epson TM-88 something in my Dropbox archive. I will take a look, I think I have a logo used there.
The small black square was just to keep it very simple to test the FS q and FS p commands. All pixels are black so all data bytes are FF hex.
I will worry about converting the logo from a BMP or similar image file into the correct format later once I get past this problem.
Yes, it looks like I did something similar where I had a logo stored on the printer. The other options I had was to use base64 or have an image stored on the local drive which didn't seem to work too well.  However, I was also using qz.io and the image commands built in rather than having to use raw printing commands for that purpose.

I will tell you I had a lot of trial and error to get everything working. Hopefully, another Member here will see this and offer additional help.

Thanks for your efforts. I am printing from a Xamarin app on an Android device over Bluetooth and apart from this image issue it works well.
Citizen have a Xamarin SDK but it is out of date (Android dev is hard to keep up with) and even if I could get it working, I don't want to have to rely on it just for this feature.
The raw commands should be fine and should also allow it to be compatible with other ESC/POS printers.
ASKER CERTIFIED SOLUTION
Avatar of John Dinning
John Dinning
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial