On 18/12/2019 21:35, Dennis Lee Bieber wrote:
> On Wed, 18 Dec 2019 20:57:34 +0000, RobH <
r...@despammer.com> declaimed the
> following:
>
>
>>
> Okay, if you built micropython, and the test (section 4) runs, I'd
> think the next move would be to follow step 5 to install the micropython
> package.
>
>> It looks like the Adafruit_CircuitPython_SS1327 library can't be
>> installed then, and the micropython-ssd1327-1.0.0 library can't be used
>> due to micropython not being invoked???
>>
> The Adafruit library requires /displayio/ but on Linux the
> adafruit_blinka interface library only provides
>
> """
> This repository contains a selection of packages mirroring the
> CircuitPython API on hosts running micropython. Working code exists to
> emulate the CircuitPython packages;
>
> board - breakout-specific pin identities
> microcontroller - chip-specific pin identities
> digitalio - digital input/output pins, using pin identities from
> board+microcontroller packages
> bitbangio - software-driven interfaces for I2C, SPI
> busio - hardware-driven interfaces for I2C, SPI, UART
> time * - substitute functions monkey-patched to time module
> """
> ... No displayio (nor many of the libraries shown
>
https://circuitpython.readthedocs.io/en/4.x/shared-bindings/index.html )
>
> Micropython requires you to invoke it explicitly:
>
> <pathtobuild>/micropython <script>
>
>> It now seems that the said oled display can't be used with a raspberry
>> pi, as it needs the ssd1327 library.
>>
> I don't have the display to fully illustrate, but...
>
>
https://luma-oled.readthedocs.io/en/latest/install.html and
>
https://luma-oled.readthedocs.io/en/latest/python-usage.html
>
> ... gave me
>
> pi@rpi3bplus-1:~$ sudo apt install python3-dev libfreetype6-dev libjpeg-dev
> build-essential libopenjp2-7 libtiff5
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> build-essential is already the newest version (12.6).
> <SNIP>
> The following NEW packages will be installed:
> libjpeg-dev libjpeg62-turbo-dev
> 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
> Need to get 236 kB of archives.
> After this operation, 543 kB of additional disk space will be used.
> Do you want to continue? [Y/n]
> Get:1
http://raspbian-us.ngc292.space/raspbian buster/main armhf
> <SNIP>
> Setting up libjpeg-dev (1:1.5.2-2) ...
> pi@rpi3bplus-1:~$ pip3 install --upgrade luma.oled
> Collecting luma.oled
> Downloading
>
https://files.pythonhosted.org/packages/fd/70/b03e0cf2040113db644a220d546a9c42907c4884a898722312c83b0f5603/luma.oled-3.3.0-py2.py3-none-any.whl
> Collecting luma.core>=1.12.0 (from luma.oled)
> Downloading
>
https://files.pythonhosted.org/packages/a7/36/f10ac3202221c479bae89e3226e57dcbf31c08f4d9e5743f32e193147a22/luma.core-1.12.0-py2.py3-none-any.whl
> (51kB)
> 100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 61kB 1.0MB/s
> Requirement already satisfied, skipping upgrade: spidev; platform_system ==
> "Linux" in /usr/local/lib/python3.7/dist-packages (from
> luma.core>=1.12.0->luma.oled) (3.4)
> <SNIP>
> Installing collected packages: luma.core, luma.oled
> Successfully installed luma.core-1.12.0 luma.oled-3.3.0
> pi@rpi3bplus-1:~$ python3
> Python 3.7.3 (default, Apr 3 2019, 05:39:12)
> [GCC 8.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from luma.core.interface.serial import i2c, spi
>>>> from luma.core.render import canvas
>>>> from luma.oled.device import ssd1327
>>>>
>
> Looks to me like the display is feasible (the usage page didn't list
> the 1327, but imported 1306, 1309, 1325, 13331, and sh1106 -- I took a
> chance specifying 1327, and it took without error) {I've now uninstalled
> since, as stated, I don't have the display, so why clutter SD card}
>
> Obviously, you'll need to follow the luma.oled API to use the display.
>
>
>
>
Thanks for that.
I already had some of the files installed from a previous attempt.
In the luma.examples/examples folder, I edited the clock.py script to
include:
from luma.core.interface.serial import i2c, spi
from luma.core.render import canvas
from luma.oled.device import ssd1306, ssd1309, ssd1325, ssd1331, sh1106
but edited the last line to just
from luma.oled.device import ssd1327.
When I ran the script :
pi@raspberrypi:~/luma.examples/examples $ python clock.py
Version: luma.oled 3.3.0 (luma.core 1.12.0)
Display: ssd1306
Interface: i2c
Dimensions: 128 x 64
and there was no errors and nothing on the display.