Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
07ebc466
Commit
07ebc466
authored
Feb 10, 2022
by
Eric Duminil
Browse files
Expect services to be set to true/false in config
parent
733a7b7f
Pipeline
#5776
passed with stage
in 2 minutes and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/config.public.h
View file @
07ebc466
...
...
@@ -7,12 +7,12 @@
* SERVICES
*/
//
Comment or remove those lines if you want to disable the corresponding services
# define AMPEL_WIFI // Should ESP connect to WiFi? It allows the Ampel to get time from an NTP server.
# define AMPEL_HTTP // Should HTTP web server be started? (AMPEL_WIFI should be enabled too)
# define AMPEL_MQTT // Should data be sent over MQTT? (AMPEL_WIFI should be enabled too)
# define AMPEL_CSV // Should data be logged as CSV, on the ESP flash memory?
//
# define AMPEL_LORAWAN // Should data be sent over LoRaWAN? (Requires ESP32 + LoRa modem, and "MCCI LoRaWAN LMIC library")
//
Define the default for corresponding services. They can be enabled/disabled later in the web-config.
# define AMPEL_WIFI
true
// Should ESP connect to WiFi? It allows the Ampel to get time from an NTP server.
# define AMPEL_HTTP
true
// Should HTTP web server be started? (AMPEL_WIFI should be enabled too)
# define AMPEL_MQTT
true
// Should data be sent over MQTT? (AMPEL_WIFI should be enabled too)
# define AMPEL_CSV
true
// Should data be logged as CSV, on the ESP flash memory?
# define AMPEL_LORAWAN
false
// Should data be sent over LoRaWAN? (Requires ESP32 + LoRa modem, and "MCCI LoRaWAN LMIC library")
/**
* WIFI
...
...
ampel-firmware/web_config.cpp
View file @
07ebc466
...
...
@@ -34,7 +34,8 @@ namespace web_config {
/**
* WiFi params
*/
CheckboxTParameter
ampelWifiParam
=
Builder
<
CheckboxTParameter
>
(
"WiFi"
).
label
(
"WiFi?"
).
defaultValue
(
true
).
build
();
CheckboxTParameter
ampelWifiParam
=
Builder
<
CheckboxTParameter
>
(
"WiFi"
).
label
(
"WiFi?"
).
defaultValue
(
AMPEL_WIFI
).
build
();
IntTParameter
<
uint16_t
>
wifiTimeoutParam
=
Builder
<
IntTParameter
<
uint16_t
>>
(
"wifi_timeout"
).
label
(
"WiFi timeout"
).
defaultValue
(
WIFI_TIMEOUT
).
min
(
0
).
placeholder
(
"[s]"
).
build
();
...
...
@@ -87,7 +88,7 @@ namespace web_config {
/**
* CSV
*/
OptionalParameterGroup
csvParams
=
OptionalParameterGroup
(
"CSV"
,
"CSV"
,
true
);
OptionalParameterGroup
csvParams
=
OptionalParameterGroup
(
"CSV"
,
"CSV"
,
AMPEL_CSV
);
IntTParameter
<
uint16_t
>
csvTimestepParam
=
Builder
<
IntTParameter
<
uint16_t
>>
(
"csv_timestep"
).
label
(
"CSV timestep"
).
defaultValue
(
CSV_INTERVAL
).
min
(
0
).
step
(
1
).
placeholder
(
...
...
@@ -96,16 +97,12 @@ namespace web_config {
/**
* MQTT
*/
OptionalParameterGroup
mqttParams
=
OptionalParameterGroup
(
"MQTT"
,
"MQTT"
,
true
);
OptionalParameterGroup
mqttParams
=
OptionalParameterGroup
(
"MQTT"
,
"MQTT"
,
AMPEL_MQTT
);
IntTParameter
<
uint16_t
>
mqttTimestepParam
=
Builder
<
IntTParameter
<
uint16_t
>>
(
"mqtt_timestep"
).
label
(
"MQTT timestep"
).
defaultValue
(
MQTT_SENDING_INTERVAL
).
min
(
0
).
step
(
1
).
defaultValue
(
300
).
placeholder
(
"[s]"
).
build
();
#if !defined(MQTT_ENCRYPTED)
# define MQTT_ENCRYPTED true // Old config files might not define it, and encryption was on by default.
#endif
CheckboxTParameter
mqttEncryptionParam
=
Builder
<
CheckboxTParameter
>
(
"mqtt_encryption"
).
label
(
"Encrypt MQTT?"
).
defaultValue
(
MQTT_ENCRYPTED
).
build
();
...
...
@@ -144,7 +141,7 @@ namespace web_config {
/**
* LoRa & Stuff
*/
OptionalParameterGroup
loraParams
=
OptionalParameterGroup
(
"LoRaWan"
,
"LoRaWan"
,
false
);
OptionalParameterGroup
loraParams
=
OptionalParameterGroup
(
"LoRaWan"
,
"LoRaWan"
,
AMPEL_LORAWAN
);
IntTParameter
<
uint16_t
>
loraTimestepParam
=
Builder
<
IntTParameter
<
uint16_t
>>
(
"lora_timestep"
).
label
(
"LoRa timestep"
).
defaultValue
(
LORAWAN_SENDING_INTERVAL
).
min
(
0
).
step
(
1
).
defaultValue
(
300
).
placeholder
(
"[s]"
).
build
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment