So I built something from scratch and it was pretty painful.
And then I found out they have a fully working one. Works like a charm.
Uses I2C and not SPI, but the difference is only one initialization call: disp = u8g.ssd1306_64x48_i2c(sla) replace with the corresponding spi call. And you need to set up SPI of course.
http://www.wemos.cc/Products/oled_shield.html
NodeMCU custom build by frightanic.com
branch: dev
commit: 5e01b51123e3bc8344627a23602147de9b01be45
SSL: false
modules: bit,file,gpio,net,node,spi,tmr,u8g,uart,wifi
build built on: 2016-08-21 21:20
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
> PANIC: unprotected error in call to Lua API (app.lua:6: attempt to call field 'ssd1306_128x64_spi' (a nil value))
My init.lua looks like this: http://pastebin.com/UNVM3Ypu
mfny wrote:PANIC: unprotected error in call to Lua API (app.lua:6: attempt to call field 'ssd1306_128x64_spi' (a nil value))
ssd1306_128x64_spi references the specific OLED display. Make sure you include the correct driver when you build the firmware. Also, as per https://nodemcu.readthedocs.io/en/dev/e ... ay-drivers it should be u8g.ssd1306_128x64_hw_spi() (note the extra 'hw_').