Adafruit Thermal Library Error
treysmith92 opened this issue · 4 comments
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
-
Arduino board: Particle PHOTON
-
Arduino IDE version (found in Arduino -> About Arduino menu): Particle IDE - build.particle.io
-
Attempting to flash the adafruit_thermal code to the particle photon, which has the library included, returns errors which I've included an image of.
First, ignore the unmaintained version of this library in the Particle libraries.
Edit: I did everything below by hand, and the following link may be sufficient for you to try this.
https://go.particle.io/shared_apps/58ed4c2f9b9b6f68b0000a98
If what you see has 5 tabs, it should be the right one (it wasn't sharing right at first - keyt trying to default to the broken default version of the library there - but now it seems to be sharing correctly.)
If that doesn't work, here's the manual steps:
Instead, get ready for some copy and pasting. For examples/A_printertest
, create a project with a name of your choosing, and for that main file copy and paste the raw contents of A_printertest.ino
with the following important changes:
..........
// Here's the new syntax when using SoftwareSerial (e.g. Arduino Uno) ----
// If using hardware serial instead, comment out or remove these lines:
//xx//#include "SoftwareSerial.h"
//xx//#define TX_PIN 6 // Arduino transmit YELLOW WIRE labeled RX on printer
//xx//#define RX_PIN 5 // Arduino receive GREEN WIRE labeled TX on printer
//xx//SoftwareSerial mySerial(RX_PIN, TX_PIN); // Declare SoftwareSerial obj first
//xx//Adafruit_Thermal printer(&mySerial); // Pass addr to printer constructor
// Then see setup() function regarding serial & printer begin() calls.
// Here's the syntax for hardware serial (e.g. Arduino Due) --------------
// Un-comment the following line if using hardware serial:
Adafruit_Thermal printer(&Serial1); // Or Serial2, Serial3, etc.
// -----------------------------------------------------------------------
void setup() {
// This line is for compatibility with the Adafruit IotP project pack,
// which uses pin 7 as a spare grounding point. You only need this if
// wired up the same way (w/3-pin header into pins 5/6/7):
//xx// pinMode(7, OUTPUT); digitalWrite(7, LOW);
// NOTE: SOME PRINTERS NEED 9600 BAUD instead of 19200, check test page.
//xx// mySerial.begin(19200); // Initialize SoftwareSerial
Serial1.begin(19200); // Use this instead if using hardware serial
printer.begin(); // Init printer (same regardless of serial type)
..........
Then create two tabs (Adafruit_Thermal.cpp
and Adafruit_Thermal.h
) and give them the same contents as are found in the repo here. (Make sure each has the appropriate content.)
Finally, create two more tabs (adalogo.h
and adaqrcode.h
) and give them the same contents as in the example headers of the same names. Remove the corresponding .cpp
tabs the IDE automatically creates for these.
The printer appears to communicate at 3.3V. Use the Photon pins labeled TX and RX (route TX on the particle to RX on the printer and vice versa). Ensure you have a solid power supply for the 5V-9V printer power (2A is recommended). Make sure the printer is on and works (hold down the black paper feed button when powering it on to generate a test page if you haven't already).
Run the sketch and it should print (it's exactly what I ended up doing today).
After all this, I'm considering learning how to contribute the port of this library myself...
Old Topic,
But could you maybe share your app again?
I'm desperately trying to get my thermal printer to work using Particle Photon.
Thank you!
Closing. Seems more like a Particle IDE issue.