0

PiOLED 128x32 displays dots, no text
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PiOLED 128x32 displays dots, no text

by slclarktx on Fri Aug 02, 2019 2:53 pm

Huge thanks to Adafruit for awesome hardware, software, tutorials, and forum to help us lesser microprocessor oriented folks build neat projects.

That said I cannot get my 128x32 I2C OLED display to work with a Raspberry Pi (3, 4, or 0). As shown in the picture below all I get are dots.
I have followed the tutorial for PiOLED to run the stats.py program and just get dots. I did install Circuit Python and the listed modules.
I also followed the LoRa with OLED tutorial, installed listed modules and ran rfm9x_check.py with same result. LoRa on Raspberry Pi is my initial interest.
After reviewing the forums I found that the font5x8.bin file may be an issue so I downloaded that again using the listed weget command. Still have the same dotted display. I noted the framebuf file may be an issue but do not have enough information to reload another version.
I have 2 128x32 OLED boards and both behave the same.

I have wired the display to an Arduino, followed a tutorial for that and the display works great. Raining Adafruit flowers.

Please help me get the board working on a Raspberry Pi. If for no other reason than to understand what is not working.
Attachments
IMG_2306_01.jpg
IMG_2306_01.jpg (136.04 KiB) Viewed 164 times

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Fri Aug 02, 2019 3:14 pm

Did it show up with an i2cdetect scan?
https://learn.adafruit.com/adafruit-pio ... le-i2c-2-9

Also, your USB cable is going into the USB OTG port, not the USB power port. Is that intentional?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Fri Aug 02, 2019 5:16 pm

Yes, it shows up on i2c scam with correct address. The pi0 is set up as Ethernet gadget, I get the same display with raspberry pi 3 and 4 with normal power, display, and keyboard connected.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Fri Aug 02, 2019 5:23 pm

One difference between Arduino (which works) and RPi (which doesn’t work), the Arduino includes RST connection. Would that make a difference?

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Fri Aug 02, 2019 5:34 pm

Maybe. First, let's back up and try a simpler example. Try running this one from the library:
https://github.com/adafruit/Adafruit_Ci ... pletest.py

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Fri Aug 02, 2019 6:25 pm

The OLED just shows dots again after running ss1306_simpletest.py. To create the file I copied the raw text from the link you sent and used nano to create the file on my Pi0. The folder includes font5x8.bin.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Tue Aug 06, 2019 7:41 am

Thanks for your help, any more suggestions to solve this problems?

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Tue Aug 06, 2019 10:47 am

Let's double check the connections. It seems like it should be OK since you were able to see the addresses with i2cdetect. But can you post photos showing the solder job on the OLEDs:
soldering.jpg
soldering.jpg (10.97 KiB) Viewed 89 times


Also, is the header on the Pi Zero soldered on? Or is it one of those solderless hammer style headers?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Tue Aug 06, 2019 11:19 am

The Pi0 header is soldered, the Pi3 and Pi4 headers were pre-installed and have the same result.

download/file.php?mode=view&id=69305
Attachments
IMG_2312.jpg
IMG_2312.jpg (153.84 KiB) Viewed 85 times
IMG_2312.jpg
IMG_2312.jpg (153.84 KiB) Viewed 85 times

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Tue Aug 06, 2019 11:20 am

This board does work when attached to an Arduino.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Tue Aug 06, 2019 12:38 pm

Thanks. That looks good. Let's try your idea about the reset pin. Go ahead and wire it up. The driver has it:
https://github.com/adafruit/Adafruit_Ci ... 306.py#L68
so change:
Code: Select all | TOGGLE FULL SIZE
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)

to something like:
Code: Select all | TOGGLE FULL SIZE
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Tue Aug 06, 2019 4:28 pm

Okay, I tried the line you listed and ran into several errors. After some research and examples I imported board and digitalio. I am quite new at Python but eventually got the modified program to run without errors. Then I plugged in the OLED with reset, ran the program and got an error message that there was no i2c device! Ran i2c device check and sure enough, no device. So I unplugged the reset wire and tried the display program again. I'm using "stats.py" modified with a reset command but not connected.

The display worked as it is supposed to!

I connected the second OLED, ran the program without a reset wire and got the same garbage display as originally. So I connected the reset wire, ran stats.py with reset commands, and got the same no i2c device. So I disconnected the reset wire and ran stats.py program again. Now the second OLED is working.

So, both OLEDs are working as they should, for now, and I have absolutely no idea why. It appears something may have been off around the OLED reset, but ???
----------------------------------------------------------------------
Here are the changes I made, remember I'm quite new at Python
Code: Select all | TOGGLE FULL SIZE
import time
import subprocess
import board                <----me
import digitalio             <----me
 
from board import SCL, SDA
import busio
from PIL import Image, ImageDraw, ImageFont
import adafruit_ssd1306
reset = digitalio.DigitalInOut(board.D23)                    <----------me
reset.direction = digital.Direction.OUTPUT                    <----------me
 
# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)
 
# Create the SSD1306 OLED class.
# The first two parameters are the pixel width and pixel height.  Change these
# to the right size for your display!
reset.value = False                    <----------me, I had read the reset was to go low for the OLED
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
Last edited by adafruit_support_carter on Tue Aug 06, 2019 4:30 pm, edited 1 time in total.
Reason: added [code] tags

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Tue Aug 06, 2019 4:35 pm

You'll need the board import, this line:
Code: Select all | TOGGLE FULL SIZE
import board

but you shouldn't need digitalio and manually setting up the reset pin. You should be able to just pass it in to the SSD1306 setup like this:
Code: Select all | TOGGLE FULL SIZE
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)

and the driver will take care of setting up the pin for output, etc.

It sounds like the reset was needed. In your other attempts where you were removing the wire, you may have reset it manually. A reset is nothing more than pulling that pin low. And then once it was reset, it started working OK.

So you really only need one additional wire, going from reset on the display to a free digital IO pin on the Pi (I just randomly picked 23). If you set that all up and then try creating the SSD1306 object with a reset= parameter like above, does it still not work?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Tue Aug 06, 2019 5:02 pm

Display is back to garbage when I try to use it with rfm9x_check.py and the LoRa module.
Also I realized I did not follow your instructions so will give that a try, later.
Thanks for your help, it's really appreciated.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Wed Aug 07, 2019 8:19 am

I changed "stats.py" as you described in the last post and got the following response.

pi@pi002:~ $ python3 stats_01.py
Traceback (most recent call last):
File "stats_01.py", line 43, in <module>
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)
File "/usr/local/lib/python3.7/dist-packages/adafruit_ssd1306.py", line 184, in __init__
external_vcc=external_vcc, reset=reset)
File "/usr/local/lib/python3.7/dist-packages/adafruit_ssd1306.py", line 76, in __init__
self.reset_pin.switch_to_output(value=0)
AttributeError: 'Pin' object has no attribute 'switch_to_output'

Not sure what that means.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Please be positive and constructive with your questions and comments.