SSD1306 random noise with multiple libraries

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
npowers
Posts: 2
Joined: Mon Feb 19, 2018 6:24 pm

SSD1306 random noise with multiple libraries

Post by npowers » Mon Feb 19, 2018 6:43 pm

I recently got a 1.3" 128x64 I2C OLED from Aliexpress and was working with it on an Adafruit Feather ESP8266 board. I have loaded up the most recent MicroPython build along with a few variations on the SSD1306 driver library. No matter which library I work with I am getting a bunch of junk on the screen. When I run an lcd.show() command I can see the text I input blink for a brief second in a small blank space. This makes me think I have the wrong display resolution and I have tried multiple but all it seems to do is slightly modify the noise on the screen and the blank area. I had seen some people with similar issues I thought but have not had any luck finding those posts again.

Code:
from machine import Pin,I2C
import ssd1306

i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)

lcd = ssd1306.SSD1306_I2C(128,64,i2c)
lcd.text("Micropython",0,0)
lcd.text("are",24,16)
lcd.text("Awesome",64,24)
lcd.show()

Image Result:
https://imgur.com/ycVivd6

Thanks,
~Nick

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: SSD1306 random noise with multiple libraries

Post by mcauser » Tue Feb 20, 2018 12:34 am

Double check your I2C SCL and SDA are connected to the correct pins.
Try adding a lcd.fill(0) before lcd.text().
Try reducing the freq, or remove the freq in the I2C constructor.

Are you running the latest version of this?
https://github.com/micropython/micropyt ... ssd1306.py

The 1.3" SSD1306 OLEDs are 128x64.

npowers
Posts: 2
Joined: Mon Feb 19, 2018 6:24 pm

Re: SSD1306 random noise with multiple libraries

Post by npowers » Tue Feb 20, 2018 3:33 am

Thanks for the tips. I was about to try them out but managed to plug the power back in backwards, swapped GND and 3.3V. I think I managed to cook the screen. I2C still reports an address, [60], but initializing and writing to the screen results in just blackness. I will need to wait for a replacement to start testing again. I was using the latest SSD1306 driver and also tested with a variant I found posted here recently that supported horizontal scrolling text. Having I2C report an address has me pretty sure the lines were hooked up correctly.

I'll report back once I can get a replacement in place.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 random noise with multiple libraries

Post by pythoncoder » Tue Feb 20, 2018 5:29 am

Have you got pullup resistors on the I2C lines? If the SSD1306 board hasn't got these fitted, fit 10KΩ resistors to 3.3V.

Also try using soft I2C:

Code: Select all

i2c = I2C(-1, scl=Pin(5), sda=Pin(4))
The official driver has been tested on ESP8266 so you should be able to get it working ;)
Peter Hinch
Index to my micropython libraries.

janol
Posts: 14
Joined: Wed Oct 02, 2019 7:52 am

Re: SSD1306 random noise with multiple libraries

Post by janol » Wed Oct 02, 2019 9:09 am

I'm rather new to python, micropython, microcontroller etc but I exprience exactly the same problem as npowers (and the exactly the same screen). Have tried the remedies proposed in this thread. I have also tried to connect the oled screen directly to the raspberry pi (using an example from rototron.info) and only got the same white random noise with a black banner (where I think the test text should go).
I have tested two different ssd1306 screens of different makes (one noticable differrence was the the gnd and power pins were swithed!). I don't know the make of my esp32 board but use pins 22 and 21. I2C Addresses are read fine; I can turn the screen on and off etc (and my bme280 sensor on the i2c works fine)
Was there a solution found already?

janol
Posts: 14
Joined: Wed Oct 02, 2019 7:52 am

Re: SSD1306 random noise with multiple libraries

Post by janol » Wed Oct 02, 2019 7:18 pm

Given that I posted my question under the ESP8622 title, I just wanted to confirm that I get the same problem when I move the setup from the ESP32 board to my ESP8622 (a Nodemcu, using pins 4 and 5 for the I2C).

/Fredrik

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: SSD1306 random noise with multiple libraries

Post by Roberthh » Wed Oct 02, 2019 8:16 pm

Are you sure these are SSD1306 devices. Can you tell us the link at Aliexpress?

janol
Posts: 14
Joined: Wed Oct 02, 2019 7:52 am

Re: SSD1306 random noise with multiple libraries

Post by janol » Thu Oct 03, 2019 9:48 am

I bought it from az-delivery.de (via amazon.de) and according the info on web it is ssd1306 compliant.
/Fredrik

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: SSD1306 random noise with multiple libraries

Post by Roberthh » Thu Oct 03, 2019 10:08 am

The one I see on the Amazon store of AZ-Delivery with 1.3 Inch size use the sh1106 controller. So you might try the another lib, e.g. this one: https://github.com/robert-hh/SH1106

janol
Posts: 14
Joined: Wed Oct 02, 2019 7:52 am

Re: SSD1306 random noise with multiple libraries

Post by janol » Thu Oct 03, 2019 10:19 am

oh, yes, here is link to the oled:
https://www.amazon.de/AZDelivery-Displa ... 264&sr=8-3

It seems that only the narrow black band on top of the screen is considered as the screen (see pic ). I can turn this black or white (blue) with the fill function. Also when playing with the x- and y-coordinates of the text function I can get the narrow band to move down the scrren (although I haven't figured out how my numbers correlated with the changes observed) . Sometimes I can see the parts of the text in this narrow band.

/fredrik
Capture.JPG
Capture.JPG (84.93 KiB) Viewed 5873 times

Post Reply