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
168ea9b6
Commit
168ea9b6
authored
Feb 17, 2022
by
Eric Duminil
Browse files
Add save to save config
parent
bf1050e5
Pipeline
#5860
passed with stage
in 2 minutes and 32 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
168ea9b6
...
@@ -103,7 +103,7 @@ namespace sensor {
...
@@ -103,7 +103,7 @@ namespace sensor {
Serial
.
println
(
F
(
" s during acclimatization."
));
Serial
.
println
(
F
(
" s during acclimatization."
));
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep_bootup
);
// [s]
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep_bootup
);
// [s]
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
"1500 (Sets co2 level, for debugging
purposes
)"
));
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
"1500 (Sets co2 level, for debugging)"
));
sensor_console
::
defineIntCommand
(
"timer"
,
setTimer
,
F
(
"30 (Sets measurement interval, in s)"
));
sensor_console
::
defineIntCommand
(
"timer"
,
setTimer
,
F
(
"30 (Sets measurement interval, in s)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"(Starts calibration process)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"(Starts calibration process)"
));
sensor_console
::
defineIntCommand
(
"calibrate"
,
calibrateSensorToSpecificPPM
,
sensor_console
::
defineIntCommand
(
"calibrate"
,
calibrateSensorToSpecificPPM
,
...
@@ -305,7 +305,6 @@ namespace sensor {
...
@@ -305,7 +305,6 @@ namespace sensor {
Serial
.
println
(
F
(
"s (change will only be applied after next measurement)."
));
Serial
.
println
(
F
(
"s (change will only be applied after next measurement)."
));
scd30
.
setMeasurementInterval
(
timestep
);
scd30
.
setMeasurementInterval
(
timestep
);
config
::
measurement_timestep
=
timestep
;
config
::
measurement_timestep
=
timestep
;
config
::
save
();
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
}
}
}
}
...
...
ampel-firmware/csv_writer.cpp
View file @
168ea9b6
...
@@ -176,7 +176,6 @@ namespace csv_writer {
...
@@ -176,7 +176,6 @@ namespace csv_writer {
Serial
.
print
(
F
(
"Setting CSV Interval to : "
));
Serial
.
print
(
F
(
"Setting CSV Interval to : "
));
Serial
.
print
(
config
::
csv_interval
);
Serial
.
print
(
config
::
csv_interval
);
Serial
.
println
(
"s."
);
Serial
.
println
(
"s."
);
config
::
save
();
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
}
}
...
...
ampel-firmware/lorawan.cpp
View file @
168ea9b6
...
@@ -220,7 +220,6 @@ namespace lorawan {
...
@@ -220,7 +220,6 @@ namespace lorawan {
Serial
.
print
(
F
(
"Setting LoRa sending interval to : "
));
Serial
.
print
(
F
(
"Setting LoRa sending interval to : "
));
Serial
.
print
(
config
::
lorawan_sending_interval
);
Serial
.
print
(
config
::
lorawan_sending_interval
);
Serial
.
println
(
"s."
);
Serial
.
println
(
"s."
);
config
::
save
();
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
}
}
}
}
...
...
ampel-firmware/mqtt.cpp
View file @
168ea9b6
...
@@ -180,8 +180,7 @@ namespace mqtt {
...
@@ -180,8 +180,7 @@ namespace mqtt {
config
::
mqtt_sending_interval
=
sending_interval
;
config
::
mqtt_sending_interval
=
sending_interval
;
Serial
.
print
(
F
(
"Setting MQTT sending interval to : "
));
Serial
.
print
(
F
(
"Setting MQTT sending interval to : "
));
Serial
.
print
(
config
::
mqtt_sending_interval
);
Serial
.
print
(
config
::
mqtt_sending_interval
);
Serial
.
println
(
"s."
);
Serial
.
println
(
F
(
"s."
));
config
::
save
();
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
}
}
...
...
ampel-firmware/sensor_console.cpp
View file @
168ea9b6
#include
"sensor_console.h"
#include
"sensor_console.h"
namespace
sensor_console
{
namespace
sensor_console
{
const
uint8_t
MAX_COMMANDS
=
2
2
;
const
uint8_t
MAX_COMMANDS
=
2
5
;
const
uint8_t
MAX_COMMAND_SIZE
=
20
;
// Should be enough for "set_time 1618829570\n"
const
uint8_t
MAX_COMMAND_SIZE
=
20
;
// Should be enough for "set_time 1618829570\n"
uint8_t
commands_count
=
0
;
uint8_t
commands_count
=
0
;
...
...
ampel-firmware/web_config.cpp
View file @
168ea9b6
...
@@ -223,20 +223,21 @@ namespace web_config {
...
@@ -223,20 +223,21 @@ namespace web_config {
//TODO: Add "ap" command?
//TODO: Add "ap" command?
//TODO: Add "wifi_ssid" command?
//TODO: Add "wifi_ssid" command?
//TODO: Add "wifi_password" command?
//TODO: Add "wifi_password" command?
//TODO: Add "save_config" command?
sensor_console
::
defineCommand
(
"save_config"
,
config
::
save
,
F
(
"(Saves the config to EEPROM)"
));
sensor_console
::
defineCommand
(
"reset_config"
,
[]()
{
sensor_console
::
defineCommand
(
"reset_config"
,
[]()
{
Serial
.
println
(
F
(
"Resetting config..."
));
Serial
.
println
(
F
(
"Resetting config..."
));
iotWebConf
->
getRootParameterGroup
()
->
applyDefaultValue
();
iotWebConf
->
getRootParameterGroup
()
->
applyDefaultValue
();
iotWebConf
->
saveConfig
();
iotWebConf
->
saveConfig
();
Serial
.
println
(
F
(
"Done!"
));
Serial
.
println
(
F
(
"Done!"
));
},
F
(
"(
r
esets the complete IotWeb config)"
));
},
F
(
"(
R
esets the complete IotWeb config)"
));
sensor_console
::
defineIntCommand
(
"wifi"
,
[](
int32_t
onOff
)
{
sensor_console
::
defineIntCommand
(
"wifi"
,
[](
int32_t
onOff
)
{
config
::
is_wifi_on
=
onOff
;
config
::
is_wifi_on
=
onOff
;
iotWebConf
->
saveConfig
();
iotWebConf
->
saveConfig
();
Serial
.
print
(
F
(
"WiFi - "
));
Serial
.
print
(
F
(
"WiFi - "
));
Serial
.
println
(
onOff
?
F
(
"On!"
)
:
F
(
"Off!"
));
Serial
.
println
(
onOff
?
F
(
"On!"
)
:
F
(
"Off!"
));
},
F
(
"0/1 (Turns Wifi on/off)
.
"
));
},
F
(
"0/1 (Turns Wifi on/off)"
));
iotWebConf
->
loadConfig
();
iotWebConf
->
loadConfig
();
...
...
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