-
Notifications
You must be signed in to change notification settings - Fork 308
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
change configuration in normal mode #36
Comments
Firmware names/versions are part of the running sketch, so this is not something you're supposed to change. For the name, why not. And for network settings, this would require a lot of overhead in RAM / network time, as we would need to either spawn a HTTP server in normal mode, or subscribe to new topics to change the config. I don't like this approach. A solution would be to allow the |
Would allowing
|
Yes and no. The sample |
I have a idea, would it be possible to have another file created on the SPFIF and then , device restarted and if that new file exist, the delete the old one, rename the new one and continue booting ? How to give new info is still to be determined. |
Yes it would, but there is no need to, we could simply rewrite the current configuration file, and it would be taken into account at next reboot. So yes, the question is how to actually get the new information. |
ok then, how about doing the same as OTA.. atvertise a config version and have a URL to upload the new version (I don't know how exactly OTA does it). Could be the way to go perhaps ? |
This is the last feature that needs to be designed before we release v2.0.0. Now that there is no limitation on the payload size in the MQTT library, I guess @jpmens's idea is the most straightforward one: just publish the new What do you think? |
Publishing the config to $config retained sounds like a good idea to me |
I agree, so given the following {
"name": "The kitchen light",
"device_id": "kitchen-light",
"wifi": {
"ssid": "Network_1",
"password": "I'm a Wi-Fi password!"
},
"mqtt": {
"host": "192.168.1.10",
"port": 1883,
"base_topic": "devices/",
"auth": true,
"username": "user",
"password": "pass"
},
"ota": {
"enabled": true
}
} We would strip |
Great! In my case I would have an OAUTH2 token as mqtt password and even refresh it remotely from time to time to increase security. I few weeks ago I was wondering about having a pub/private key schema so that I could encrypt/sign data that is stored on mqtt. The key pair would be generated at the device configuration and the private key would never go off the device to avoid disclosure. This way I could be sure about data origin (through device signatures) and crypt secret data (ex.: passwords, sensitive sensor data). The "problem" about security (regarding to "config.json") over mqtt depends on the case. For simple, single user projects, there is no harm putting your wifi password as plain text in a private mqtt, but for greater projects that is bad. As more people uses it, more people will try to break it. +1 Thanks and continue your pursuit for smart simplicity! Flávio Stutz Sent from my iPhone
|
@marvinroger I think all three should be stripped, so wifi.password, mqtt.username and mqtt.password |
Let's strip these tree fields then. @flaviostutz be careful, asymmetric cryptography is way slower than symmetric cryptography. You'd better use public-key crypto only to exchange a symmetric key. Take a look at https://github.com/kaeferfreund/ChaChaPoly_ESP8266 , a recent cipher-suite prety well suited for embedded devices. |
Would it be worth making it so that you can publish a partial configuration to |
@nzbuu totally, and this is needed, as as said above, the credentials will be stripped, so the JSON cannot be a full |
Yay! 🎉 The current configuration is published to Coming in v2. |
…homieiot#36) * This handler will serve a 302 response to a client request for a SPIFFS file if the request comes from the STA side of the ESP network. If the request comes from the AP side then it serves the file from SPIFFS. * corrections. plus readme * Update README.md extra space * move wifi to cpp
It would be nice to change some/all parameters via mqtt in normal mode.
This should be easy for $name, $fwname and $fwversion.
Maybe this would even be possible for wifi (ssid, passphrase, ip, ..) and mqtt settings.
Yes, one could argue that this is dangerous, because the device might become unreachable in case the new configuration is incorrect.
The text was updated successfully, but these errors were encountered: