-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved issue https://github.com/letscontrolit/ESPEasy/issues/1844; #183
base: master
Are you sure you want to change the base?
Conversation
Update _P208_Nokia_LCD_5110.ino Resolved issue that could cause esp-easy-weblog stops working. code optimizations based on reviewers comments.
_P208_Nokia_LCD_5110.ino
Outdated
//} | ||
void myLog(const String & message) { | ||
String log; | ||
if (sentlog){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The order of these 2 lines could be swapped
- You could also check in the if wether the log-level is set (when compiling against a current ESPEasy mega):
if (sentlog && logLevelActiveFor(LOG_LEVEL_INFO)) {
that would save a few cpu cycles and a bit of memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can not use the current ESPmega (ESPEasy-mega-20220328) because of build errors......
I'm using ESPEasy_ESP32_mega-20211224 without build errors....
log.reserve(message.length() + 6); | ||
log += F("P208: "); | ||
log += message; | ||
addLog(LOG_LEVEL_INFO, log); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when compiling on current mega
branch, please use addLogMove
macro when appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can not use the current ESPmega (ESPEasy-mega-20220328) because of build errors......
I'm using ESPEasy_ESP32_mega-20211224 without build errors....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What build errors do you have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to replay the scenario you have most likely taken:
- Downloaded the ESPEasy-20220328 sources zip-file from the Releases page
- Unzipped that file using the 7-zip tool (I always avoid using the Windows explorer .zip extracter, as that thing has been dangerously broken since the first ever release around Windows XP!)
- Got the
_P208_Nokia_LCD_5110.ino
from this PR - Opened the unzipped folder using VSCode with PlatformIO installed
- Added
Adafruit PCD8544 Nokia 5110 LCD library
tolib_deps
in bothplatformio_esp32_envs.ini
andplatformio_esp82xx_base.ini
(don't forget to add a comma after the last entry already there) - Added
#define USES_P208
to the#ifdef PLUGIN_BUILD_NORMAL
section ofdefine_plugin_sets.h
to include the plugin (a bit hacky, I know 👼) - Clicked Build for the
normal_ESP8266_4M1M
PIO configuration: successful on first execution - Clicked Build for the
normal_ESP32_4M316k
PIO configuration: successful after a few retries (PIO is known to sometimes have issues when switching configuration like this)
Not sure what the difference is with what you did, but it should be mostly the same, possibly you unpacked the sources-zip using the default Windows tool?
Well, I tried to build a clean ESPEasy-20220328 (without _P208).
I added "Adafruit PCD8544 Nokia 5110 LCD library" to lib_deps in both platformio_esp32_envs.ini and platformio_esp82xx_base.ini
Build the normal_ESP8266_4M1M PIO configuration: successful on first execution
Build the normal_ESP32_4M316k PIO configuration: no success even after several retries ....
Build the custom_ESP32_4M316k PIO configuration: no success even after several retries ....
|
changes made as a result of review comments
_P208_Nokia_LCD_5110.ino
Outdated
@@ -2,6 +2,7 @@ | |||
//################################## Plugin 208: NOKIA 5110 lcd ######################################### | |||
//####################################################################################################### | |||
#include "_Plugin_Helper.h" | |||
#include<string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this include is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right. This is not needed
@JoostDkr I have reserved Plugin ID [P141] in the ESPEasy mega repository to migrate/rewrite this plugin. (and assigned the task to me 😃) It will be a rewrite because we prefer to use the generic ESPEasy AdafruitGFX Helper for all displays that extend the AdafruitGFX library, to have a uniform command structure for all displays, reduce code-size (it is instantiated, not #included), and thus reduce maintenance effort. And any feature implemented in the helper is immediately available for all displays (when applicable, of course). I will add a new subcommand Effectively that would be something like:
But could be simplified to: |
@tonhuisman , |
That's supposed to address line 1, like the current plugin behavior that you extended: (Or maybe that was already there, didn't investigate that far) |
That's my current default for plugin development 😎, biggest challenge, at least on ESP8266, is having enough free GPIO pins and memory to hold all plugin instances 😉 |
I've created a PR: letscontrolit/ESPEasy#4211 |
Also a checkbox is added to the device-webform for switching on/off sending debug/info-log to EASpeasy-log