diff --git a/ampel-firmware/config.public.h b/ampel-firmware/config.public.h index a6fbaf7ed83a85f7e841fa6c146f432639718fa7..bcc65e9304ebc2756de87200800bc0b0484090dd 100644 --- a/ampel-firmware/config.public.h +++ b/ampel-firmware/config.public.h @@ -14,7 +14,14 @@ // This file is a config template, and can be copied to config.h. // Please don't save any important password in this template. -// NOTE: Every parameter can be modified and saved later via the web-config. + +// IMPORTANT: Parameters defined in config.h are only default values, and are applied if: +// * the ampel is flashed for the first time +// * or 'reset_config' command is called +// * or AMPEL_CONFIG_VERSION has been changed. + +// Once those default values have been applied, uploading the firmware with a modified config.h will not update the ampel configuration! +// Every parameter can be modified and saved later via the web-config. // Some of those parameters can also be modified via commands in the Serial monitor : // e.g. 'wifi 0' to turn WiFi off, or 'csv 60' to log data in csv every minute. @@ -33,6 +40,12 @@ // In order to be set successfully, it should have at least 8 characters. # define AMPEL_PASSWORD "" +// AMPEL_CONFIG_VERSION should be defined, and have exactly 3 characters. +// If you modify this string, every parameter saved on the Ampel will be replaced by the ones in config.h. +// AMPEL_CONFIG_VERSION should also be updated if the configuration structure is modified. +// The structure of the Ampel configuration has been modified 10 times, so it's called "a10" for now. +# define AMPEL_CONFIG_VERSION "a10" + /** * SERVICES */ diff --git a/ampel-firmware/web_config.cpp b/ampel-firmware/web_config.cpp index f8aac2db84a997e62c7b4b562500ef146b1d92fc..1012ee34b541897b5731b664f3cd3594c455fae0 100644 --- a/ampel-firmware/web_config.cpp +++ b/ampel-firmware/web_config.cpp @@ -31,7 +31,7 @@ namespace web_config { IotWebConf *iotWebConf; - const char config_version[IOTWEBCONF_CONFIG_VERSION_LENGTH] = "a10"; // -- Configuration specific key. The value should be modified if config structure was changed. + const char config_version[IOTWEBCONF_CONFIG_VERSION_LENGTH] = AMPEL_CONFIG_VERSION; // -- Configuration specific key. The value should be modified if config structure was changed. using namespace iotwebconf; /**