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

Issues while running the image print python code on raspberry pi3 (latest stretch raspian lite version) #29

@titusece

Description

@titusece

Hello Experts,

pip3 install pyserial
pip3 install image
python3 sudoku-gfx.py

pi@camera1-rpi3:~/Python-Thermal-Printer $ python3 sudoku-gfx.py 
Traceback (most recent call last):
  File "sudoku-gfx.py", line 29, in <module>
    printer = Adafruit_Thermal("/dev/serial0", 9600, timeout=5)
  File "/home/pi/Python-Thermal-Printer/Adafruit_Thermal.py", line 96, in __init__
    self.wake()
  File "/home/pi/Python-Thermal-Printer/Adafruit_Thermal.py", line 606, in wake
    self.writeBytes(255)
  File "/home/pi/Python-Thermal-Printer/Adafruit_Thermal.py", line 190, in writeBytes
    super(Adafruit_Thermal, self).write(chr(arg))
  File "/home/pi/.local/lib/python3.5/site-packages/serial/serialposix.py", line 532, in write
    d = to_bytes(data)
  File "/home/pi/.local/lib/python3.5/site-packages/serial/serialutil.py", line 63, in to_bytes
    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
TypeError: unicode strings are not supported, please encode to bytes: 'ÿ'
pi@camera1-rpi3:~/Python-Thermal-Printer $ 

Getting the above error logs while running the sudoku image based printer example.
Can you please help me to solve the issue ?
Thanks for the help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions