Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Implement compatibility to Python3 and Raspberry Pi3 #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gasperphoenix
Copy link

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 and others added 5 commits October 23, 2016 09:00
- Change default terminal to ttyS0 for Raspberry Pi 3
- Bug fix of write function to estimate the correct count of characters
- Use of ord() to determine the correct byte code for a character
- Encode character to convert it to a byte array for terminal output
Verification: printertest.py produces correct output - PASSED
@gasperphoenix
Copy link
Author

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

@gasperphoenix gasperphoenix changed the title Python3and raspberry pi3 Implement compatibility to Python3 and Raspberry Pi3 Apr 21, 2017
@bradanlane
Copy link

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

@Wyrda65
Copy link

Wyrda65 commented Jun 5, 2017

@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
Copy link

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
Copy link

zirkelc commented Oct 22, 2018

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?

@zirkelc
Copy link

zirkelc commented Oct 23, 2018

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
Copy link
Member

ladyada commented Oct 26, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants