-->
Page 1 of 2

u8g2 and ssd1306

PostPosted: Mon Oct 15, 2018 7:12 pm
by Tom Park
I've been flailing with a tiny ssd1306 display for the ESP8266 and have run into a hurdle that I don't understand. There are tons of examples using the outdated u8g, and lots of examples using Arduino, but precious few for u8g2 and LUA. When I attempt to initialize the display using:
disp = u8g2.ssd1306_i2c_128x64_noname(id,sla) --id=0, sla=0x3c
I get the error:
attempt to call field 'ssd1306_i2c_128x64_noname' (a nil value)
In the u8g2 documentation it says:
Add the desired entries to the I2C or SPI display tables in app/include/u8g2_displays.h.
This sounds like something that must be done when the firmware is built...otherwise, where is the app/include/u8g2_displays.h directory? Is it safe to assume that this happened when the firmware was built (using Marcel Stoer's handy site) since I specified the ssd1306 info? If so, any idea why I'm getting the nil value?

Re: u8g2 and ssd1306

PostPosted: Tue Oct 16, 2018 5:03 pm
by Tom Park
Discussing the identical issue on github FrankXO said:
-----------------
... judging from the response ('ssd1306_i2c_64x48_er' (a nil value)), this suggests your firmware does not contain the mentioned driver.
Please check your u8g2_displays.h file: is it added to #define U8G2_DISPLAY_TABLE_I2C ?
----------------
The firmware was built using the NodeMCU custom build web site. How do I check the u8g2_displays.h file? Where is it? I was assuming that #define U8G2_DISPLAY_TABLE_I2C was added during the build since I specified ssd1306_i2c_noname. How can I check to see if it's actually included in the firmware?
Tom

Re: u8g2 and ssd1306

PostPosted: Wed Oct 17, 2018 11:30 am
by Tom Park
I requested a new build, reflashed, and now all is well. Mysterious. But all's well that ends well I guess.
Tom

Re: u8g2 and ssd1306

PostPosted: Wed Oct 17, 2018 12:51 pm
by marcelstoer
Would have been interesting to know if a reflash of the previous binary would have helped, too.