Closed craver2000 closed 6 years ago
Looking at the pictures, it almost certainly looks like something else is emitting data on the same SPI channel.
The fact that you see the warning
/usr/local/lib/python2.7/dist-packages/luma/core/interface/serial.py:164: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(pin, self._gpio.OUT)
indicates that there is another program sharing at least one GPIO pin.
Things I would look at to try and isolate the problem:
--spi-device=1
Thanks for the suggestions. I change the CS to CE1 first but that first did not help. Then, I loaded an early raspbian backup image into the SD card and reinstalled the library, and the demo scripts ran properly this time! While I still have that same runtime warning of potential pin clash, I no longer have the flickering, clipping or artifactual display any more. I tested a couple of scripts and they are running very well. Upon investigating further, I realized that the conflict is caused by an installation of a library for a phat board quite a long time ago, which is no longer used now. Would it be possible for me to resolder the DC connection of the OLED to another pin, say BCM 0 (instead of BCM24), and then I run the demo with --gpio-data-command 0
to avoid the pin conflict?
Ok, just tried using BCM20 for DC and it works!
Glad you got it sorted 👍
Hi, I am having some problems with using the library with my 128x128 SSD1351 display(16-bit Color 1.5" -https://www.adafruit.com/product/1431) on my Rapsberry Pi 3.
For instance, I get distorted or clipped display with
demo.py
initially. I then tried to change the SPI bus speed settings from 500000 through to 16000000 which seemed to help withdemo.py
at speed 16000000 by enabling a full frame display but it did not significantly improve the display when I ran other example scripts. Examples scripts likerunner.py
fail to work after a spilt second of flicker on the display, and likewise foranimated_gif.py
. For3d_box.py
, I get speckled pixels instead of a clean display during the animation. Any ideas how I can resolve this? I have attached some screenshots of the display when these scripts are launched. I tested these by running the following command on terminal (and changing SPI speeds and script name each time):pi@raspberrypi:~/luma.examples $ python examples/demo.py --display ssd1351 --width 128 --height 128 --interface spi --spi-bus-speed 8000000
In terms of hardware connections, I used the SPI connections as described in http://luma-oled.readthedocs.io/en/latest/hardware.html.Display screenshots: Clipped display of demo.py at default SPI speed setting
Clipped and distorted display of demo.py when running at lower SPI setting
Distorted crawl.py display
Artifacts on 3d_box animation
Artifacts on 3d_box animation
Blue fuzzy artifactual display when running bounce.py
Four bright blue pixel dots when colors.py is launched.
Distorted clock.py display
Terminal states the following when I run my scripts:
But I have also checked and ensured that none of my phat boards or scripts are using the pins that Luma OLED library depends on. Please could anyone advise on this matter, thanks!