SSD1306 random noise with multiple libraries
SSD1306 random noise with multiple libraries
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
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
Re: SSD1306 random noise with multiple libraries
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.
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.
Re: SSD1306 random noise with multiple libraries
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.
I'll report back once I can get a replacement in place.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SSD1306 random noise with multiple libraries
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:
The official driver has been tested on ESP8266 so you should be able to get it working
Also try using soft I2C:
Code: Select all
i2c = I2C(-1, scl=Pin(5), sda=Pin(4))
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: SSD1306 random noise with multiple libraries
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?
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?
Re: SSD1306 random noise with multiple libraries
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
/Fredrik
Re: SSD1306 random noise with multiple libraries
Are you sure these are SSD1306 devices. Can you tell us the link at Aliexpress?
Re: SSD1306 random noise with multiple libraries
I bought it from az-delivery.de (via amazon.de) and according the info on web it is ssd1306 compliant.
/Fredrik
/Fredrik
Re: SSD1306 random noise with multiple libraries
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
Re: SSD1306 random noise with multiple libraries
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
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