MI32 legacy: add mi32name, small fixes #19619
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Add command
mi32name
to better handle unknown/new sensors.Usage:
mi32name<slot> <new name>
, where slot is the position of the observed sensor in the the internal array (reflected in the order of the sensors afterstatus 8
) starting with 0.mi32name<slot>
will delete the overridden sensor name and use the built-in one.When an unknown sensor gets a name, the command
mi32cfg
will write this to the driver config. It could be changed in the mi32cfg-file too, as this is a JSON.An unknown sensor will "learn" its features over time with every received data packet. When all features have been learned, the command
mi32cfg
will save this feature descriptor in the mi32cfg-file. It is mandatory to give these sensors a name before.Adds MAC to every MQTT message, as with overridden names, the automatically suffixed OUI of the MAC for built-in names will not be there
Use fetch instead of XMLHttpRequest in the embedded web dashboard JS code
Reduce the traffic of the embedded dashboard by relaxing the update interval in order to slightly improve the currently observed memory leak of the webserver under Arduino 3.0. This bug will reduce the free heap after each fetch/XMLHttpRequest until there is not enough of it. The the system will likely slow down after awhile and later recover "automagically" as if there is some kind of garbage collection in the background. Did not find the exact reason yet.
Better handle the slightly changed API of esp-nimble-cpp to catch more sensor messages
minor refactoring
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass