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
7b2385e5
Commit
7b2385e5
authored
May 04, 2021
by
Eric Duminil
Browse files
Removing one leading space from doc
parent
c3d8c797
Changes
8
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
7b2385e5
...
...
@@ -103,15 +103,14 @@ namespace sensor {
Serial
.
println
(
F
(
" s during acclimatization."
));
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep_bootup
);
// [s]
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
"
1500 (Sets co2 level, for debugging purposes)"
));
sensor_console
::
defineIntCommand
(
"timer"
,
setTimer
,
F
(
"
30 (Sets measurement interval, in s)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"
(Starts calibration process)"
));
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
"1500 (Sets co2 level, for debugging purposes)"
));
sensor_console
::
defineIntCommand
(
"timer"
,
setTimer
,
F
(
"30 (Sets measurement interval, in s)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"(Starts calibration process)"
));
sensor_console
::
defineIntCommand
(
"calibrate"
,
calibrateSensorToSpecificPPM
,
F
(
"
600 (Starts calibration process, to given ppm)"
));
F
(
"600 (Starts calibration process, to given ppm)"
));
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
F
(
" 600 (Calibrates right now, to given ppm)"
));
sensor_console
::
defineIntCommand
(
"auto_calibrate"
,
setAutoCalibration
,
F
(
" 0/1 (Disables/enables autocalibration)"
));
F
(
"600 (Calibrates right now, to given ppm)"
));
sensor_console
::
defineIntCommand
(
"auto_calibrate"
,
setAutoCalibration
,
F
(
"0/1 (Disables/enables autocalibration)"
));
}
bool
hasSensorSettled
()
{
...
...
ampel-firmware/csv_writer.cpp
View file @
7b2385e5
...
...
@@ -118,9 +118,9 @@ namespace csv_writer {
showFilesystemContent
();
Serial
.
println
();
sensor_console
::
defineIntCommand
(
"csv"
,
setCSVinterval
,
F
(
"
60 (Sets CSV writing interval, in s)"
));
sensor_console
::
defineCommand
(
"format_filesystem"
,
formatFilesystem
,
F
(
"
(Deletes the whole filesystem)"
));
sensor_console
::
defineCommand
(
"show_csv"
,
showCSVContent
,
F
(
"
(Displays the complete CSV file on Serial)"
));
sensor_console
::
defineIntCommand
(
"csv"
,
setCSVinterval
,
F
(
"60 (Sets CSV writing interval, in s)"
));
sensor_console
::
defineCommand
(
"format_filesystem"
,
formatFilesystem
,
F
(
"(Deletes the whole filesystem)"
));
sensor_console
::
defineCommand
(
"show_csv"
,
showCSVContent
,
F
(
"(Displays the complete CSV file on Serial)"
));
}
File
openOrCreate
()
{
...
...
ampel-firmware/led_effects.cpp
View file @
7b2385e5
...
...
@@ -81,8 +81,8 @@ namespace led_effects {
pixels
.
begin
();
pixels
.
setBrightness
(
config
::
max_brightness
);
LEDsOff
();
sensor_console
::
defineCommand
(
"night_mode"
,
toggleNightMode
,
F
(
"
(Toggles night mode on/off)"
));
sensor_console
::
defineIntCommand
(
"color"
,
showColor
,
F
(
"
0xFF0015 (Shows color, specified as RGB, for debugging)"
));
sensor_console
::
defineCommand
(
"night_mode"
,
toggleNightMode
,
F
(
"(Toggles night mode on/off)"
));
sensor_console
::
defineIntCommand
(
"color"
,
showColor
,
F
(
"0xFF0015 (Shows color, specified as RGB, for debugging)"
));
}
void
toggleNightMode
()
{
...
...
ampel-firmware/lorawan.cpp
View file @
7b2385e5
...
...
@@ -47,7 +47,7 @@ namespace lorawan {
LMIC_reset
();
// Join, but don't send anything yet.
LMIC_startJoining
();
sensor_console
::
defineIntCommand
(
"lora"
,
setLoRaInterval
,
F
(
"
300 (Sets LoRaWAN sending interval, in s)"
));
sensor_console
::
defineIntCommand
(
"lora"
,
setLoRaInterval
,
F
(
"300 (Sets LoRaWAN sending interval, in s)"
));
}
// Checks if OTAA is connected, or if payload should be sent.
...
...
@@ -96,7 +96,7 @@ namespace lorawan {
printHex2
(
artKey
[
i
]);
}
Serial
.
println
();
Serial
.
print
(
" NwkSKey: "
);
Serial
.
print
(
F
(
" NwkSKey: "
)
)
;
for
(
size_t
i
=
0
;
i
<
sizeof
(
nwkKey
);
++
i
)
{
if
(
i
!=
0
)
Serial
.
print
(
"-"
);
...
...
ampel-firmware/mqtt.cpp
View file @
7b2385e5
...
...
@@ -36,9 +36,9 @@ namespace mqtt {
// mqttClient.setSocketTimeout(config::mqtt_timeout); //NOTE: somehow doesn't seem to have any effect on connect()
mqttClient
.
setServer
(
config
::
mqtt_server
,
config
::
mqtt_port
);
sensor_console
::
defineIntCommand
(
"mqtt"
,
setMQTTinterval
,
F
(
"
60 (Sets MQTT sending interval, in s)"
));
sensor_console
::
defineIntCommand
(
"mqtt"
,
setMQTTinterval
,
F
(
"60 (Sets MQTT sending interval, in s)"
));
sensor_console
::
defineCommand
(
"send_local_ip"
,
sendInfoAboutLocalNetwork
,
F
(
"
(Sends local IP and SSID via MQTT. Can be useful to find sensor)"
));
F
(
"(Sends local IP and SSID via MQTT. Can be useful to find sensor)"
));
}
void
publish
(
const
char
*
timestamp
,
int16_t
co2
,
float
temperature
,
float
humidity
)
{
...
...
ampel-firmware/sensor_console.cpp
View file @
7b2385e5
...
...
@@ -108,6 +108,7 @@ namespace sensor_console {
for
(
uint8_t
i
=
0
;
i
<
commands_count
;
i
++
)
{
Serial
.
print
(
F
(
" "
));
Serial
.
print
(
commands
[
i
].
name
);
Serial
.
print
(
F
(
" "
));
Serial
.
print
(
commands
[
i
].
doc
);
Serial
.
println
(
F
(
"."
));
}
...
...
ampel-firmware/util.cpp
View file @
7b2385e5
...
...
@@ -74,11 +74,11 @@ char* getSensorId() {
Ampel
::
Ampel
()
:
board
(
current_board
),
sensorId
(
getSensorId
()),
max_loop_duration
(
0
)
{
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
F
(
"
1618829570 (Sets time to the given UNIX time)"
));
sensor_console
::
defineCommand
(
"free"
,
Ampel
::
showFreeSpace
,
F
(
"
(Displays available heap space)"
));
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
F
(
"1618829570 (Sets time to the given UNIX time)"
));
sensor_console
::
defineCommand
(
"free"
,
Ampel
::
showFreeSpace
,
F
(
"(Displays available heap space)"
));
sensor_console
::
defineCommand
(
"reset"
,
[]()
{
ESP
.
restart
();
},
F
(
"
(Restarts the sensor)"
));
},
F
(
"(Restarts the sensor)"
));
}
Ampel
ampel
;
ampel-firmware/wifi_util.cpp
View file @
7b2385e5
...
...
@@ -43,8 +43,8 @@ namespace wifi {
// Initialize Wi-Fi
void
connect
(
const
char
*
hostname
)
{
sensor_console
::
defineCommand
(
"wifi_scan"
,
scanNetworks
,
F
(
"
(Scans available WiFi networks)"
));
sensor_console
::
defineCommand
(
"local_ip"
,
showLocalIp
,
F
(
"
(Displays local IP and current SSID)"
));
sensor_console
::
defineCommand
(
"wifi_scan"
,
scanNetworks
,
F
(
"(Scans available WiFi networks)"
));
sensor_console
::
defineCommand
(
"local_ip"
,
showLocalIp
,
F
(
"(Displays local IP and current SSID)"
));
//NOTE: WiFi Multi could allow multiple SSID and passwords.
WiFi
.
persistent
(
false
);
// Don't write user & password to Flash.
...
...
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