Hi there Adafruit,
I recently ordered two thermal printers for our club (Order No: 741830-4299623043) and when I tried to print out the first test page I noticed some issues which then grew in scope once I began to perform my first prints. I first noticed that the Inverse ON function on the printer test page was not working and that the UPC A barcode was not printing out correctly - see attached figure 1. Since these vital were not vital to my project I carried on and attempted to print out some simple messages using the provided software, when I then found out if I attempted to print out a line that was longer than 23 characters, the printer would chop off most of the line - see attached figure 2. I see that this problem seems to have been encountered in recent weeks with other users (http://forums.adafruit.com/viewtopic.ph ... er#p359284). This problem occurred with both the printers I ordered and everything is wired and powered up according to the tutorial online. I was wondering if I could exchange the printers I have now for another set of printers that have the correct firmware installed? A return would be difficult since I ordered these products through my university, which would mean a lot of paperwork if I were to request a refund. Thank you so much for you help in this regard and I look forward to hearing back from you soon.
Mini Thermal Printer not working
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- germexican89
- Posts: 2
- Joined: Thu Apr 09, 2015 12:35 am
Mini Thermal Printer not working
- Attachments
-
- My first prints
- figure2.JPG (376.19 KiB) Viewed 414 times
-
- Printer test page
- figure1.JPG (509.55 KiB) Viewed 414 times
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Mini Thermal Printer not working
You may be overrunning the printer's input buffer.
A computer can send information to the printer a lot faster than the heating elements can move the information to paper, and the printer isn't smart enough to manage its own flow control (telling the computer to stop and wait when the input buffer is full). You have to throttle the data going to the printer on the computer/microcontroller side.
Try adding a 1ms-2ms pause every 50-100 characters or so. See if that helps.
A computer can send information to the printer a lot faster than the heating elements can move the information to paper, and the printer isn't smart enough to manage its own flow control (telling the computer to stop and wait when the input buffer is full). You have to throttle the data going to the printer on the computer/microcontroller side.
Try adding a 1ms-2ms pause every 50-100 characters or so. See if that helps.
- germexican89
- Posts: 2
- Joined: Thu Apr 09, 2015 12:35 am
Re: Mini Thermal Printer not working
Sorry for the delay. I made some changes (I added in your suggestion to include a delay(1000) command between line printings) to the code and it seemed to have fixed some problems, but others remain. In particular, the first line that I ask the printer to print out only seems to print the top 30 percent of the actual line before skipping ahead to the next line. In addition it would seem that the INVERSE ON command does not seem to invert the text. Below is a copy of my code and a picture of the output. Any help you could provide would be appreciated.
Code: Select all
// If you're using Arduino 1.0 uncomment the next line:
#include "SoftwareSerial.h"
// If you're using Arduino 23 or earlier, uncomment the next line:
//#include "NewSoftSerial.h"
#include "Adafruit_Thermal.h"
#include "adalogo.h"
#include "adaqrcode.h"
#include <avr/pgmspace.h>
int printer_RX_Pin = 5; // This is the green wire
int printer_TX_Pin = 6; // This is the yellow wire
const int I_NUMLOOPS = 7;
int i_loopcounter;
Adafruit_Thermal printer(printer_RX_Pin, printer_TX_Pin);
void setup()
{
Serial.begin(9600);
pinMode(7, OUTPUT); digitalWrite(7, LOW); // To also work w/IoTP printer
printer.begin();
// The following function calls are in setup(), but do not need to be.
// Use them anywhere! They're just here so they're run only one time
// and not printed over and over.
// Some functions will feed a line when called to 'solidify' setting.
// This is normal.
// Test inverse on & off
printer.inverseOn();
printer.println("Inverse ON");
printer.println("In setup");
printer.inverseOff();
//printer.sleep(); // Tell printer to sleep
//printer.wake(); // MUST call wake() before printing again, even if reset
printer.setDefault(); // Restore printer to defaults
}
void printonce()
{
printer.inverseOn();
printer.justify('C');
printer.println("This is a secret message really really long one");
printer.inverseOff();
}
void loop()
{
while (i_loopcounter < I_NUMLOOPS)
{
//delay(1000);
printonce();
i_loopcounter++;
if (i_loopcounter == I_NUMLOOPS)
{
printer.feed(5);
}
}
}
Please be positive and constructive with your questions and comments.