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

Merge branch 'develop'

parents efdfde46 4705ed5b
Pipeline #6589 passed with stage
in 2 minutes and 23 seconds
all: all:
ifdef board
pio -f -c vim run -e $(board)
else
pio -f -c vim run pio -f -c vim run
endif
upload: upload:
pio -f -c vim run --target upload -e $(board) pio -f -c vim run --target upload -e $(board)
......
...@@ -148,5 +148,5 @@ The commands can be sent via the Serial interface, from the webpage or via MQTT. ...@@ -148,5 +148,5 @@ The commands can be sent via the Serial interface, from the webpage or via MQTT.
## License ## 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/) [GPLv3](https://choosealicense.com/licenses/gpl-3.0/)
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/* /*
* This file is part of the "CO2 Ampel" project ( https://transfer.hft-stuttgart.de/gitlab/co2ampel and * 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 ) * 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 * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -56,6 +56,8 @@ namespace sensor { ...@@ -56,6 +56,8 @@ namespace sensor {
void calibrateSensorToSpecificPPM(int32_t calibrationLevel); void calibrateSensorToSpecificPPM(int32_t calibrationLevel);
void calibrateSensorRightNow(int32_t calibrationLevel); void calibrateSensorRightNow(int32_t calibrationLevel);
void setAutoCalibration(int32_t autoCalibration); void setAutoCalibration(int32_t autoCalibration);
void setTimer(int32_t timestep);
void resetSCD();
void initialize() { void initialize() {
#if defined(ESP8266) #if defined(ESP8266)
...@@ -71,11 +73,12 @@ namespace sensor { ...@@ -71,11 +73,12 @@ namespace sensor {
* SDA --- SDA (GPIO21) //NOTE: GPIO1 would be more convenient (right next to GPO3) * SDA --- SDA (GPIO21) //NOTE: GPIO1 would be more convenient (right next to GPO3)
*/ */
#endif #endif
Serial.println(F("Sensor : Sensirion SCD30"));
Serial.println(); Serial.println();
scd30.enableDebugging(); // Prints firmware version in the console. scd30.enableDebugging(); // Prints firmware version in the console.
if (!scd30.begin(config::auto_calibrate_sensor)) { 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); led_effects::showKITTWheel(color::red, 30);
ESP.restart(); ESP.restart();
} }
...@@ -99,6 +102,7 @@ namespace sensor { ...@@ -99,6 +102,7 @@ namespace sensor {
Serial.print(getTemperatureOffset()); Serial.print(getTemperatureOffset());
Serial.println(F(" K")); Serial.println(F(" K"));
//FIXME: Actually set auto_calibrate_sensor, depending on the config.
Serial.print(F("Auto-calibration is ")); Serial.print(F("Auto-calibration is "));
Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF."); Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF.");
......
...@@ -12,8 +12,6 @@ namespace sensor { ...@@ -12,8 +12,6 @@ namespace sensor {
void initialize(); void initialize();
bool processData(); bool processData();
void startCalibrationProcess(); void startCalibrationProcess();
void setTimer(int32_t timestep);
void resetSCD();
float getTemperatureOffset(); float getTemperatureOffset();
} }
#endif #endif
...@@ -26,7 +26,7 @@ class Ampel { ...@@ -26,7 +26,7 @@ class Ampel {
private: private:
static void showFreeSpace(); static void showFreeSpace();
public: 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 *board;
const char *sensorId; const char *sensorId;
const char *macAddress; const char *macAddress;
......
...@@ -26,5 +26,7 @@ lib_deps = ...@@ -26,5 +26,7 @@ lib_deps =
MCCI LoRaWAN LMIC library MCCI LoRaWAN LMIC library
build_flags = build_flags =
-D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -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_eu868=1
-D CFG_sx1276_radio=1 -D CFG_sx1276_radio=1
Supports Markdown
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