Adafruit Thermal Printer Debugging

I have an Adafruit Thermal Printer that I’m connecting to my Electron. I’m sending lines to the printer to print, but the printer isn’t printing them. I have the printer’s green and yellow wires connected the the Electron’s Serial1 TX and RX pins. Here’s my code:

// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_Thermal.h>

Adafruit_Thermal printer;

bool ready = false;

int receiveMessage(String msg) {
    Particle.publish("alex-message-received", msg, PUBLIC);
    printer.println(msg);
    printer.feed(2);
    printer.setDefault();
    return 1;
}

void setup() {
    // Particle stuff
    Particle.function("message", receiveMessage);
    Particle.variable("ready", ready);
    // Particle.connect();
    Particle.publish("setup-particle-connected", "1", PUBLIC);
    
    // Printer stuff
    Serial1.begin(19200);
    // begin(SERIAL_IMPL* serial, int heatTime=200)
    printer.begin(&Serial1);
    Particle.publish("setup-serial-printer-begin", "2", PUBLIC);
    
    // Test message
    printer.println("TEST MESSAGE");
    printer.feed(2);
    printer.setDefault();
    Particle.publish("printed-test", "3", PUBLIC);
    
    ready = true;
}

void loop() {
    
}

I’m seeing the events in the console, but no lines are printing out of the printer. What could I be missing? How can I confirm that the connection is solid?

Have you crossed them TX -> RX and RX ->TX?

There are multiple Adafruit Thermal Printers with different product numbers, which one do you have?

I’ve triple checked that they’re in the right spot.

This is what I got from the Adafruit website:
Mini Thermal Receipt Printer Starter Pack[ID:600]

Were you able to print the test page? It should contain the baud rate.

Yes, the test page worked perfectly.

Good to know you triple checked, but could you please explicitly state how you got it connected, we can't see what you triple check.

So the triple check resulted in this setup: Yellow to TX and Green to RX
Right?

Your original post suggests otherwise but isn't very clear on that


The "Mini Thermal Receipt Printer Starter Pack[ID:600]" seems to contain this printer

(this link should have been included in the opening post)

And for that this is what the pinout says

Green -> TX
Yellow -> RX

Ok so that’s backwards. I was reading the bottom of the thermal printer and connecting the TX cable to the TX pin, and RX to RX. I wasn’t thinking of them as what they were: “Transfer” and “Receive”, where one’s transfer should go to the other’s receive.

I swapped the wires and now the test message is printing. Thanks for the guidance.

1 Like

That's why I said this in my first reply

What one side transmitts (TX) has to be received (RX) by the other.

1 Like