Problem with luma/core/interface/serial.py
See original GitHub issueSetup: Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/ Raspberry Pi 2 Model B V1.1 (2014) 1.5inch RGB OLED Module (128x128) connected via SPI
Test-Code:
from time import sleep
import RPi.GPIO as GPIO
from luma.core.interface.serial import spi
from luma.core.render import canvas
from luma.oled.device import ssd1327
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
serial = spi(device=0,port=0)
device = ssd1327(serial)
font = ImageFont.truetype("/home/pi/luma.examples/examples/fonts/pixelmix.ttf",12)
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.text((20,40), "Hello World", font=font, fill="white")
draw.text((20,60), 'Cool Stuff', font=font, fill="white")
print("in")
sleep(10)
print("Stop")
Console Output:
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "copyright", "credits" or "license()" for more information.
>>>
====================== RESTART: /home/pi/test_oled3.py ======================
Warning (from warnings module):
File "/home/pi/.local/lib/python3.5/site-packages/luma/core/interface/serial.py", line 164
self._gpio.setup(pin, self._gpio.OUT)
RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
in
Stop
>>>
It leans on your example from the link below: https://luma-oled.readthedocs.io/en/latest/python-usage.html If i run the code oled shows nothing.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[SOLVED] ZeroSeg 7-segment display not working after ...
I ran rpi-update and rebooted. Unfortunately, my time/date code returns the same error as reported above. FWIW, the ZeroSeg code library ( ...
Read more >luma.core.error.DeviceNotFoundError: SPI device not found
You have to make sure the SPI is enabled on your Raspberry Pi. To do this, type sudo raspi-config to your console, select...
Read more >luma.core.error.DeviceNotFoundError: SPI device not found
The error is indicated in the traceback. Python wants to connect to SPI bus 0, channel 0. SPI bus 0, channel 0 does...
Read more >luma.core — Luma.Core: SBC display drivers 2.4.0 ...
Version Description Date
2.3.2 Only import smbus2 if no bus is provided 2021/09/25
2.3.1 Add Github publish action 2021/03/08
2.3.0 Cleanup only GPIO pins used rather...
Read more >Can't seem to get audio input going with FX demo - Hardware
I get an error, which I searched for here but didn't get a hit. ... File “/usr/lib/python3.8/site-packages/luma/core/interface/serial.py”, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, you got it. You are right, its an ssd1351. That was the problem. I’ve picked the false datasheet of the 1.5inch OLED Module. Now it works. Thanks you! I’m sorry that I took your time.
What makes you think the RGB device connected over SPI you have is actually an SSD1327? The only SSD1327 I have seen is a greyscale device over I2C.
Where did you buy the device from ? … please provide a link!
Are you sure it isn’t an SSD1351 ?