Arduino and Zebra KR403

Hello, i am trying to print on Zebra KR403 with arduino , i am using RS232 , but nothing happens , this is my code so far

#include <SoftwareSerial.h>
SoftwareSerial printer(13, 12);


void setup() {
  // put your setup code here, to run once:
    Serial.begin(9600);
  printer.begin(9600);
 
}

void loop() {
  // put your main code here, to run repeatedly:
 printer.print("^XA");
 printer.print("^B0R,7,N,0,N,1,0");
 printer.print("^FD 7. This is testing label 7^FS");
 printer.print("^XZ");
 delay(100);
}

i am not sure about this , if someone can help me
Thank you

Is the printer expecting a Carriage Return and/or Linefeed at the end of each command ?

I am not sure but i think its carriage return

ivanh23:
I am not sure but i think its carriage return

If it does need a CR then you are not sending one

Try changing the print() commands into println() or print an explicit Carriage Return ("\r") after each command

Tried it , still nothing :confused:

Please post a complete program that illustrates the problem

Have you got RX and TX in the software serial definition the right way round?

Also, have you remembered that RX on the Arduino goes to TX on the Zebra and vice versa?

Yeah i know about the RX and TX and still nothing , i am familiar with arduino and thermal printers , this is not my first printer , but it wont do anything , no matter what a try :confused: , and i need some suggestions

How do you know if the printer is not faulty ?

And which RS232 converter are you using between the Arduino and the printer ?

It does not seems faulty everything else function properly, i am using the RX and TX pins from the cable directly connected to pins to arduino , plus the ground pin from the rs232 to arduino ground , this way worked for other printers , but not for this one m

Please do as requested in reply #5 and post a complete program that illustrates the problem

ivanh23:
This way worked for other printers , but not for this one m

Other KR403 printers or other printers of a different type ?

For other types, I made some breakthrough , i managed to print from windows , with Zebra Designer 3 .
For the full program ilustration i did the following :
Ok so i have 1 printer Zebra KR403 , connected on arduino the connection is this way:

RX from RS232 to TX on Ardunio
TX from Arduno to RX on RS232
GND from RS232 to GND on the Arduino

My code is the following:

#include <SoftwareSerial.h>
SoftwareSerial printer(13, 12);


void setup() {
  // put your setup code here, to run once:
    Serial.begin(115200);
  printer.begin(115200);
 
}

void loop() {
  // put your main code here, to run repeatedly:
 printer.print("^XA");
 printer.print("^B0R,7,N,0,N,1,0");
 printer.print("^FD 7. This is testing label 7^FS");
 printer.print("^XZ");
 delay(100);
}

I set the baud to 115200 it was the default on the printer , but still nothing happens ,

Hi,
What model Arduino are you using?
Just as a shot in the dark, can you try using another pin, other than 13?
If you Arduino is a Uno or a Nano, there is an onboard LED connected to that pin.

Is the printer expecting RS232 voltage levels?
Have you got a converter chip, TTL to RS232?

Thanks... Tom... :slight_smile:

Okey, i made another breakthrough, i managed to separate the wires from RS232 cable connected to the PC, that allow comunication , now i have 4 wires but using the software serial library i can assign only 2 wires(RX,TX) but i am using RX, TX, CD and DTR.
So the question now i guess is , how can i connect all 4 pins to arduino
I am using arduino Uno

I don't think your printer uses true RS232. If it did, your Arduino would be a dead piece of smoking circuitry. I suspect that your cable is actually USB - is that correct?

It may be that the printer is using RS232 like protocols over a USB connection, so it's at a harmless 5V. Usually when making cables for this kind of thing, you need to use some of the control wires too.

When I did this many years ago with actual RS232, every printer was different. It sounds like you need to set one of the control wires, probably high, to tell the printer you're ready. Attach them both to digital pins and read their value. One of them may already be high to tell you the printer is ready for data. Try setting the pins as outputs and experiment with high and low values until you can print.