user_config_override.h can't override the config set in tasmota_configurations.h #22572
-
PROBLEM DESCRIPTIONA clear and concise description of what the problem is. This means if I want to turn off the default implementation of xsns_85_mpu6886.ino I HAVE to modify a low level header file. It seems like it should be possible to fix this by reversing the order of the includes in tasmoata_globals.h so my_user_config.h comes last and therefore wins. REQUESTED INFORMATIONMake sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Configuration output here:
Rules output here:
STATUS 0 output here:
Console output here:
TO REPRODUCESteps to reproduce the behavior: EXPECTED BEHAVIOURA clear and concise description of what you expected to happen. It looks like it might not be as simple as just reversing the order of the includes in tasmota_options.h (since when I did that I got a linker error for something unrelated in berry). SCREENSHOTSIf applicable, add screenshots to help explain your problem. ADDITIONAL CONTEXTAdd any other context about the problem here. (Please, remember to close the issue when the problem has been addressed) |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
You need to define your own firmware setup. See https://tasmota.github.io/docs/Compile-your-build/#defining-multiple-custom-firmwares |
Beta Was this translation helpful? Give feedback.
-
@Jason2866 thanks for the tip on multiple custom firmware, but it too has the same issue. Everything in user_config_override.h gets processed before everything in tasmota_configurations*.h, which means it is impossible to actually override what they (tasmota_configurations*.h) do. You can add things using user_config_override.h, but you can't remove something that tasmota_configurations*.h add, since they are processed later. So it is fine to say won't fix for this issue. I can think of several ways that I can get whatever behavior I want. Since this is open source, I can change whatever I want to get it to do what I want. I filed this issue, since I figured the whole point of user_config_override.h was to make it so I did NOT have to change the underlying code. I also recall Sonoff-Tasmota from the days before user_config_override.h when my_user_config.h was the way to do it (of course, it still has the same problem). Tasmota has gotten a lot more complex (because it does a LOT more than it used to) and the configuration is much more complicated. As long as it generally works, it probably doesn't matter, but it is a lot harder to understand. |
Beta Was this translation helpful? Give feedback.
-
What you have in |
Beta Was this translation helpful? Give feedback.
-
@Frogmore42 Default tasmota32 uses:
While my own tasmota32-barbudor uses:
As |
Beta Was this translation helpful? Give feedback.
-
Thx @barbudor for the explanation. I thought my link is enough. It wasn't ;-) It is wanted to make it not possible to define or undefine some stuff for predefined firmware variants. Adding every define to the variants Tasmota and Tasmota32 is possible. Removing is not. The only way to remove mostly anything is via the way from barbudor described. |
Beta Was this translation helpful? Give feedback.
-
@Jason2866 thanks for the final sentence of your last post. That is not at all clear from the documentation. It also is clear that removing stuff is hard. It also appears that there is no minimal version (that can compile in under a min or two on a decent machine). I wrote the following when this was an issue: I do appreciate the help, so please take these comments in the way they are intended (to help others with similar problems/questions). I have a long history both with Tasmota and C/C++ development (having done the later professionally) so I do know how to get a compiler to do what I want (and not just what I told it to do ;-)). Having been around Tasmota for a long time, I know that I should use I then discover berry (which I had seen before, but didn't have a reason to try it). It even has an example driver with the MPU6886, so just what I need. Since I don't want what I am doing in berry to conflict with what the rest of the code is doing I try and remove the MPU6886. Turns out that is not so easy using what should be the easy way to do it.
So I searched the code to understand WHY this is not working. A quick set of searches reveals the complicated set of includes (listed in the original issue) which makes it impossible to actually override things that are set by Having looked more, your comment helps, since you are probably correct that the better option for me might be to figure out exactly what I want to include and only include that, since the default So I took your advice and did this:
and this:
The log indicates that it did use my special config (since I see the compiler warning, MANY times) but the log also indicates that it compiled a LOT more stuff than I was expecting. Some of that is because the way configs are set up, lots of stuff gets added by default. But, the log also indicates that it compiled:
The good news is that it appears the code for that MPU didn't actually make it to the binary. It didn't save me much time in compiling, so not clear how worthwhile this is. This pretty much highlights the fundamental difference between Tasmota and ESPHome. Tasmota binaries give you everything including several kitchen sinks, while ESPHome gives only what you asked for. Having said that, I did switch the one thing I was using ESPHome for back to Tasmota since I found ESPHome not so reliable and the support for counters in Tasmota got a lot better. I will say that the way options are handled is complicated, luckily most people don't need to use them as the default binaries are generally usable as they are. |
Beta Was this translation helpful? Give feedback.
-
So I spent a little time optimizing build time. Here is where I ended up: in user_config_override.h
and in platformio_tasmota_cenv.ini
That removes about half the libraries and makes compilation much faster. I believe there are more that could be removed. The log indicates that the Adafruit GFX library still got compiled so LVGL might be doing something to get it back. Berry seems to have a dependency on LVGL and it wasn't obvious how to remove it (in 30s or less) so I just left LVGL in there, since I did want berry. So, it is possible to make it faster, but I go back to: the configuration is much too complicated to fit into anybody's head. I don't expect it to change, since Tasmota is WAY down the be everything to everybody path. The cost of that is complexity. Thanks for the help and encouragement in learning how it fits together. I now understand it a bit better. |
Beta Was this translation helpful? Give feedback.
Thx @barbudor for the explanation. I thought my link is enough. It wasn't ;-) It is wanted to make it not possible to define or undefine some stuff for predefined firmware variants. Adding every define to the variants Tasmota and Tasmota32 is possible. Removing is not. The only way to remove mostly anything is via the way from barbudor described.