-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Bug in determine index of Plugin_ptr #2676
Comments
So perhaps that's why I experienced a device change from IRTX to Switch recently after replacing the ESP_Easy firmware with custom build without IRTX plugin while keeping the config... :-) |
The bug appears to be quite old, so not sure what big jump you made in versions? Also I am already working on some refactoring of the code to make the naming of variables a bit more descriptive since I also got rather confused by them. |
…#2676) See letscontrolit#2676 The use of DeviceIndex was not consistent, which may lead to strange issues. DeviceIndex is the translation between the vector of included plugins and IDs of plugins available.
Well, the config was very old and a many firmware upgrades performed during last 2 years on that node... In past both IRRX and IRTX were in std or test official builds but it's not the case anymore so I had to start with custom builds using Vagrant (btw. many thanks for preparing that great environment!). As I need a lot of plugins and the current IRRX and IRTX plugins are so big, I disabled the IRTX as IRRX is more important for me but the config remained the same when I uploaded the customized firmware to node. Then the IRTX (device 11) changed to Switch. |
Yep, if a plugin cannot be found, it will set it to the first one. The size of IR plugins is what made me decide to move them to a separate build. |
Also fixing a long lasting annoyance along the way. This is how it will look after this has been fixed: The plugin ID will be shown and the name. Enabled state will be shown as disabled and the rest will be left empty. |
Found a very, very serious bug in the __Plugin.ino code and it looks like I introduced it around 20180705. See: 2fde3d2
Problem is in the handling of some functions like PLUGIN_xxx (WRITE/READ/etc)
It is then using the wrong index to do stuff, which may yield strange results on builds with not all plugins included (mainly test and custom)
Impact is a bit hard to predict, but I guess it may lead to strange crashes.
That's also around the time when WDT reboots started to be reported.
So when fixed, it may hopefully fix a number of issues.
Plugin_ptr will only use indices based on the number of plugins included in the build.
So it must be addressed using an index based on the DeviceIndex (not sure if that's the right index) and not on the plugin ID number (e.g. 004 for Dallas sensor)
The text was updated successfully, but these errors were encountered: