-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
add command WebGetConfig #13034
add command WebGetConfig #13034
Conversation
I'll merge this but do not announce yet. Let users play with this and see what happens. |
Add command ``WebGetConfig <url>`` if ``#define USE_WEBGETCONFIG`` is enabled to restore/init configuration from external webserver (#13034)
Released! I like it. |
Thanks |
I like this feature and it could be great. Maybe I forgot some options but whenever I save my config from the GUI it's beens saved as "Config_[devicename]_[softwareversion].dmp". Could this be changed so it's more in line with this change? |
For most users using the web GUI to save/restore configuration files, it is much more convenient to have a human readable file name. Lot of options. 😁 |
You could also use existing mechanisms of the DHCP protocol and send the name/path of the config file in the DHCP reply. Just my opinion. |
Most of users doesn't have a DHCP server that allows to configure such feature. My ISP's router doesn't. |
Hey there, 17:27:29.233 CMD: WebGetConfig Is this thing merged and automatically enabled on official builds? |
It is explicitly not enabled in standard precompiled builds, as the first line of the post says:
As the post suggests, the core use case is for use as a command you can include when doing a custom build. "Normal" restore of config is in the web UI. |
Description:
This is a proposal for an optional command WebGetConfig that can be enabled with
#define USE_WEBGETCONFIG
.As the command name suggest, this command can pull a configuration file (DMP) from an HTTP URL.
What can this be used for ?
This can be useful for some form of auto-provisioning with very limited settings in
user_config_override.h
, a new device, or a known device that has been reset, will reconfigured itself from the last known good configuration.Simple
user_config_override.h
:%id% will be replaced by the MAC address which on a brand new unit is the only element to identify the device.
Possible use-case:
reset 1
and the device will reconfigure itself from the last good configuration.The URL could point to a web script (
WebGetConfig http://myserver:8000/tasmota/provision.Php?id=%id%
) that would automate the use of decode-config to build the DMP from a database.Location of this command in
xdrv_01_webserver.ino
makes it dependent toUSE_WEBSERVER
although it is not related to WebServer at all. Someone disabling WebServer could not use it.It could be moved to another module.
What do you think ?
Beside, I also took the opportunity to replace numerical status in
WebSend
(andWebGetConfig
) with anenum WebCmndStatus
.Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass