diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp index 11db5c3dad0fb2097a4574a3d300af6115722666..0fa5e8e3bc86a6fcba64f74d0f81fb5c139c531c 100644 --- a/ampel-firmware/co2_sensor.cpp +++ b/ampel-firmware/co2_sensor.cpp @@ -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() { diff --git a/ampel-firmware/csv_writer.cpp b/ampel-firmware/csv_writer.cpp index a83bed666455545d2d5cb7c68a3d583d88f7b40a..d0828a40999dc7326d1ce19f9a4808be10dd6852 100644 --- a/ampel-firmware/csv_writer.cpp +++ b/ampel-firmware/csv_writer.cpp @@ -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() { diff --git a/ampel-firmware/led_effects.cpp b/ampel-firmware/led_effects.cpp index 5ff03ec55f74aec1f65e3cdfc2059b6484323843..061b6f869b2c57494dfdbdbe3495b8a90736ef05 100644 --- a/ampel-firmware/led_effects.cpp +++ b/ampel-firmware/led_effects.cpp @@ -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() { diff --git a/ampel-firmware/lorawan.cpp b/ampel-firmware/lorawan.cpp index 784b46fb61b25bc8d3868a3a541baa14f241150a..746893b3698137ff14417158e5a2728fd8ad4a25 100644 --- a/ampel-firmware/lorawan.cpp +++ b/ampel-firmware/lorawan.cpp @@ -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("-"); diff --git a/ampel-firmware/mqtt.cpp b/ampel-firmware/mqtt.cpp index 7a438e2dc35106271bf3e3299b21545b168315aa..cb0c5019c00d14094d6389684bb120eb061197f6 100644 --- a/ampel-firmware/mqtt.cpp +++ b/ampel-firmware/mqtt.cpp @@ -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) { diff --git a/ampel-firmware/sensor_console.cpp b/ampel-firmware/sensor_console.cpp index c700042c81888f0295ac2000fe703a4c0bc54d7e..5fc3377ced8a4d77b9337fad19c71483159ac74c 100644 --- a/ampel-firmware/sensor_console.cpp +++ b/ampel-firmware/sensor_console.cpp @@ -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(".")); } diff --git a/ampel-firmware/util.cpp b/ampel-firmware/util.cpp index e3b2d6e8913172cce6e4dd868aace8c03e8be02f..841b08ff3a6b04d2dde6e39094d38c601f7d2e72 100644 --- a/ampel-firmware/util.cpp +++ b/ampel-firmware/util.cpp @@ -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; diff --git a/ampel-firmware/wifi_util.cpp b/ampel-firmware/wifi_util.cpp index 335f94b45d8ca228496fa2957853e0ad4ba25511..4cdc7a2a597d3d66523c6e37b837346e5231311e 100644 --- a/ampel-firmware/wifi_util.cpp +++ b/ampel-firmware/wifi_util.cpp @@ -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.