1

I want to attach my GOOJPRT Thermal Printer (I believe model QR701, communication RS232) to my ESP32 but I cannot seem to get them working.

I tried all the Adafruit Thermal Printer library examples but get the same error each and every time:

"Error compiling for board ESP32 Dev Module." 

I guess the libraries are not meant for the ESP32. I also tried the "Thermal Printer Library" by Larry Bank (which should be compatible with the ESP32 according to its github docs) but there I cannot figure out how to connect the wires of thermal printer to the ESP32 correctly.

Of course, I do not ask for a specific solution, I am just looking for someone to point me in the right direction!

enter image description here

This is an image of the exact thermal printer I have

Full error message from Adafruit Thermal Printer examples:

C:\Users\Thomas\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:41:27: fatal error: avr/interrupt.h: No such file or directory
compilation terminated.
Multiple libraries were found for "Adafruit_Thermal.h"
 Used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library
 Not used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit-Thermal-Printer-Library-master
Multiple libraries were found for "SoftwareSerial.h"
 Used: C:\Users\Thomas\Documents\Arduino\libraries\SoftwareSerial-master
 Not used: C:\Users\Thomas\Documents\Arduino\libraries\EspSoftwareSerial
exit status 1
Error compiling for board ESP32 Dev Module

Second error message from Adafruit Thermal Printer example after removing the manually installed SoftwareSerial.h:

A_printertest:21:28: fatal error: SoftwareSerial.h: No such file or directory
Multiple libraries were found for "Adafruit_Thermal.h"
compilation terminated.
 Used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library
 Not used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit-Thermal-Printer-Library-master
exit status 1
SoftwareSerial.h: No such file or directory
asked Jan 14, 2021 at 10:09
9
  • 1
    What is the error you are actually getting? The message you pasted us is the one telling you that an error occurred, not what the error was. Without the actual error we can't help you. Commented Jan 14, 2021 at 11:15
  • @Majenko♦ Please see the full error message above, which I copy pasted from the Arduino IDE Commented Jan 14, 2021 at 13:22
  • It looks like you have installed some other SoftwareSerial library manually. You should never ever need to do that since almost all cores bundle their own version that is specific to the core. Delete it. You don't want it. Ever. Commented Jan 14, 2021 at 13:37
  • 1
    @Majenko I posted the other message on the bottom again. I am a tiny step further now, I managed to get output from my thermal printer through the Serial2 port on my ESP32 (tx/rx on pin16/17). Unfortunately the output is all gibberish but consistent (baudrate is correct). I posted a topic here on the Adafruit forum: forums.adafruit.com/viewtopic.php?f=22&t=174116 Commented Jan 14, 2021 at 20:06
  • 1
    ÊSP32 has three hardware serial ports (UARTS), so no need for SoftwareSerial. To use Serial1 and Serial2, see e.g. github.com/espressif/arduino-esp32/issues/… Commented Jan 14, 2021 at 23:59

1 Answer 1

-1

You need to use the <HardwareSerial. h> library. SoftwareSerial is for Arduino boards. "Thermal Printer Library" by Larry Bank is for GOOJPRT PT-210 and uses Bluetooth. Won't work for QR-701. Instead of using Adafruit Library, you can try with this: ThermalPrinter.

This May Help, Peter

answered Nov 16, 2022 at 6:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.