Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Efraim Doe
ampel-firmware
Commits
a9636423
You need to sign in or sign up before continuing.
Commit
a9636423
authored
Jan 09, 2021
by
Eric Duminil
Browse files
Cleaning up log messages
parent
b1023818
Changes
6
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/ampel-firmware.ino
View file @
a9636423
...
...
@@ -78,7 +78,7 @@ void setup() {
#ifdef AMPEL_WIFI
WiFiConnect
(
SENSOR_ID
);
Serial
.
print
(
F
(
"WiFi
STATUS
: "
));
Serial
.
print
(
F
(
"WiFi
- Status
: "
));
Serial
.
println
(
WiFi
.
status
());
if
(
WiFi
.
status
()
==
WL_CONNECTED
)
{
...
...
@@ -150,7 +150,7 @@ void loop() {
uint32_t
duration
=
millis
()
-
t0
;
if
(
duration
>
max_loop_duration
)
{
max_loop_duration
=
duration
;
Serial
.
print
(
"
Max loop duration : "
);
Serial
.
print
(
F
(
"Debug -
Max loop duration : "
)
)
;
Serial
.
print
(
max_loop_duration
);
Serial
.
println
(
" ms."
);
}
...
...
ampel-firmware/co2_sensor.cpp
View file @
a9636423
...
...
@@ -116,8 +116,8 @@ namespace sensor {
}
void
logToSerial
()
{
Serial
.
print
ln
(
timestamp
);
Serial
.
print
(
F
(
"co2(ppm): "
));
Serial
.
print
(
timestamp
);
Serial
.
print
(
F
(
"
-
co2(ppm): "
));
Serial
.
print
(
co2
);
Serial
.
print
(
F
(
" temp(C): "
));
Serial
.
print
(
temperature
,
1
);
...
...
ampel-firmware/csv_writer.cpp
View file @
a9636423
...
...
@@ -115,11 +115,7 @@ namespace csv_writer {
// Open dir folder
Serial
.
println
(
"Filesystem content:"
);
showFilesystemContent
();
if
(
FS_LIB
.
exists
(
filename
))
{
Serial
.
print
(
filename
);
Serial
.
println
(
" has been found."
);
}
Serial
.
println
();
}
File
openOrCreate
()
{
...
...
@@ -145,7 +141,7 @@ namespace csv_writer {
if
(
written_bytes
==
0
)
{
Serial
.
println
(
F
(
"Nothing written. Disk full?"
));
}
else
{
Serial
.
print
ln
(
F
(
"
Wrote file content:
"
));
Serial
.
print
(
F
(
"
CSV - Wrote :
"
));
Serial
.
print
(
csv_line
);
last_successful_write
=
ntp
::
getLocalTime
();
}
...
...
ampel-firmware/lorawan.cpp
View file @
a9636423
...
...
@@ -82,18 +82,18 @@ namespace lorawan {
u1_t
nwkKey
[
16
];
u1_t
artKey
[
16
];
LMIC_getSessionKeys
(
&
netid
,
&
devaddr
,
nwkKey
,
artKey
);
Serial
.
print
(
F
(
"netid: "
));
Serial
.
print
(
F
(
"
netid: "
));
Serial
.
println
(
netid
,
DEC
);
Serial
.
print
(
F
(
"devaddr: "
));
Serial
.
print
(
F
(
"
devaddr: "
));
Serial
.
println
(
devaddr
,
HEX
);
Serial
.
print
(
F
(
"AppSKey: "
));
Serial
.
print
(
F
(
"
AppSKey: "
));
for
(
size_t
i
=
0
;
i
<
sizeof
(
artKey
);
++
i
)
{
if
(
i
!=
0
)
Serial
.
print
(
"-"
);
printHex2
(
artKey
[
i
]);
}
Serial
.
println
(
""
);
Serial
.
print
(
"NwkSKey: "
);
Serial
.
println
();
Serial
.
print
(
"
NwkSKey: "
);
for
(
size_t
i
=
0
;
i
<
sizeof
(
nwkKey
);
++
i
)
{
if
(
i
!=
0
)
Serial
.
print
(
"-"
);
...
...
ampel-firmware/mqtt.cpp
View file @
a9636423
...
...
@@ -41,7 +41,7 @@ namespace mqtt {
void
publish
(
const
String
&
timestamp
,
int16_t
co2
,
float
temperature
,
float
humidity
)
{
if
(
WiFi
.
status
()
==
WL_CONNECTED
&&
mqttClient
.
connected
())
{
led_effects
::
onBoardLEDOn
();
Serial
.
print
(
F
(
"Publishing
MQTT
message ... "
));
Serial
.
print
(
F
(
"
MQTT -
Publishing message ... "
));
char
payload
[
75
];
// Should be enough for json...
snprintf
(
payload
,
sizeof
(
payload
),
json_sensor_format
,
timestamp
.
c_str
(),
co2
,
temperature
,
humidity
);
...
...
@@ -185,7 +185,7 @@ namespace mqtt {
// No WIFI
return
;
}
Serial
.
print
(
F
(
"Attempting
MQTT
connection..."
));
Serial
.
print
(
F
(
"
MQTT -
Attempting connection..."
));
led_effects
::
onBoardLEDOn
();
// Wait for connection, at most 15s (default)
...
...
ampel-firmware/wifi_util.cpp
View file @
a9636423
...
...
@@ -23,7 +23,7 @@ void WiFiConnect(const String &hostname) {
WiFi
.
setHostname
(
hostname
.
c_str
());
#endif
Serial
.
print
(
"
\n
Connecting to "
);
Serial
.
print
(
F
(
"WiFi -
Connecting to "
)
)
;
Serial
.
println
(
config
::
wifi_ssid
);
WiFi
.
begin
(
config
::
wifi_ssid
,
config
::
wifi_password
);
...
...
@@ -35,11 +35,11 @@ void WiFiConnect(const String &hostname) {
if
(
WiFi
.
status
()
==
WL_CONNECTED
)
{
led_effects
::
showKITTWheel
(
color
::
green
);
Serial
.
println
();
Serial
.
print
(
"
\n
WiFi
c
onnected
,
IP address: "
);
Serial
.
print
(
F
(
"
WiFi
- C
onnected
!
IP address: "
)
)
;
Serial
.
println
(
WiFi
.
localIP
());
}
else
{
//TODO: Allow sensor to work as an Access Point, in order to define SSID & password?
led_effects
::
showKITTWheel
(
color
::
red
);
Serial
.
println
(
"
\n
Connection to WiFi failed"
);
Serial
.
println
(
F
(
"
Connection to WiFi failed"
)
)
;
}
}
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