My setup is:
Arduino IDE v 1.8.5
Wemos Esp12 module
128x32 oled display
modified the Adafruit_SSD1306.h to select this display.
In the example ssd1306_128x32_i2c.ino, I changed the line "#define OLED_RESET 4" to "#define OLED_RESET 3" for the esp8266.
Compiled and executed the example sketch.
The example runs correctly down to the line of code that starts the text display portion of the example. Then the 8266 will reboot.
So no text gets displayed. It appears to be a bug in the text display part of the plugin. or some incompatibiliy with the latest arduino esp8266 libraries.
Any ideas?
SSD1306 not working on esp8266
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: SSD1306 not working on esp8266
Which module are you using and what are your connections? Have you tried running the code without the module connected?
- JimInWoodstock
- Posts: 4
- Joined: Thu Jul 12, 2018 12:35 pm
Re: SSD1306 not working on esp8266
My ESP8266 module is using pens, 4 and for the I2c. That should have no bearing on this problem since the sketch is working until it starts using the text functions of the library and then the module resets. If there were hookup problems, like using the wrong pins, the sketch would not work at all. For this kind of problem. It's almost a sure thing that there is something wrong with the code as it runs on the 8266. This sketch runs perfectly on the Arduino Pro mini as it should. So if you have an 8266 and want to try it just run the example sketch in the Adafruit SSD1306 library. You will to change the .h files for use another pin for the OLED_RESET. I chose pin 3.
Another way to describe this problem is that the example sketch runs to completion on the Arduino, but does not run to completion on the ESP8266.
Another way to describe this problem is that the example sketch runs to completion on the Arduino, but does not run to completion on the ESP8266.
- JimInWoodstock
- Posts: 4
- Joined: Thu Jul 12, 2018 12:35 pm
Re: SSD1306 not working on esp8266
Problem solved.
I have given up on the Adafruit library and have switched over to the library done by ThingPulse This library works flawlessly and is somewhat easier to use because the API it at a slightly higher level. Furthermore, this library has been recently updated (4 months ago), and the Adafruit library was last updated 2 years ago.
https://github.com/ThingPulse/esp8266-oled-ssd1306
I have given up on the Adafruit library and have switched over to the library done by ThingPulse This library works flawlessly and is somewhat easier to use because the API it at a slightly higher level. Furthermore, this library has been recently updated (4 months ago), and the Adafruit library was last updated 2 years ago.
https://github.com/ThingPulse/esp8266-oled-ssd1306
- adafruit2
- Posts: 22194
- Joined: Fri Mar 11, 2005 7:36 pm
Re: SSD1306 not working on esp8266
the oled code works fine, you probably need to add delays() into your code, the ESP8266 doesnt like it if you dont yield() or delay() every second or so!
- JimInWoodstock
- Posts: 4
- Joined: Thu Jul 12, 2018 12:35 pm
Re: SSD1306 not working on esp8266
This is your example in the library. Should it not run OK with no changes. The example does not start the wifi. The wifi running in the background is usually the reason that the loop code needs delay/yield. So what you are saying is that the example will not run on the 8266 without changes?
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: SSD1306 not working on esp8266
The example code for the display was not written for the ESP8266 so you need to accommodate its differences from AVR chips.
Please be positive and constructive with your questions and comments.