-
Notifications
You must be signed in to change notification settings - Fork 19
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
All in one Firmware for sensors #47
Comments
Was already thinking about that as well :) Just adding toggles to the webui to enable them. |
Depends on the target audience and how most are using the Project The once with technical affinity won't see the compile options as a problem. The Noob once may have but for them you properly won't have too many variations Though the single compilation could be generated with github-actions and enable people to use the firmware without having to setup platform-io Also restructuring the code so each sensor/feature gets it's own source file(s) and using interfaces/inheritance would increase the maintenance regardless of compilation |
we only have to replace the compiler defines (f.e. use_bme) with simple if conditions. in the ui we only have to add toggles. and the maintenance is the same, because now you have to check each build if it passes. and now we dont have every combination of sensor/boards :) |
Do you already work on it. If not I will put all sensor related tasks in to a separate file. |
I've only migrated the bme and PIR sensor yet. You can work on it, I will integrate my changes after that. |
@14yannick did you work on this already? Otherwise i would start with it. |
14yannick and i already talked about it and we want to create a new branch with this mqtt lib. the sensor part should also moved to a new file. in case of this rewrite we should write the firmware as the suggested all-in-one fw. |
I will push a new branch to work on it. My idea is to put the mqtt and sensor related staff outside the main. Then based on the preference this elements get initialized or not. |
Push done yesterday there is more code for the mqtt stuff that for the whole rest of the app. |
is this the mqtt_rewrite branch? Want to test the new stuff :) |
Yes, it's the right branch :) |
See also my last commit with an URL to flash the build by webserial. I'm also evaluating this esphome port. Adding a sensor there is done by adding three line in the yaml file. Without the hasl of creating variable, setup the sensor, read, expose in mqtt, update, add config settings in the web ui,... But first need to check how reliable it's in esphome. |
I've also flashed my garage door with the espHome version. So far it's working well without issues. At some point i should analyze it though. Upside of espHome is definitely the ability for low-code adaption/extension and easy updates. |
We should add a config for setting the I2S address for the sensor, my BME sensor i just tested used 0x77 instead of the 0x76 that are currently hardcoded |
It would help but it'a never ending story for example I use the env iv who use two addresses. But it's not where I see the main issue. The mqtt part take more then the half of the code. The library is not actively maintained,... Adding a new feature is complicated if you don't now all places to need to adjust. |
I can confirm that the Esphome port is working as intended, I actually have an board from @Tysonpower (with an added DHT22 sensor) running with this Esphome config:
Works great! |
To reduce the different binarys and compilation options, we could integrate all external sensors (bme, sr501 ...) into one firmware without the need of the different pio build envs. The needed memory size fits into the esp.
The user could choose the connected sensor in the ui. a simple check in the loop could enable or disable the sensor data.
What do you think about it @14yannick @Tysonpower @kfroeschl ?
The text was updated successfully, but these errors were encountered: