Arduino and thermal printer Epson M-T532

Hello guys , i am stuck on something so i was wondering if somebody could help me .
I am working on a thermal printer Epson M-T532 and i managed to print and some other options , but i am stuck on selecting page mode and print vertically "horizontal" its like a landscape mode , i searched everywhere and i managed to find the ESC L command but unfortunately it does not work also i tried other things and no luck can someone please help me ?

THis is how i used the ESC L command , i have used other commands the same way and they worked

mySerial.println("\x1B\x4C");

ivanh23:
Hello guys , i am stuck on something so i was wondering if somebody could help me .
I am working on a thermal printer Epson M-T532 and i managed to print and some other options , but i am stuck on selecting page mode and print vertically "horizontal" its like a landscape mode , i searched everywhere and i managed to find the ESC L command but unfortunately it does not work also i tried other things and no luck can someone please help me ?

THis is how i used the ESC L command , i have used other commands the same way and they worked

mySerial.println("\x1B\x4C");

donno the full command sequence but if you are sending bytes (not the ASCII character) why are you not using serial.write to sent then i.e:

mySerial.write(0x1B);
mySerial.write(0x4C);

Does the command sequence require at CR/LF hence the use of println?

That way dont work , thanks a lot but it still cannot rotate for example the bit image , can you check this pdf ,

http://support.epostraders.co.uk/support-files/documents/36/w3m-ESCPOS_Guide.pdf

Page 32 there is a pciture and some programming code that i dont understand , the picture is that what i am trying to get , can you suggest something ?
I edited my answer it does not work the example you showed me.

ivanh23:
That way dont work , thanks a lot but it still cannot rotate for example the bit image , can you check this pdf ,

http://support.epostraders.co.uk/support-files/documents/36/w3m-ESCPOS_Guide.pdf

Page 32 there is a pciture and some programming code that i dont understand , the picture is that what i am trying to get , can you suggest something ?
I edited my answer it does not work the example you showed me.

Capture.PNG

if this is the example you are taking about, the code pretty straight forward, just need to translate it!

so for example:

PRINT #1, CHR$(&H1D);"P";CHR$(180);CHR&(180);← Set horizontal and vertical motion units

would probably be something like

Serial.write(0x1D);
Serial.print("P");
Serial.write(180);
Serial.write(180);
//...you get the gist I hope! :)

OR if you wanted all in HEX as in your OP then somthing like this maybe:
mySerial.println("\x1D\x50\xB4\xB4");

As mentioned the only think I am still unclear is if you need a carriage return/linefeed at the end of each command.

if yes then just add either Serial.print("\r"); OR Serial.print("\n"); OR Serial.print("\r\n");

As I said I donno which one applies!

hope it helps.

Capture.PNG

I notice it says when you're in page mode, nothing gets printed until you send ESC FF

(FF is form feed, ASCII 10 ASCII 12 or 0xC) {EDIT Sorry - my bad}

So the procedure is

  1. Enter page mode (ESC L)
  2. Assemble the page in the printer's memory with a huge mess of different commands, during which the printer won't seem to do anything.
  3. Print the page (ESC FF)

Are you sending this final ESC FF command?

sherzaad:
As mentioned the only think I am still unclear is if you need a carriage return/linefeed at the end of each command.

If I remember my BASIC (it's been a long time since I sold my BBC Micro) the PRINT command implicitly throws in a CR and/or LF by default. So even though they're not mentioned I think it's worth experimenting to see if they're needed.

Sherzad still no luck :confused: and i think i dont need line feed or (/n) after every command,

GypsumFantastic i am not sending ESC FF , should i try ? what is the command ? i came across the command but sometimes i have dificulty to use it

Yes you should definitely try. FF is the form feed character. Once upon a time it was how you made a printer start a new page. It's ASCII character 12 or 0C in hex.

Try something like this to send ESC FF

Serial.write(0x1D); // ESC
Serial.write(0x0C); // FF

Still no luck :frowning:
Can you think of something else?

What did you actually do?

Are you sure your printer supports these features? Your model number isn't mentioned in the PDF document you linked to.

Well thats the thing , i am going blind folded with the commands , there is no data sheet for this model , other commands work , i guess this ones should work too

Have you had it working, just printing line by line in standard mode (ie. not page mode)?

I think the best approach is to pull apart the BASIC example in the PDF and make the Arduino a similar series of bytes to the printer, to see what works and what doesn't.

Luckily the code is quite well commented and explained in some detail on the following pages of the PDF.

Hi there, Hi Ivanh23, I read about your question for using EPSON M-T532 on Arduino,
can you please share your connection between printer and Arduino?
thanks