Commit a9636423 authored by Eric Duminil's avatar Eric Duminil
Browse files

Cleaning up log messages

parent b1023818
......@@ -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.");
}
......
......@@ -116,8 +116,8 @@ namespace sensor {
}
void logToSerial() {
Serial.println(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);
......
......@@ -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.println(F("Wrote file content:"));
Serial.print(F("CSV - Wrote : "));
Serial.print(csv_line);
last_successful_write = ntp::getLocalTime();
}
......
......@@ -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("-");
......
......@@ -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)
......
......@@ -23,7 +23,7 @@ void WiFiConnect(const String &hostname) {
WiFi.setHostname(hostname.c_str());
#endif
Serial.print("\nConnecting 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("\nWiFi connected, IP address: ");
Serial.print(F("WiFi - Connected! 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("\nConnection to WiFi failed");
Serial.println(F("Connection to WiFi failed"));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment