My display won't turn on. ESP8266/ SSD1306 (SPI 128x64)

Hello,

Here is the continuation of the manufacture of the lamp for my niece.
I had a discussion with my sister and given that the lamp is for a child, it would be preferable to have an interface that is not exclusively on the phone.
This is why, taking advantage of the usermod preinstalled on the Aircookie .bin, I connected an OLED screen and configured the pins in the WLED preferences.
However, the screen does not turn on.
I restarted the esp8266, tried between 5v and 3.3v, used different GPIOs.
I checked with another same screen.

Maybe the bin i chose isn’t made with alt version of the 4Linedisplay.
How can i see the code of the .bin?

Can anyone help me?

THANKS

In the meantime I’m trying to set up a custom .bin with rotary and 4linedisplay I get an error message which I haven’t seen yet and google searches aren’t helping much.

This is the message :

Linking .pio\build\nodemcuv2\firmware.elf
c:/users/homepc/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\nodemcuv2\firmware.elf section .text1' will not fit in region iram1_0_seg’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nodemcuv2\firmware.elf] Error 1 <

Thanks

You need to add these 3 line to your build environment PIO build_flags:

  -D USERMOD_FOUR_LINE_DISPLAY
  -D USERMOD_ROTARY_ENCODER_UI
  -D USE_ALT_DISPlAY

and update lib_deps to include U8x8 library:

  olikraus/U8g2
  Wire

Or use pre-compiled binaries from @srg74 Github repository.

Hello Blazoncek and thank you for responding.

I did what you advised me and (maybe I did it wrong) but nothing changes, still the same error.
I attach my platformio.overide.
Do I need to modify other files (usermodlist?) or platformio is enough?

[platformio]
default_envs = nodemcuv2
; default_envs = esp32dev

[env:nodemcuv2]
board = nodemcuv2
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D WLED_RELEASE_NAME=ESP8266 #-DWLED_DISABLE_2D
-D USERMOD_FOUR_LINE_DISPLAY -D FLD_PIN_SCL=5 -D FLD_PIN_SDA=4
-D USERMOD_ROTARY_ENCODER_UI -D ENCODER_DT_PIN=12 -D ENCODER_CLK_PIN=14 -D ENCODER_SW_PIN=13
-D USERMOD_AUTO_SAVE -D AUTOSAVE_PRESET_NUM=1
-D LEDPIN=3 -D BTNPIN=0
lib_deps = ${esp8266.lib_deps}
monitor_filters = esp8266_exception_decoder

[env:esp32dev]
board = esp32dev
platform = espressif32@3.2
build_unflags = ${common.build_unflags}
build_flags =
${common.build_flags_esp32}
-D USERMOD_MODE_SORT
-D USERMOD_FOUR_LINE_DISPLAY -D FLD_PIN_SCL=22 -D FLD_PIN_SDA=21
-D USERMOD_ROTARY_ENCODER_UI -D ENCODER_DT_PIN=18 -D ENCODER_CLK_PIN=5 -D ENCODER_SW_PIN=19
-D USERMOD_AUTO_SAVE -D AUTOSAVE_PRESET_NUM=1
-D LEDPIN=16 -D BTNPIN=13
upload_speed = 460800
lib_ignore =
ESPAsyncTCP
ESPAsyncUDP

[env:d1_mini]
board = d1_mini
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
upload_speed = 460800
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags =
${common.build_flags_esp8266}
-D USERMOD_FOUR_LINE_DISPLAY
-D USERMOD_ROTARY_ENCODER_UI
-D USE_ALT_DISPlAY
monitor_filters = esp8266_exception_decoder

[env]
lib_deps =
fastled/FastLED @ 3.5.0
NeoPixelBus @ 2.6.0
ESPAsyncTCP @ 1.2.2
ESPAsyncUDP
AsyncTCP @ 1.0.3
IRremoteESP8266 @ 2.7.3
GitHub - lorol/LITTLEFS: LittleFS library for arduino-esp32
GitHub - Aircoookie/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32 @ ~2.0.0
olikraus/U8g2
Wire

THANKS

bin file is available here WLED-wemos-shield/WLED_0.14.0-b2_esp8266_display_rotary.bin at master · srg74/WLED-wemos-shield · GitHub

Hey Srg74, thank you for taking the time to respond.
It seems to me that I have already tried with this bin, precisely on the subject that I posted and nothing happens. The encoder works very well (a few bounces anyway) but the screen does not light up. I will still try to reflash.

Well, I just flashed again with this .bin and it’s the same thing.
The encoder works perfectly but the screen does not light up.
In the settings I see that both usermods are activated.
I tried different pins, different screen types. Here is a screenshot of the settings.


Capture d'écran 2023-04-28 080017

You didn’t set SPI pins. Depends on your display it must be set accordingly. Post a picture of your display.


This one

You should put clock pin 5 and data pin 4 and choose I2C display not SPI.

1 Like

Thank you very much,
it was the type of screen that was the problem.
It works now, it’s beautiful !
I’ll post the result when finished.