Go Down

Topic: Thermal printer isn't Printing Images (Read 6879 times) previous topic - next topic

Nauman048


Did the modified library work okay?

I must say thankyou to you... Its working fine.. Thanks

Riva



Did the modified library work okay?

I must say thankyou to you... Its working fine.. Thanks

That's good to know, I may be temped to review the rest of the library in my spare time.
Don't PM me for help as I will ignore it.

samwell

LucidTronix has a tutorial on printing full color images and binary bitmaps on their site: http://www.lucidtronix.com/tutorials/28.  They have sample code, images, and a demo video.

samwell

Try the tutorial for printing bitmaps stored on an SD Card on a thermal printer available at http://lucidtronix.com/tutorials/28.  Their library automatically thresholds the image if it is in color and has a print scanline function that prints the image row by row.

Bobbo

Hi Riva,

hope you are still around, I have tried the attached files as well as bringing in your additions to the new Adafruit libraries, however they seem to have added a few additional lines that now cause the additions to bomb out.

Any chance you would be willing to relook at this?

I have the exact same issue where i need to use the GS v function instead of DC2, :-)

Adafruit-Thermal.h
Code: [Select]


   writePrintMode();

// Riva addition
    writeBytes(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h);

    setPrintMode(uint8_t mask),
    unsetPrintMode(uint8_t mask),
    writePrintMode();




Error

In file included from A_printertest.ino:14:0:
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:209:102: error: ISO C++ forbids declaration of 'writeBytes' with no type [-fpermissive]
     writeBytes(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h);
                                                                                                      ^
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:210:30: error: ISO C++ forbids declaration of 'setPrintMode' with no type [-fpermissive]
     setPrintMode(uint8_t mask),
                              ^
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:210:5: error: 'int Adafruit_Thermal::setPrintMode(uint8_t)' cannot be overloaded
     setPrintMode(uint8_t mask),
     ^

Riva

Hi Riva,

hope you are still around, I have tried the attached files as well as bringing in your additions to the new Adafruit libraries, however they seem to have added a few additional lines that now cause the additions to bomb out.

Any chance you would be willing to relook at this?

I have the exact same issue where i need to use the GS v function instead of DC2, :-)
A couple of questions first.
If you delete the Adafruit libraries and use the libraries I supplied does it print graphics okay? I'm trying to work out if the printer has changed and/or just the libraries.

Can you supply links to the printer your using (along with any manuals you can find) and link to the AdaFruit library your talking about just in case it's not the same as the ones I can find.
Don't PM me for help as I will ignore it.

Bobbo

Initially I just renamed the original files and copied your into the folder, after restarting the IDE it came up with the similar errors.

I then reloaded the library from the Lib manager and checked if it compiled, which it did, I then went through and added the code you highlighted "//Riva Additions" into the newer libraries.

I was on a similar track last night in trying to modify the Libraries but came unstuck on some of the more complex code, :-)

The printer i managed to get my hands on is a Digipos DS-800: http://support.epostraders.co.uk/support-files/documents/1/NUS-DigiPoS_DS800_PrinterManual.pdf

They don't refer to a DC2 command, however I see they do support the GS v command so i'm hopeful that the device is capable of printing simple bmps.

Bobbo

Replacing the .h and .cpp in the library gives me the following errors relating to the SoftwareSerial function:


A_printertest:26: error: no matching function for call to 'Adafruit_Thermal::Adafruit_Thermal(SoftwareSerial*)'
A_printertest.ino:26:35: note: candidates are:
In file included from A_printertest.ino:14:0:
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:51:3: note: Adafruit_Thermal::Adafruit_Thermal(int, int)
   Adafruit_Thermal(int RX_Pin, int TX_Pin);
   ^
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:51:3: note:   candidate expects 2 arguments, 1 provided
C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_Thermal_Printer_Library/Adafruit_Thermal.h:47:7: note: Adafruit_Thermal::Adafruit_Thermal(const Adafruit_Thermal&)
 class Adafruit_Thermal : public Print {

Bobbo

sorry, missed this. This is the Adafruit Lib I'm using that appears to have been updated since your previous edit.

https://github.com/adafruit/Adafruit-Thermal-Printer-Library


Bobbo

#39
Aug 18, 2015, 09:21 pm Last Edit: Aug 18, 2015, 09:22 pm by Bobbo Reason: Adding Attachment
Update: Fixed it - got to do with the way the IDE has removed the prog_* types

Updated library attached if anyone going forward comes across this thread.


Riva

Update: Fixed it - got to do with the way the IDE has removed the prog_* types

Updated library attached if anyone going forward comes across this thread.

Glad you got it sorted out. Are the libraries the old original ones or the latest AdaFruit ones? I just happened to still have the old AdaFruit libs and they compiled fine for me using IDE 1.0.6 so I guess the problem is the newer IDE's
Don't PM me for help as I will ignore it.

Bobbo

Used the new Libraries and added the //Riva additions - Updated into the sections where you made the changes, :-)

AndersV209

Update: Fixed it - got to do with the way the IDE has removed the prog_* types

Updated library attached if anyone going forward comes across this thread.


Awesome, it works great!!

I am going to make a new updated version of the adafruit thermal printer library in a few days, that is more suited for POS (point of sale) printers and not the adafruit one.
i will make a post here when it is done, right now it is about 80% done!

Riva

I am going to make a new updated version of the adafruit thermal printer library in a few days, that is more suited for POS (point of sale) printers and not the adafruit one.
i will make a post here when it is done, right now it is about 80% done!
That would be great for the people that need it. I had thought about going through the driver and adapting it to the new printer commands but in the end other projects won out because I don't have or need a printer (yet).
Don't PM me for help as I will ignore it.

Bobbo

#44
Aug 24, 2015, 05:47 pm Last Edit: Aug 24, 2015, 08:42 pm by Bobbo
Awesome, it works great!!

I am going to make a new updated version of the adafruit thermal printer library in a few days, that is more suited for POS (point of sale) printers and not the adafruit one.
i will make a post here when it is done, right now it is about 80% done!

Limited knowledge of how the libraries actually work, I was just lucky Riva commented his additions,  :)  but I'm happy to try help or at least test if you need it.

One of the things Im struggling with is how to get the bmp inline with text, or at least get some text next to it/ get 2 bitmaps next to each other would also be helpful.

Go Up