Skip to content

Commit

Permalink
Merge pull request #146 from hackerspace-silesia/dev
Browse files Browse the repository at this point in the history
2.8.1
  • Loading branch information
bfaliszek authored Nov 26, 2021
2 parents 44d19be + 003ada4 commit cf57b1c
Show file tree
Hide file tree
Showing 136 changed files with 13,421 additions and 6,802 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ ENV/

# mypy
.mypy_cache/
.DS_Store
.vscode/arduino.json
.vscode/c_cpp_properties.json
.pio/
.vscode/
.pio/libdeps/esp32/Adafruit Unified Sensor/.github/workflows/githubci.yml
.pio/libdeps/esp32/Adafruit Unified Sensor/.piopm
.pio/libdeps/esp32/Adafruit_Sensor/.github/workflows/githubci.yml
.pio/libdeps/esp32/Adafruit_Sensor/.piopm
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,4 @@ Gotowe zestawy części potrzebnych do zbudowania własnego Smogly, dostępne s

## Roadmap

Główne zmiany planowane w kolejnych aktualizacjach. Poza wymienionymi poniżej zmianami, przy każdej aktualizacji staram się aktualizować wsyzstkie biblioteki i eliminować znalezione błędy.

+ [x] 2.7.6 - Aktualizacja bibliotek, drobne poprawki w działaniu, ekstremalna optymalizacja wykorzystywanej pamięci oraz dodanie wsparcia dla miernika temperatury - DS18b20
+ [x] 2.7.8 - Dodanie możliwości zmiany pinów dla mierników temperatury oraz poziomu pyłu
+ [ ] 2.8.0 - Jednoczesna obsługa dla dwóch mierników temperatury/wilgotności/ciśneinia oraz możliwość wyboru które dane mają być wykorzystywane
+ [ ] 2.8.5 - Możliwość wysyłania wszystkich danych z obu mierników temperatury/wilgotności/ciśneinia do zewnętrznych baz danych
Lista z głównymi zmianami planowanymi w kolejnych wersjach oprogramowania znajduje się [TUTAJ](https://docs.google.com/spreadsheets/d/1rpeKPuAakPwytqsNge7glb-UtNLumsx8-7kQvhxXOng/edit?usp=sharing). Poza wymienionymi w linkowanym arkuszu funkcjami, przy każdej aktualizacji staram się uaktualnić wsyzstkie wykorzystywane biblioteki i eliminować znalezione błędy.
Binary file added Smogly_Logo/SmoglyLogoTopMenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,687 changes: 1,451 additions & 236 deletions Smogomierz.ino

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#pragma once

extern bool DEVICENAME_AUTO;
extern char DEVICENAME[32];
extern bool DISPLAY_PM1;
extern char LANGUAGE[12];
extern unsigned char SELECTED_LANGUAGE;

extern char THP_MODEL[12];
extern char DUST_MODEL[12];
extern bool FREQUENTMEASUREMENT;

extern bool SECOND_THP;
extern char SECOND_THP_MODEL[12];

extern char CONFIG_FIRST_THP_SDA[4];
extern char CONFIG_FIRST_THP_SCL[4];
extern unsigned char FIRST_THP_SDA;
extern unsigned char FIRST_THP_SCL;

extern char CONFIG_SECOND_THP_SDA[4];
extern char CONFIG_SECOND_THP_SCL[4];
extern unsigned char SECOND_THP_SDA;
extern unsigned char SECOND_THP_SCL;

extern char CONFIG_DUST_TX[4];
extern char CONFIG_DUST_RX[4];
extern unsigned char DUST_TX;
extern unsigned char DUST_RX;

extern unsigned char DUST_TIME;
extern unsigned char NUMBEROFMEASUREMENTS;

extern bool LUFTDATEN_ON;
extern bool SMOGLIST_ON;

extern bool AIRMONITOR_ON;
extern bool AIRMONITOR_GRAPH_ON;
extern char AIRMONITOR_API_KEY[48];
extern char LATITUDE[16];
extern char LONGITUDE[16];
extern char EMAIL[64];
extern short MYALTITUDE;

extern bool THINGSPEAK_ON;
extern bool THINGSPEAK_GRAPH_ON;
extern char THINGSPEAK_API_KEY[32];
extern unsigned short THINGSPEAK_CHANNEL_ID;
extern char THINGSPEAK_READ_API_KEY[32];

extern bool INFLUXDB_ON;
extern char INFLUXDB_VERSION[4];
extern char INFLUXDB_HOST[128];
extern uint16_t INFLUXDB_PORT;
extern char INFLUXDB_DATABASE[32];
extern char INFLUXDB_USER[32];
extern char INFLUXDB_PASSWORD[64];
extern char INFLUXDB_ORG[32];
extern char INFLUXDB_BUCKET[32];
extern char INFLUXDB_TOKEN[128];

extern bool MQTT_ON;
extern char MQTT_HOST[128];
extern uint16_t MQTT_PORT;
extern char MQTT_USER[32];
extern char MQTT_PASSWORD[64];

extern bool MQTT_IP_IN_TOPIC;
extern bool MQTT_DEVICENAME_IN_TOPIC;
extern bool MQTT_SLASH_AT_THE_BEGINNING;
extern bool MQTT_SLASH_AT_THE_END;

extern char MQTT_TOPIC_TEMP[64];
extern char MQTT_TOPIC_HUMI[64];
extern char MQTT_TOPIC_PRESS[64];
extern char MQTT_TOPIC_PM1[64];
extern char MQTT_TOPIC_PM25[64];
extern char MQTT_TOPIC_PM10[64];
extern char MQTT_TOPIC_AIRQUALITY[32];

extern bool AQI_ECO_ON;
extern char AQI_ECO_HOST[64];
extern char AQI_ECO_PATH[64];

extern unsigned char SENDING_FREQUENCY;
extern unsigned char SENDING_DB_FREQUENCY;
extern bool DEEPSLEEP_ON;

extern bool DEBUG;
extern bool AUTOUPDATE_ON;

extern bool CONFIG_AUTH;
extern char CONFIG_USERNAME[64];
extern char CONFIG_PASSWORD[128];

extern char MODEL[12];


extern bool HOMEKIT_SUPPORT;

const char HOMEKIT_PASSWORD[16] PROGMEM = "111-11-111";


#ifdef DUSTSENSOR_PMS5003_7003_BME280_0x76 || DUSTSENSOR_PMS5003_7003_BME280_0x77
const char PMSENSORVERSION[] PROGMEM = "PMS";
#elif defined DUSTSENSOR_SDS011_21
const char PMSENSORVERSION[] PROGMEM = "SDS";
#elif defined DUSTSENSOR_HPMA115S0
const char PMSENSORVERSION[] PROGMEM = "HPMA115S0";
#elif defined DUSTSENSOR_SPS30
const char PMSENSORVERSION[] PROGMEM = "SPS30";
#else // If no dust sensor has been defined - use DUSTSENSOR_PMS5003_7003_BME280_0x76
const char PMSENSORVERSION[] PROGMEM = "PMS";
#endif

extern char SERVERSOFTWAREVERSION[32];
extern char CURRENTSOFTWAREVERSION[32];
#if defined(ARDUINO_ARCH_ESP8266)
const char SOFTWAREVERSION[] PROGMEM = "2.8.1 build " __TIME__ " " __DATE__;
const char HARDWAREVERSION[] PROGMEM = "1.0 - ESP8266";
#elif defined(ARDUINO_ARCH_ESP32)
const char SOFTWAREVERSION[] PROGMEM = "2.8.1 build " __TIME__ " " __DATE__;
const char HARDWAREVERSION[] PROGMEM = "2.0 - ESP32";

#endif
File renamed without changes.
109 changes: 64 additions & 45 deletions defaultConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,129 @@
bool DEVICENAME_AUTO = true;
char DEVICENAME[32] = "Smogly1"; // Bez polskich znakow!! // Without Polish letters!!
bool DISPLAY_PM1 = false;
char LANGUAGE[32] = "english"; // english or polish
int SELECTED_LANGUAGE = 1; // en - 1; pl - 2
char LANGUAGE[12] = "english"; // english or polish
unsigned char SELECTED_LANGUAGE = 1; // en - 1; pl - 2

char THP_MODEL[32] = "Non";
char DUST_MODEL[32] = "Non";
char THP_MODEL[12] = "Non";
char DUST_MODEL[12] = "Non";
bool FREQUENTMEASUREMENT = false;

bool SECOND_THP = false;
char SECOND_THP_MODEL[12] = "Non";

#ifdef ARDUINO_ARCH_ESP8266
char CONFIG_FIRST_THP_SDA[8] = "D3";
char CONFIG_FIRST_THP_SCL[8] = "D4";
int FIRST_THP_SDA = 0; // D3
int FIRST_THP_SCL = 2; // D4
char CONFIG_FIRST_THP_SDA[4] = "D3";
char CONFIG_FIRST_THP_SCL[4] = "D4";
unsigned char FIRST_THP_SDA = 0; // D3
unsigned char FIRST_THP_SCL = 2; // D4
#elif defined ARDUINO_ARCH_ESP32
char CONFIG_FIRST_THP_SDA[8] = "D16";
char CONFIG_FIRST_THP_SCL[8] = "D17";
int FIRST_THP_SDA = 16; // D16
int FIRST_THP_SCL = 17; // D17
char CONFIG_FIRST_THP_SDA[4] = "D4";
char CONFIG_FIRST_THP_SCL[4] = "D5";
unsigned char FIRST_THP_SDA = 4; // D16
unsigned char FIRST_THP_SCL = 5; // D17
#endif

char CONFIG_SECOND_THP_SDA[8] = "D5";
char CONFIG_SECOND_THP_SCL[8] = "D6";
int SECOND_THP_SDA = 14; // D5
int SECOND_THP_SCL = 12; // D6
#ifdef ARDUINO_ARCH_ESP8266
char CONFIG_SECOND_THP_SDA[4] = "D5";
char CONFIG_SECOND_THP_SCL[4] = "D6";
unsigned char SECOND_THP_SDA = 14; // D5
unsigned char SECOND_THP_SCL = 12; // D6
#elif defined ARDUINO_ARCH_ESP32
char CONFIG_SECOND_THP_SDA[4] = "D22";
char CONFIG_SECOND_THP_SCL[4] = "D23";
unsigned char SECOND_THP_SDA = 22; // D5
unsigned char SECOND_THP_SCL = 23; // D6
#endif

char CONFIG_DUST_TX[8] = "D1";
char CONFIG_DUST_RX[8] = "D2";
int DUST_TX = 5; // D1
int DUST_RX = 4; // D2
#ifdef ARDUINO_ARCH_ESP8266
char CONFIG_DUST_TX[4] = "D1";
char CONFIG_DUST_RX[4] = "D2";
unsigned char DUST_TX = 5; // D1
unsigned char DUST_RX = 4; // D2
#elif defined ARDUINO_ARCH_ESP32
char CONFIG_DUST_TX[4] = "D18";
char CONFIG_DUST_RX[4] = "D19";
unsigned char DUST_TX = 18; // D1
unsigned char DUST_RX = 19; // D2
#endif

/*
ESP8266
13 - D7
15 - D8
*/

int DUST_TIME = 1;
int NUMBEROFMEASUREMENTS = 10;
unsigned char DUST_TIME = 1;
unsigned char NUMBEROFMEASUREMENTS = 10;

bool LUFTDATEN_ON = false;
bool SMOGLIST_ON = true;

bool AIRMONITOR_ON = false;
bool AIRMONITOR_GRAPH_ON = true;
bool AIRMONITOR_GRAPH_ON = false;
char AIRMONITOR_API_KEY[48] = "";
char LATITUDE[16] = "50.263911";
char LONGITUDE[16] = "18.995711";
int MYALTITUDE = 271;
char EMAIL[64] = "email@mail.pl";
short MYALTITUDE = 271;

bool THINGSPEAK_ON = false;
bool THINGSPEAK_GRAPH_ON = false;
char THINGSPEAK_API_KEY[32] = "WRITE_API_KEY";
int THINGSPEAK_CHANNEL_ID = 0;
unsigned short THINGSPEAK_CHANNEL_ID = 0;
char THINGSPEAK_READ_API_KEY[32] = "READ_API_KEY";

bool INFLUXDB_ON = false;
char INFLUXDB_VERSION[16] = "1"; // 1 (for 1.x version) or 2 for 2.0 or later
char INFLUXDB_VERSION[4] = "1"; // 1 (for 1.x version) or 2 for 2.0 or later
char INFLUXDB_HOST[128] = "INFLUXDB_ADRESS";
uint16_t INFLUXDB_PORT = 8086;
char INFLUXDB_DATABASE[64] = "mydb";
char INFLUXDB_USER[64] = "username";
char INFLUXDB_DATABASE[32] = "mydb";
char INFLUXDB_USER[32] = "username";
char INFLUXDB_PASSWORD[64] = "password";
char INFLUXDB_ORG[64] = "myOrg";
char INFLUXDB_BUCKET[64] = "myBucket";
char INFLUXDB_TOKEN[64] = "myToken";
char INFLUXDB_ORG[32] = "myOrg";
char INFLUXDB_BUCKET[32] = "myBucket";
char INFLUXDB_TOKEN[128] = "myToken";

bool MQTT_ON = false;
char MQTT_HOST[128] = "MQTT_ADRESS";
uint16_t MQTT_PORT = 1883;
char MQTT_USER[64] = "username";
char MQTT_USER[32] = "username";
char MQTT_PASSWORD[64] = "password";

bool MQTT_IP_IN_TOPIC = false;
bool MQTT_DEVICENAME_IN_TOPIC = true;
bool MQTT_SLASH_AT_THE_BEGINNING = true;
bool MQTT_SLASH_AT_THE_END = true;

char MQTT_TOPIC_TEMP[128] = "sensor/temperature";
char MQTT_TOPIC_HUMI[128] = "sensor/humidity";
char MQTT_TOPIC_PRESS[128] = "sensor/pressure";
char MQTT_TOPIC_PM1[128] = "sensor/PM1";
char MQTT_TOPIC_PM25[128] = "sensor/PM2.5";
char MQTT_TOPIC_PM10[128] = "sensor/PM10";
char MQTT_TOPIC_AIRQUALITY[128] = "airquality";
char MQTT_TOPIC_TEMP[64] = "sensor/temperature";
char MQTT_TOPIC_HUMI[64] = "sensor/humidity";
char MQTT_TOPIC_PRESS[64] = "sensor/pressure";
char MQTT_TOPIC_PM1[64] = "sensor/PM1";
char MQTT_TOPIC_PM25[64] = "sensor/PM2.5";
char MQTT_TOPIC_PM10[64] = "sensor/PM10";
char MQTT_TOPIC_AIRQUALITY[32] = "airquality";

bool AQI_ECO_ON = false;
char AQI_ECO_HOST[128] = "???.aqi.eco";
char AQI_ECO_HOST[64] = "???.aqi.eco";
char AQI_ECO_PATH[64] = "/u/???";

int SENDING_FREQUENCY = 3;
int SENDING_DB_FREQUENCY = 3;
unsigned char SENDING_FREQUENCY = 3;
unsigned char SENDING_DB_FREQUENCY = 3;
bool DEEPSLEEP_ON = false;

bool DEBUG = false;
#ifdef ARDUINO_ARCH_ESP8266
bool AUTOUPDATE_ON = false;
bool AUTOUPDATE_ON = true;
#elif defined ARDUINO_ARCH_ESP32
bool AUTOUPDATE_ON = true;
#endif

bool CONFIG_AUTH = false;
char CONFIG_USERNAME[64] = "admin";
char CONFIG_PASSWORD[256] = "password";
char CONFIG_PASSWORD[128] = "password";

char MODEL[32] = "white";
char MODEL[12] = "white";
float calib1 = 1.0;
float calib2 = 1.0;

bool HOMEKIT_SUPPORT = false;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit cf57b1c

Please sign in to comment.