So I decided to try and poll the printer for its status. As per the users manual, it says to send Esc v to get a status report back:
- Code: Select all
Serial2.write(27);
Serial2.write(118);
I've tried this, and using this routine to read data back from the printer:
- Code: Select all
if(Serial2.available()) {
char report[10];
char c;
int pos=0;
while(Serial2.available()) {
c=Serial2.read();
report[pos]=c;
pos++;
}
report[pos]='\0';
Serial.print("Printer status: ");
Serial.println(report);
}
This routine is one I've used repeatedly with success, for Serial debugging, for reading data from an Xbee (on Serial3) and so forth.
When communicating with the thermal printer, I'm only getting back what appears to be a single space rather than the status report. (The manual says the report would be formated as P#V##T##, eg P1V72T30 = paper good, voltage 7.2, temperature 30 deg C).
So I'm wondering if anyone else has tried or succeeded in reading status information back from their printer?
Thanks!

