Skip to content

Commit

Permalink
Merge pull request #1024 from opendata-stuttgart/beta
Browse files Browse the repository at this point in the history
beta to master
  • Loading branch information
ricki-z authored Apr 6, 2024
2 parents 9dc77cf + fe4ec5b commit 2008a38
Show file tree
Hide file tree
Showing 48 changed files with 5,078 additions and 1,180 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/airohr-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
name: Airrohr Firmware CI
on:
push:
branches: [ master, beta, feature/** ]
branches: [ master, beta*, feature/** ]
pull_request:
branches: [ master, beta ]
branches: [ master, beta* ]
create:
branches: [ master, beta ]
branches: [ master, beta* ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.11'
- name: Load dependencies from cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand All @@ -32,22 +32,26 @@ jobs:
python3 -m pip install --upgrade pip
pip3 install platformio
platformio --version
- name: Run builds
- name: Run airrohr-firmware builds
run: |
cd airrohr-firmware && pwd && ls -l && platformio run && ls -l builds/
cd ../airrohr-update-loader && pwd && ls -l && platformio run && ls -l builds/
- name: Run update-loader build
if: contains(github.ref_name,'esp32') == false
run: |
cd airrohr-update-loader && pwd && ls -l && platformio run && ls -l builds/
- name: Tar Results
run: |
tar czvf airrohr-firmware-builds.tar.gz -C airrohr-firmware/builds/ .
- name: Store airrohr-firmware
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: airrohr-firmware-builds
path: airrohr-firmware-builds.tar.gz
retention-days: 30
- name: Store update-loader
uses: actions/upload-artifact@v2
if: contains(github.ref_name,'esp32') == false
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: airrohr-update-loader
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ esp8266-arduino/.DS_Store
.DS_Store

compile_mac.sh


# Visual Studio Code
.vscode
.vs
37 changes: 28 additions & 9 deletions airrohr-firmware/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ Additional Libraries needed for building:

## Source Layout

| Dateiname | Beschreibung |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `airrohr-firmware.ino` | Sourcecode der eigentlichen Firmware |
| `ext_def.h` | grundsätzliche Konfiguration der Parameter (WLAN, Sensoren, APIs) |
| `html-content.h` | allgemeine HTML-Sourcen und Bilder für HTML- und Text-Ausgaben |
| `intl_xx.h` | Dateien mit übersetzten Texten für die Internationalisierung, 'xx' ist der 2 letter ISO code der 'Sprache' |
| `intl_template.h` | Vorlage für Übersetzungen |
| `astyle.rc` | Formatierungsvorlage für Astyle |
| `ppd42ns-wificonfig-ppd-sds-dht.spiffs.bin` | Binary mit leerem Dateisystem, zum Löschen der Konfiguration, siehe Anleitung im Wiki |
| File | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `airrohr-firmware.ino` | Source code of the actual firmware |
| `ext_def.h` | Basic configuration of the parameters (WLAN, sensors, APIs) |
| `html-content.h` | General HTML sources and images for HTML and text output |
| `intl_xx.h` | Files with translated texts for internationalization, 'xx' is the 2 letter ISO code of the 'language' |
| `intl_template.h` | Template for translations |
| `astyle.rc` | Formatting template for Astyle |
| `ppd42ns-wificonfig-ppd-sds-dht.spiffs.bin` | Binary with an empty file system, to delete the configuration, see the instructions in the wiki |


## Translations
Expand All @@ -98,6 +98,25 @@ Please take look at the existing translations and try to adhere and improve
consistency accross and within the particular translation.


## Reference list of all known I2C addresses used by the I2C device by instances that **Airrohr Firmware** is aware of


| Device | Class | Address declaration | Declaration location | I2C address(es) |
| --------------| ------------------ | -----------------------------| --------------------------------- | ------------------------------------ |
| LCD 1602 | LiquidCrystal_I2C | - | `airrohr-firmware.ino` row 4024 | 0x27 or 0x3F |
| LCD 2004 | LiquidCrystal_I2C | - | `airrohr-firmware.ino` row 4033 | 0x27 or 0x3F |
| HTU21D | Adafruit_HTU21DF | HTU21DF_I2CADDR(0x40) | `Adafruit_HTU21DF.h` | 0x40 |
| SHT31 | Adafruit_SHT31 | SHT31_DEFAULT_ADDR 0x44 | `Adafruit_STH31.h` | 0x44 |
| DNMS | - | DNMS_I2C_ADDRESS 0x55 | `dnms_i2c.h` | 0x55 |
| SCD30 | SCD30 | SCD30_ADDRESS 0x61 | `SparkFun_SCD30_Arduino_Library.h`| 0x61 |
| SPS30 | - | SPS_I2C_ADDRESS0x69 | `sps30_i2c.h` | 0x69 |
| BMP280 | BMX280 | const | `airrohr-firmware.ino` | 0x77 (default) or 0x76 |
| BME280 | BMX280 | const | `airrohr-firmware.ino` | 0x77 (default) or 0x76 |
| BM085: | Adafruit_BMP085 | BMP085_I2CADDR 0x77 | `Adafruit_BM085.h` | 0x77 |
| BM180: | Adafruit_BMP085 | BMP085_I2CADDR 0x77 | `Adafruit_BM085.h` | 0x77 |

Do not forget to update the table above when you are implementing a new I2C device.

## TODOs

* [Bug fixes](https://github.com/opendata-stuttgart/sensors-software/issues?q=is%3Aopen+label%3Abug+sort%3Aupdated-desc)
Expand Down
37 changes: 37 additions & 0 deletions airrohr-firmware/Versions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
NRZ-2024-134-B5
* Go back to Arduino Core 2.7.4 as a workaround for stalling OTA downloads
* Change setting of compiler optimization to -O3 for better performance
* Replace LetsEncrypt DST Root CA X3 with ISRG Root X1 certificate
* Language updates and fixes
* Add displaying errors with config parsing and network connections
* Minor bug fixes and cosmetics
* Update Github Actions CI workflow

NRZ-2021-134-B4
* Added Tera Sensor Next PM fulltime support
* Added Piera Systems IPS-7100 support
* Implement power save feature (experimental)
* Minor improvements to config page
* Decrease GPS update interval
* Update various translations
* Contribution.md: Added Information of all known I2C addresses and the devices behind that the firmware is aware of
* more SCD30 info on status page
* Some ciphers removed (MD5,3DES)
* Upgrade to Arduino Core 3.0.1
* Libraries updated
* changes for compatibility to latest ArduinoJSON
* more BearSSL ciphers enabled (ECDSA certs, AES-GCM-SHA + CHACHA20 ciphers)
* SCD autocalibration status now shown on status page

NRZ-2020-134-B3
* support for SCD30 added

NRZ-2020-134-B2
* dew point added
* pressure at sea level added
* additional languages (via DeepL)
* static IP config

NRZ-2020-134-B1
* next beta version

NRZ-2020-133
online since 2020-11-29
* same as NRZ-2020-132-B3
Expand Down
27 changes: 27 additions & 0 deletions airrohr-firmware/airrohr-cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ enum ConfigShapeId {
Config_pms_read,
Config_hpm_read,
Config_npm_read,
Config_npm_fulltime,
Config_ips_read,
Config_sps30_read,
Config_bmp_read,
Config_bmx280_read,
Config_sht3x_read,
Config_scd30_read,
Config_ds18b20_read,
Config_dnms_read,
Config_dnms_correction,
Config_temp_correction,
Config_height_above_sealevel,
Config_gps_read,
Config_send2dusti,
Config_ssl_dusti,
Expand All @@ -68,9 +72,14 @@ enum ConfigShapeId {
Config_has_lcd2004_27,
Config_display_wifi_info,
Config_display_device_info,
Config_static_ip,
Config_static_subnet,
Config_static_gateway,
Config_static_dns,
Config_debug,
Config_sending_intervall_ms,
Config_time_for_wifi_config,
Config_powersave,
Config_senseboxid,
Config_send2custom,
Config_host_custom,
Expand Down Expand Up @@ -103,14 +112,18 @@ static constexpr char CFG_KEY_SDS_READ[] PROGMEM = "sds_read";
static constexpr char CFG_KEY_PMS_READ[] PROGMEM = "pms_read";
static constexpr char CFG_KEY_HPM_READ[] PROGMEM = "hpm_read";
static constexpr char CFG_KEY_NPM_READ[] PROGMEM = "npm_read";
static constexpr char CFG_KEY_NPM_FULLTIME[] PROGMEM = "npm_fulltime";
static constexpr char CFG_KEY_IPS_READ[] PROGMEM = "ips_read";
static constexpr char CFG_KEY_SPS30_READ[] PROGMEM = "sps30_read";
static constexpr char CFG_KEY_BMP_READ[] PROGMEM = "bmp_read";
static constexpr char CFG_KEY_BMX280_READ[] PROGMEM = "bmx280_read";
static constexpr char CFG_KEY_SHT3X_READ[] PROGMEM = "sht3x_read";
static constexpr char CFG_KEY_SCD30_READ[] PROGMEM = "scd30_read";
static constexpr char CFG_KEY_DS18B20_READ[] PROGMEM = "ds18b20_read";
static constexpr char CFG_KEY_DNMS_READ[] PROGMEM = "dnms_read";
static constexpr char CFG_KEY_DNMS_CORRECTION[] PROGMEM = "dnms_correction";
static constexpr char CFG_KEY_TEMP_CORRECTION[] PROGMEM = "temp_correction";
static constexpr char CFG_KEY_HEIGHT_ABOVE_SEALEVEL[] PROGMEM = "height_above_sealevel";
static constexpr char CFG_KEY_GPS_READ[] PROGMEM = "gps_read";
static constexpr char CFG_KEY_SEND2DUSTI[] PROGMEM = "send2dusti";
static constexpr char CFG_KEY_SSL_DUSTI[] PROGMEM = "ssl_dusti";
Expand All @@ -131,9 +144,14 @@ static constexpr char CFG_KEY_HAS_LCD2004[] PROGMEM = "has_lcd2004";
static constexpr char CFG_KEY_HAS_LCD2004_27[] PROGMEM = "has_lcd2004_27";
static constexpr char CFG_KEY_DISPLAY_WIFI_INFO[] PROGMEM = "display_wifi_info";
static constexpr char CFG_KEY_DISPLAY_DEVICE_INFO[] PROGMEM = "display_device_info";
static constexpr char CFG_KEY_STATIC_IP[] PROGMEM = "static_ip";
static constexpr char CFG_KEY_STATIC_SUBNET[] PROGMEM = "static_subnet";
static constexpr char CFG_KEY_STATIC_GATEWAY[] PROGMEM = "static_gateway";
static constexpr char CFG_KEY_STATIC_DNS[] PROGMEM = "static_dns";
static constexpr char CFG_KEY_DEBUG[] PROGMEM = "debug";
static constexpr char CFG_KEY_SENDING_INTERVALL_MS[] PROGMEM = "sending_intervall_ms";
static constexpr char CFG_KEY_TIME_FOR_WIFI_CONFIG[] PROGMEM = "time_for_wifi_config";
static constexpr char CFG_KEY_POWERSAVE[] PROGMEM = "powersave";
static constexpr char CFG_KEY_SENSEBOXID[] PROGMEM = "senseboxid";
static constexpr char CFG_KEY_SEND2CUSTOM[] PROGMEM = "send2custom";
static constexpr char CFG_KEY_HOST_CUSTOM[] PROGMEM = "host_custom";
Expand Down Expand Up @@ -166,14 +184,18 @@ static constexpr ConfigShapeEntry configShape[] PROGMEM = {
{ Config_Type_Bool, 0, CFG_KEY_PMS_READ, &cfg::pms_read },
{ Config_Type_Bool, 0, CFG_KEY_HPM_READ, &cfg::hpm_read },
{ Config_Type_Bool, 0, CFG_KEY_NPM_READ, &cfg::npm_read },
{ Config_Type_Bool, 0, CFG_KEY_NPM_FULLTIME, &cfg::npm_fulltime },
{ Config_Type_Bool, 0, CFG_KEY_IPS_READ, &cfg::ips_read },
{ Config_Type_Bool, 0, CFG_KEY_SPS30_READ, &cfg::sps30_read },
{ Config_Type_Bool, 0, CFG_KEY_BMP_READ, &cfg::bmp_read },
{ Config_Type_Bool, 0, CFG_KEY_BMX280_READ, &cfg::bmx280_read },
{ Config_Type_Bool, 0, CFG_KEY_SHT3X_READ, &cfg::sht3x_read },
{ Config_Type_Bool, 0, CFG_KEY_SCD30_READ, &cfg::scd30_read },
{ Config_Type_Bool, 0, CFG_KEY_DS18B20_READ, &cfg::ds18b20_read },
{ Config_Type_Bool, 0, CFG_KEY_DNMS_READ, &cfg::dnms_read },
{ Config_Type_String, sizeof(cfg::dnms_correction)-1, CFG_KEY_DNMS_CORRECTION, cfg::dnms_correction },
{ Config_Type_String, sizeof(cfg::temp_correction)-1, CFG_KEY_TEMP_CORRECTION, cfg::temp_correction },
{ Config_Type_String, sizeof(cfg::height_above_sealevel)-1, CFG_KEY_HEIGHT_ABOVE_SEALEVEL, cfg::height_above_sealevel },
{ Config_Type_Bool, 0, CFG_KEY_GPS_READ, &cfg::gps_read },
{ Config_Type_Bool, 0, CFG_KEY_SEND2DUSTI, &cfg::send2dusti },
{ Config_Type_Bool, 0, CFG_KEY_SSL_DUSTI, &cfg::ssl_dusti },
Expand All @@ -194,9 +216,14 @@ static constexpr ConfigShapeEntry configShape[] PROGMEM = {
{ Config_Type_Bool, 0, CFG_KEY_HAS_LCD2004_27, &cfg::has_lcd2004_27 },
{ Config_Type_Bool, 0, CFG_KEY_DISPLAY_WIFI_INFO, &cfg::display_wifi_info },
{ Config_Type_Bool, 0, CFG_KEY_DISPLAY_DEVICE_INFO, &cfg::display_device_info },
{ Config_Type_String, sizeof(cfg::static_ip)-1, CFG_KEY_STATIC_IP, cfg::static_ip },
{ Config_Type_String, sizeof(cfg::static_subnet)-1, CFG_KEY_STATIC_SUBNET, cfg::static_subnet },
{ Config_Type_String, sizeof(cfg::static_gateway)-1, CFG_KEY_STATIC_GATEWAY, cfg::static_gateway },
{ Config_Type_String, sizeof(cfg::static_dns)-1, CFG_KEY_STATIC_DNS, cfg::static_dns },
{ Config_Type_UInt, 0, CFG_KEY_DEBUG, &cfg::debug },
{ Config_Type_Time, 0, CFG_KEY_SENDING_INTERVALL_MS, &cfg::sending_intervall_ms },
{ Config_Type_Time, 0, CFG_KEY_TIME_FOR_WIFI_CONFIG, &cfg::time_for_wifi_config },
{ Config_Type_Bool, 0, CFG_KEY_POWERSAVE, &cfg::powersave },
{ Config_Type_String, sizeof(cfg::senseboxid)-1, CFG_KEY_SENSEBOXID, cfg::senseboxid },
{ Config_Type_Bool, 0, CFG_KEY_SEND2CUSTOM, &cfg::send2custom },
{ Config_Type_String, sizeof(cfg::host_custom)-1, CFG_KEY_HOST_CUSTOM, cfg::host_custom },
Expand Down
9 changes: 9 additions & 0 deletions airrohr-firmware/airrohr-cfg.h.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
Bool pms_read
Bool hpm_read
Bool npm_read
Bool npm_fulltime
Bool ips_read
Bool sps30_read
Bool bmp_read
Bool bmx280_read
Bool sht3x_read
Bool scd30_read
Bool ds18b20_read
Bool dnms_read
String dnms_correction
String temp_correction
String height_above_sealevel
Bool gps_read
Bool send2dusti
Bool ssl_dusti
Expand All @@ -44,9 +48,14 @@
Bool has_lcd2004_27
Bool display_wifi_info
Bool display_device_info
String static_ip
String static_subnet
String static_gateway
String static_dns
UInt debug
Time sending_intervall_ms
Time time_for_wifi_config
Bool powersave
String senseboxid
Bool send2custom
String host_custom
Expand Down
Loading

0 comments on commit 2008a38

Please sign in to comment.