I have two white ESP8266 boards with I2C ssd1306 oled 0.91" display, see picture. On both boards display randomly turns off and not recovered until reset button. Micro is still running? problem is only with display. Have tried two different libraries with the same result so, that is why, thinking it is hardware problem.
Are there any ideas on what could be bad and how to fix?
I've got 4 of those and they work fine, however they were not without problems.
Put a resistor between maybe 1k and 5k between GPIO15 (D8) and ground. Without the resistor it won't always start properly.
I use Adafruit_SSD1306.h library without problems.
I have 2 of them mounted as daughter boards on PCBs providing WiFi access to a PIC, these work without a problem. I have another on breadboard on my desk, which occasionally freezes, especially if I move it around. Left alone it seems to be OK. I can only guess touching it is putting noise on the pins and upsetting it.
Also try 0μ1 capacitors between the 5V pins and ground and the 3V3 pins and ground.
I have a TTGO ESP32 board with a small 240x160 TFT on it.
There are a wide range of ESP32/ESP8266 with mounted OLED/TFT
Yes, I can probably find one that matches the picture in #0
But a real link removes all guesswork.
And if your boards are a bit "sensitive" there is even more reason to specify the exact board.
It also means that we can pinpoint the particular capacitor on the pcb.
david_prentice:
It is ALWAYS wise to post a link to the actual display that you have bought. e.g. Ebay Sale page.
The image is "ok" but I don't want to Google and guess.
Especially when you could have provided a clickable link.
David.
Yes, you are absolutely right! I did not realized it can help another people... Link is below. But to be honest - I've bought it kind of long time ago, around 6 month ago. link
It identifies your item which avoids a list of supplementary questions.
Most importantly. It takes you 10 seconds to copy-paste a link. Which is much easier for you than typing some limited information (that always prompts further questions)
On both boards display randomly turns off and not recovered until reset button.
#2 has good advice. 0u1F means the same as 100nF.
ESP8266 always requires a regular kick. i.e. call to yield()
If you ever find a random crash on ESP8266 you should check this first.
If not sure, post your code. Readers might spot a problem.
Either paste the full sketch or attach a file.
It identifies your item which avoids a list of supplementary questions.
Most importantly. It takes you 10 seconds to copy-paste a link. Which is much easier for you than typing some limited information (that always prompts further questions) #2 has good advice. 0u1F means the same as 100nF.
ESP8266 always requires a regular kick. i.e. call to yield()
If you ever find a random crash on ESP8266 you should check this first.
If not sure, post your code. Readers might spot a problem.
Either paste the full sketch or attach a file.
David.
Yep, will play with caps and resistor, as per PerryBebbington suggestion above.
I do not think there is a reason post code, seems like it is not a software problem because of:
0) code is trivial , just show 1 sec counter there;
two boards like on the picture in original post from the same seller are failed on the same way;
two different codes with different SSD1306 libs are failed on the same way;
another SSD1306 display (128x64) with another ESP8266 board (lolin-12e) with the same code - works with no problem.
read my original post - esp8266 was not crashed, it is still alive, I see it outputs values to the Serial.
PerryBebbington:
I've got 4 of those and they work fine, however they were not without problems.
Put a resistor between maybe 1k and 5k between GPIO15 (D8) and ground. Without the resistor it won't always start properly.
I use Adafruit_SSD1306.h library without problems.
I have 2 of them mounted as daughter boards on PCBs providing WiFi access to a PIC, these work without a problem. I have another on breadboard on my desk, which occasionally freezes, especially if I move it around. Left alone it seems to be OK. I can only guess touching it is putting noise on the pins and upsetting it.
Also try 0μ1 capacitors between the 5V pins and ground and the 3V3 pins and ground.
The first time I ran it the number counted to 9 then the display went the display went blank. I tried with smaller text (text size 1, 2 and 3) and it counted OK.
However, after a few tries I noticed that it would go blank sometimes, while typing this it went blank at 54 with text size 3. The count in the serial monitor continues OK.
Now it's up to 250 without a problem and still going.
Moved setTextSize to setup because you don't need to change it every time you print to the display. Although this has nothing to do with your problem I was a bit suspicious of it at first. No harm in having it where you had it, I was just tidying up before I found the real problem.
Made your delay into a millis() based timer, this is non-blocking. It is really important you understand this as it is fundamental to writing non-blocking, multitasking code.
Moved your test code into a separate function; putting everything in loop() might be OK for simple testing but it soon grows into an unmanageable mess if you don't separate code into functions. You need to learn this too.
I thought I had tried this, but seems like not :-).
I've put voltmeter on the GPIO16 and see constant high level there, +3.3V.
When OLED_RESET configured as -1, GPIO16 is really input with no pullup resistor, so it is floating input.
Confirmed with voltmeter, in this case voltage over there is high after reset, then slowly drifting to low, at some point cause ssd1306 to reset. btw, If to connect 10K pullup resistor from GPIO16 to +3.3V - this preventing pin voltage to goes down and also works :-).
Don't worry that you think you should have realised yourself, we all do it, I do it; stare at obviously wrong code and fail to see what is wrong. Usually sleep helps, but not always.
Don't worry that you think you should have realised yourself, we all do it, I do it; stare at obviously wrong code and fail to see what is wrong. Usually sleep helps, but not always.
yep, a lot of things (technically speaking i have done during sleeping!