diff --git a/Makefile b/Makefile index 2411366e0830375e25a8360744420a3ac2a38f31..b32c3fd3a8b800fd4f38eb8f34bfe5f45c8bdcc1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ all: +ifdef board + pio -f -c vim run -e $(board) +else pio -f -c vim run +endif upload: pio -f -c vim run --target upload -e $(board) diff --git a/README.md b/README.md index 04077a7338acbd798361923c97e898bcb73edcd1..75d528d293979e219055da09446cd3eb51ceac14 100644 --- a/README.md +++ b/README.md @@ -148,5 +148,5 @@ The commands can be sent via the Serial interface, from the webpage or via MQTT. ## License -Copyright © 2021, [HfT Stuttgart](https://www.hft-stuttgart.de/) +Copyright © 2022, [HfT Stuttgart](https://www.hft-stuttgart.de/) [GPLv3](https://choosealicense.com/licenses/gpl-3.0/) diff --git a/ampel-firmware/ampel-firmware.ino b/ampel-firmware/ampel-firmware.ino index 74e8556702873c401ad5c97729e7863873c5ff79..8bbbf17696068a94803aecda2a4a783f0ed26290 100644 --- a/ampel-firmware/ampel-firmware.ino +++ b/ampel-firmware/ampel-firmware.ino @@ -19,7 +19,7 @@ /* * This file is part of the "CO2 Ampel" project ( https://transfer.hft-stuttgart.de/gitlab/co2ampel and * https://transfer.hft-stuttgart.de/gitlab/co2ampel/ampel-firmware ) - * Copyright (c) 2020 HfT Stuttgart. + * Copyright (c) 2022 HfT Stuttgart. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp index b7a98d213ddf4e3625db19a5f284907c32072216..07dff010b96d9b9813591d544285ebf4e9409166 100644 --- a/ampel-firmware/co2_sensor.cpp +++ b/ampel-firmware/co2_sensor.cpp @@ -56,6 +56,8 @@ namespace sensor { void calibrateSensorToSpecificPPM(int32_t calibrationLevel); void calibrateSensorRightNow(int32_t calibrationLevel); void setAutoCalibration(int32_t autoCalibration); + void setTimer(int32_t timestep); + void resetSCD(); void initialize() { #if defined(ESP8266) @@ -71,11 +73,12 @@ namespace sensor { * SDA --- SDA (GPIO21) //NOTE: GPIO1 would be more convenient (right next to GPO3) */ #endif + Serial.println(F("Sensor : Sensirion SCD30")); Serial.println(); scd30.enableDebugging(); // Prints firmware version in the console. if (!scd30.begin(config::auto_calibrate_sensor)) { - Serial.println(F("ERROR - CO2 sensor not detected. Please check wiring!")); + Serial.println(F("ERROR - Sensirion SCD30 not detected. Please check wiring!")); led_effects::showKITTWheel(color::red, 30); ESP.restart(); } @@ -99,6 +102,7 @@ namespace sensor { Serial.print(getTemperatureOffset()); Serial.println(F(" K")); + //FIXME: Actually set auto_calibrate_sensor, depending on the config. Serial.print(F("Auto-calibration is ")); Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF."); diff --git a/ampel-firmware/co2_sensor.h b/ampel-firmware/co2_sensor.h index e152f2777e87947d0b15a7712985fe9deddf1e7a..41ec01686a91babf48425b26f9200d109355075a 100644 --- a/ampel-firmware/co2_sensor.h +++ b/ampel-firmware/co2_sensor.h @@ -12,8 +12,6 @@ namespace sensor { void initialize(); bool processData(); void startCalibrationProcess(); - void setTimer(int32_t timestep); - void resetSCD(); float getTemperatureOffset(); } #endif diff --git a/ampel-firmware/util.h b/ampel-firmware/util.h index e5a73262c26750606f4a6babf7650333b22dedb2..5b0ac8040d222caced367f92bad7b12ab013acbd 100644 --- a/ampel-firmware/util.h +++ b/ampel-firmware/util.h @@ -26,7 +26,7 @@ class Ampel { private: static void showFreeSpace(); public: - const char *version = "v0.3.0"; // Update manually after significant changes. + const char *version = "v0.3.1-DEV"; // Update manually after significant changes. const char *board; const char *sensorId; const char *macAddress; diff --git a/platformio.ini b/platformio.ini index 43f3d4495c68e5d625971c7995834c80c262bb15..0e95d7321d41a502dc7dd12725d21618d8ff7153 100644 --- a/platformio.ini +++ b/platformio.ini @@ -26,5 +26,7 @@ lib_deps = MCCI LoRaWAN LMIC library build_flags = -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS +; Conflict between 2 hal_init functions. see https://community.platformio.org/t/multiple-definitions-warning-cant-fix-it/27534/9 + -D hal_init=LMICHAL_init -D CFG_eu868=1 -D CFG_sx1276_radio=1