Closed gnbl closed 6 years ago
pip3 show pillow
?echo $LANG
?[I have a sneaking suspicion it is down to a pillow version mismatch, as I have seen something similar before]
fyi, you can just use $ python3 bounce.py -f conf/ssd1322.conf
and it will load in the config settings from the file. You can of course specify extra params after the -f flag, and they will overwrite the loaded in ones.
pi@raspberry:~/luma.examples/examples $ pip3 show pillow
Name: Pillow
Version: 4.3.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: aclark@***.net
License: Standard PIL License
Location: /usr/local/lib/python3.5/dist-packages
Requires: olefile
pi@raspberry:~/luma.examples/examples $ echo $LANG
en_GB.UTF-8
Thanks for the hint. Where did you get the SSD1322 init values? They seem to differ a bit from the few manufacturer's examples.
Ok, so you have the latest pillow, so we can scratch that idea. If you don't explicitly specify a font, it should default to pillow's default bitmapped font. Like you say, maybe this is missing on your strech-lite distro. I will get hold of that and have a look.
The init sequence would've been initially based off of what looked relevant in the datasheet (see https://luma-oled.readthedocs.io/en/latest/_downloads/SSD1322.pdf), then -erm- some not-insignificant tinkering on my part. Broadly, they should have the same commands, but some of the data fields may well have diverged.
The default font is hardcoded:
and does not contain information about itself:
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image, ImageDraw, ImageFont
>>> im = Image.new("RGB", (100,100))
>>> draw = ImageDraw.Draw(im)
>>> f=draw.getfont()
>>> f.info
[]
>>> f.file
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'ImageFont' object has no attribute 'file'
I haven't looked into where/why getmask
fails.
If anyone wanted to tweak display parameters for these panels: Newhaven, Eastrising and Densitron provide example code and/or init sequences in their display/module datasheets that are quite similar (either copied or from the same source?).
Can you try with an older pillow version?
If you could give me pointers on how to selectively use an older version (which?), I'll give it a try.
pip install Pillow==4.2.0
This would overwrite the current version. Sorry, changed my mind.
@gnbl did you sort it out? can this be closed?
Whatever
I don't like your attitude @gnbl.
Hi again, I encountered another minor problem when playing with the examples. I just noticed that I might be running
2017-08-16-raspbian-stretch-lite
which might explain some missing dependencies .. or missing fonts...The problem
One of the first search hits suggests that a Unicode-capable font is required (but I did not research further, so it may be another cause), and here's my path to resolving it at the examples source (in the logical order):
Find out what fonts can be used
Use one of these in the example:
Quick search shows font setting only in:
On the other hand,
greyscale.py
also renders text but does not show this issue.Sorry I can't pinpoint this further.