adafruit / Python-Thermal-Printer

217 stars 147 forks source link

Implement compatibility to Python3 and Raspberry Pi3 #22

Open gasperphoenix opened 8 years ago

gasperphoenix commented 8 years ago

Hi, I have just ported the below Library files to run with my Rasperry Pi 3 project using Python3. I verified the changes by running printertest.py with Python 3 and checking that the same output is produced as using Python 2.

For supporting Raspberry Pi 3 the terminal needs to be changed from ttyAMA0 to ttyS0. For supporting Python3 some usages of string elements needed to be reworked.

gasperphoenix commented 7 years ago

Hi, is there something wrong with my pull request? Could you please provide me a feedback? I opened the request 6 months ago but didn't receive any feedback up to now. Regards, Dennis

bradanlane commented 7 years ago

thanks to @gasperphoenix for the python3 edits - I merged them into my local copy and have a working system

Wyrda65 commented 7 years ago

@bradanlane could you share your merged repo? I am having troubles making raspberry 3 to print - it output a lot of white paper and then has some issues starting printing.

bradanlane commented 7 years ago

I started which what was likely a fork of a copy of a fork etc. I merged @gasperphoenix changes into what I was working with. (I also found a few bugs along the way).

You can find my version at: https://gitlab.com/bradanlane/hawkeyepi

zirkelc commented 6 years ago

Hi, I have just ported the below Library files to run with my Rasperry Pi 3 project using Python3. I verified the changes by running printertest.py with Python 3 and checking that the same output is produced as using Python 2.

For supporting Raspberry Pi 3 the terminal needs to be changed from ttyAMA0 to ttyS0. For supporting Python3 some usages of string elements needed to be reworked.

Could you please check why the inverse text (black background and white text) doesn't work?

ladyada commented 6 years ago

hiya can you try https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer https://learn.adafruit.com/mini-thermal-receipt-printer/circuitpython#step-12

zirkelc commented 6 years ago

hiya can you try https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer https://learn.adafruit.com/mini-thermal-receipt-printer/circuitpython#step-12

Could you please be a bit more specific? The inverse text worked in the past with python2.7 and with the serial interface "/dev/serial0", but since I changed it to "/dev/ttyS0" to be able to support python3, it doesn't work anymore. Everything else works perfectly when I run the printertest.py

ladyada commented 6 years ago

yah to thru that guide to use the circuitpython library and examples