Skip to content

Add 72x40 display#5546

Open
andbad wants to merge 15 commits into
letscontrolit:megafrom
andbad:andbad-72x40
Open

Add 72x40 display#5546
andbad wants to merge 15 commits into
letscontrolit:megafrom
andbad:andbad-72x40

Conversation

@andbad

@andbad andbad commented May 12, 2026

Copy link
Copy Markdown

I added the 72x40 display for ESP32-C3 dev board like this:
https://emalliab.wordpress.com/2025/02/12/esp32-c3-0-42-oled/

Comment thread src/src/PluginStructs/P036_data_struct.h
@andbad andbad closed this May 12, 2026
@andbad andbad reopened this May 12, 2026
Comment thread src/src/PluginStructs/P036_data_struct.cpp Outdated
@TD-er

TD-er commented May 12, 2026

Copy link
Copy Markdown
Member

I assume you did test it yourself on your board after these last changes?

Comment thread src/src/Helpers/OLed_helper.cpp Outdated
Comment on lines 73 to 75
F("64x48"),
F("72x40") };
FormSelectorOptions selector(NR_ELEMENTS(options3), options3, values);

@tonhuisman tonhuisman May 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the way this is constructed, this will crash when configuring the display configuration in P023, as that plugin won't provide the 4th option value.
I think the number of items to display in the selector will have to be added as a new argument to the function, can default to 3, for 'other plugins using this function', and from P036 a value of 4 should be provided (or the length of the values array, like NR_ELEMENTS(optionValues)).

@tonhuisman tonhuisman May 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, you can change the signature for the function, having const int values[] (also in the .h file), and take the NR_ELEMENTS(values) instead of NR_ELEMENTS(options3), that would be an easier change 😉

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally took some time to try this on actual hardware, and the above suggestion (of course) won't work as C/C++ doesn't allow for a dynamic array as a method argument 🫣 so I introduced an extra argument for the size of the selector-array, that defaults to 3.

Then it does work as intended, without breaking P023, that uses the same size selector function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the diff for the changes that I made. You can place the attached file in the base directory of your repo, and from the VSCode terminal use this command:

git apply PR5546-OLedFormSizes.txt

PR5546-OLedFormSizes.txt
(Github doesn't allow a .diff file, but the content is in the default git diff format)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.
Unfortunately, my environment no longer allows me to properly compile firmware for my hardware (even in the main branch) after I updated to the latest version. This appears to be due to compatibility issues with the ExpressIf platform. I've wasted some time and tokens trying to resolve the issue, but I'm still only halfway there.
But I digress.

Anyway, I applied your changes.
I hope all is well.

By(t)e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: The 00.138 : (256100) Error | FS : Error while reading/writing devsecurity.dat in 2138 in your log is because the devsecurity.dat file doesn't exist yet on your unit, I also don't have it on my test-unit, and see the same message. This is not causing any issues.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I installed previous version of ESPEasy. Anyway, if I install stable version with web-flasher, it works. I can connect to default AP and flash you .bin file. The upgrade completed successfully, but in the serial log i find the same error.
  • I erased all flash in ESPConnect tool (thank you, I didn't know that), then I flashed factory.bin file. No lucky.

@tonhuisman tonhuisman May 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is possible that it's hardware-related.
Do you have another board, preferably from a different manufacturer, or with a different ESP32 chip, to test this build on? I can create that build for you, of course.

NB: The board I've used for testing is this one: https://aliexpress.com/item/1005010315154730.html

NB2: Have you also tried using the latest beta build (without support for this display, of course)?
Available from https://TD-er.nl/ESPEasy/latest/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two boards, both like the one you have. One looks identical, the other has some SMD components (I'm not sure if they're resistors or something) arranged slightly differently.

I tried installing the beta Display-A version on both.
Neither works.

[11:03:58] INIT : Booting version: ESP_Easy_mega_20260520_display_A_ESP32c3_4M316k, (GitHub Actions) HEAD_4978f02 (ESP32 SDK 5.5.4.260518)
[11:03:58] 00.061 : (258864) Info   | INIT : Free RAM:258940
[11:03:58] 00.063 : (258780) Info   | INIT : Manual Reboot #13 - Restart Reason: CPU0: usb uart reset digital core 
[11:03:58] 00.073 : >  
[11:03:58] Build changed!
[11:03:58] 00.129 : (256424) Info   | ESPEasy console using ESPEasySerial
[11:03:58] 00.151 : (256404) Info   | ESPEasy console fallback enabled
[11:03:58] 00.154 : (256236) Error  | FS   : Error while reading/writing security.dat in 2138
[11:03:58] 00.156 : (255960) Error  | FS   : Error while reading/writing security.dat in 2138
[11:03:58] 00.159 : (255932) Error  | FS   : Error while reading/writing devsecurity.dat in 2138
[11:03:58] 00.161 : (256088) Info   | INIT : Check for Priority tasks
[11:03:59] 00.162 : (256088) Info   | INIT : SPI not enabled
[11:03:59] 00.164 : >  
[11:03:59] PID:0
[11:04:00] 00.164 : >  Version:0
[11:04:00] 00.164 : >  INIT : Incorrect PID or version!
[11:04:00] 01.165 : >  RESET: Resetting factory defaults... using default settings
[11:04:00] 02.166 : >  RESET: Warm boot, reset count: 3
[11:04:00] 02.167 : >  RESET: Too many resets, protecting your flash memory (powercycle to solve this)
[11:04:00] 02.178 : (255896) Info   | ESPEasy console using ESPEasySerial
[11:04:00] 02.200 : (255896) Info   | ESPEasy console fallback enabled
[11:04:00] 02.213 : (255896) Info   | ESPEasy console using ESPEasySerial
[11:04:00] 02.235 : (255896) Info   | ESPEasy console fallback enabled
[11:04:01] 03.202 : (255512) Info   | WiFi : Set state from: Disabled to: STA_Scanning timeout: 10000
[11:04:01] 03.304 : (255596) Info   | WiFi: Disconnected. Connected for: 00.000 sec
[11:04:01] 03.303 : (255596) Info   | WIFI : Set WiFi to STA
[11:04:01] 03.312 : (216100) Info   | WIFI_READY
[11:04:03] 03.569 : (213216) Info   | WD   : Uptime 0  FreeMem 213336
[11:04:03] 05.152 : (211348) Info   | SCAN_DONE
[11:04:03] 05.165 : (211952) Info   | WiFi : Set state from: STA_Scanning to: AP_Fallback timeout: 60000
[11:04:03] 05.180 : (208372) Info   | WIFI : AP Mode enabled. SSID: ESPEasy- IP: 0.0.0.0 ch: 1dhcps_start(): could not obtain pcb

[11:04:03] 05.182 : (208000) Error  | WIFI : Failed to enable AP Captive Portal
[11:04:03] 05.184 : (203300) Info   | AP: Disconnected. Connected for: 00.000 sec
[11:04:03] 05.190 : (197496) Info   | Webserver: start

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two boards, both like the one you have. One looks identical, the other has some SMD components (I'm not sure if they're resistors or something) arranged slightly differently.

I tried installing the beta Display-A version on both.
Neither works.

[11:03:58] INIT : Booting version: ESP_Easy_mega_20260520_display_A_ESP32c3_4M316k, (GitHub Actions) HEAD_4978f02 (ESP32 SDK 5.5.4.260518)
[11:03:58] 00.061 : (258864) Info   | INIT : Free RAM:258940
[11:03:58] 00.063 : (258780) Info   | INIT : Manual Reboot #13 - Restart Reason: CPU0: usb uart reset digital core 
[11:03:58] 00.073 : >  
[11:03:58] Build changed!
[11:03:58] 00.129 : (256424) Info   | ESPEasy console using ESPEasySerial
[11:03:58] 00.151 : (256404) Info   | ESPEasy console fallback enabled
[11:03:58] 00.154 : (256236) Error  | FS   : Error while reading/writing security.dat in 2138
[11:03:58] 00.156 : (255960) Error  | FS   : Error while reading/writing security.dat in 2138
[11:03:58] 00.159 : (255932) Error  | FS   : Error while reading/writing devsecurity.dat in 2138
[11:03:58] 00.161 : (256088) Info   | INIT : Check for Priority tasks
[11:03:59] 00.162 : (256088) Info   | INIT : SPI not enabled
[11:03:59] 00.164 : >  
[11:03:59] PID:0
[11:04:00] 00.164 : >  Version:0
[11:04:00] 00.164 : >  INIT : Incorrect PID or version!
[11:04:00] 01.165 : >  RESET: Resetting factory defaults... using default settings
[11:04:00] 02.166 : >  RESET: Warm boot, reset count: 3
[11:04:00] 02.167 : >  RESET: Too many resets, protecting your flash memory (powercycle to solve this)
[11:04:00] 02.178 : (255896) Info   | ESPEasy console using ESPEasySerial
[11:04:00] 02.200 : (255896) Info   | ESPEasy console fallback enabled
[11:04:00] 02.213 : (255896) Info   | ESPEasy console using ESPEasySerial
[11:04:00] 02.235 : (255896) Info   | ESPEasy console fallback enabled
[11:04:01] 03.202 : (255512) Info   | WiFi : Set state from: Disabled to: STA_Scanning timeout: 10000
[11:04:01] 03.304 : (255596) Info   | WiFi: Disconnected. Connected for: 00.000 sec
[11:04:01] 03.303 : (255596) Info   | WIFI : Set WiFi to STA
[11:04:01] 03.312 : (216100) Info   | WIFI_READY
[11:04:03] 03.569 : (213216) Info   | WD   : Uptime 0  FreeMem 213336
[11:04:03] 05.152 : (211348) Info   | SCAN_DONE
[11:04:03] 05.165 : (211952) Info   | WiFi : Set state from: STA_Scanning to: AP_Fallback timeout: 60000
[11:04:03] 05.180 : (208372) Info   | WIFI : AP Mode enabled. SSID: ESPEasy- IP: 0.0.0.0 ch: 1dhcps_start(): could not obtain pcb

[11:04:03] 05.182 : (208000) Error  | WIFI : Failed to enable AP Captive Portal
[11:04:03] 05.184 : (203300) Info   | AP: Disconnected. Connected for: 00.000 sec
[11:04:03] 05.190 : (197496) Info   | Webserver: start

Comment thread src/src/Helpers/OLed_helper.cpp Outdated
@tonhuisman

tonhuisman commented May 23, 2026

Copy link
Copy Markdown
Contributor

There are 2 tasks left to complete this PR:

  • Add your name and a summary of the change to the Changelog in _P036_FrameOLED.ino (use the same style already used, please, newest change on top)
  • Update the docs (a screenshot of Display Size, stored as P036_DisplaySizeOptions.png (case-sensitive filename!), width in pixels: 650, height: as high as needed, with a few pixels margin above and below, the rounded corners are applied by the RTD theme), (current page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants