Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/_P036_FrameOLED.ino
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
const int optionValues[] =
{ static_cast<int>(p036_resolution::pix128x64),
static_cast<int>(p036_resolution::pix128x32),
static_cast<int>(p036_resolution::pix64x48) };
static_cast<int>(p036_resolution::pix64x48),
static_cast<int>(p036_resolution::pix72x40) };
OLedFormSizes(F("size"), optionValues, P036_RESOLUTION, true);
}

Expand Down
5 changes: 3 additions & 2 deletions src/src/Helpers/OLed_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void OLedFormSizes(const __FlashStringHelper *id,
const __FlashStringHelper *options3[] = {
F("128x64"),
F("128x32"),
F("64x48") };
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

selector.reloadonchange = reloadOnChange;
selector.addFormSelector(
Expand Down Expand Up @@ -128,4 +129,4 @@ bool OLedI2CAddressCheck(uint8_t function,
}
return success;
}
#endif
#endif
8 changes: 8 additions & 0 deletions src/src/PluginStructs/P036_data_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ constexpr tSizeSettings SizeSettings[] = {
{ 64, 48, 32, // 64x48
3, // max. line count
32, 10 // WiFi indicator
},
{ 72, 40, 28, // 72x40
3, // max. line count
28, 12 // WiFi indicator
}
};

Expand Down Expand Up @@ -1164,6 +1168,8 @@ tIndividualFontSettings P036_data_struct::CalculateIndividualFontSettings(uint8_
break;
case p036_resolution::pix128x32: lSpace = -2;
break;
case p036_resolution::pix72x40: lSpace = -1;
break;
case p036_resolution::pix64x48: lSpace = -1;
break;
}
Expand Down Expand Up @@ -1310,6 +1316,8 @@ tFontSettings P036_data_struct::CalculateFontSettings(uint8_t lDefaultLines) {
break;
case p036_resolution::pix64x48: result.Space = -1;
break;
case p036_resolution::pix72x40: result.Space = -1;
break;
}
iFontIndex = NR_ELEMENTS(FontSizes) - 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/src/PluginStructs/P036_data_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ enum class eHeaderContent : uint8_t {
enum class p036_resolution : uint8_t {
pix128x64 = 0u,
pix128x32 = 1u,
pix64x48 = 2u
Comment thread
TD-er marked this conversation as resolved.
pix64x48 = 2u,
pix72x40 = 3u,
};

enum class ePageScrollSpeed : uint8_t {
Expand Down