From 682fbe3bec678565b66d8b46a97fb355314f4716 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sun, 6 Dec 2020 19:02:11 +0200 Subject: [PATCH 01/20] Added Battery monitor functionality --- .gitignore | 4 + airrohr-firmware/airrohr-cfg.h | 12 +++ airrohr-firmware/airrohr-cfg.h.py | 4 + airrohr-firmware/airrohr-firmware.ino | 123 +++++++++++++++++++++++++- airrohr-firmware/defines.h | 2 + airrohr-firmware/ext_def.h | 17 +++- airrohr-firmware/html-content.h | 2 + airrohr-firmware/intl_bg.h | 5 ++ airrohr-firmware/intl_cz.h | 5 ++ airrohr-firmware/intl_de.h | 5 ++ airrohr-firmware/intl_dk.h | 5 ++ airrohr-firmware/intl_en.h | 5 ++ airrohr-firmware/intl_es.h | 5 ++ airrohr-firmware/intl_fr.h | 5 ++ airrohr-firmware/intl_hu.h | 5 ++ airrohr-firmware/intl_it.h | 5 ++ airrohr-firmware/intl_lu.h | 5 ++ airrohr-firmware/intl_nl.h | 5 ++ airrohr-firmware/intl_pl.h | 5 ++ airrohr-firmware/intl_pt.h | 5 ++ airrohr-firmware/intl_rs.h | 5 ++ airrohr-firmware/intl_ru.h | 5 ++ airrohr-firmware/intl_se.h | 5 ++ airrohr-firmware/intl_sk.h | 5 ++ airrohr-firmware/intl_template.h | 5 ++ airrohr-firmware/intl_tr.h | 5 ++ airrohr-firmware/intl_ua.h | 5 ++ 27 files changed, 262 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 975916175..8fcbed29d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ esp8266-arduino/.DS_Store .DS_Store compile_mac.sh + + +# Visual Studio Code +.vscode \ No newline at end of file diff --git a/airrohr-firmware/airrohr-cfg.h b/airrohr-firmware/airrohr-cfg.h index 26c7afcdd..c64fb3f1e 100644 --- a/airrohr-firmware/airrohr-cfg.h +++ b/airrohr-firmware/airrohr-cfg.h @@ -87,6 +87,10 @@ enum ConfigShapeId { Config_pwd_influx, Config_measurement_name_influx, Config_ssl_influx, + Config_enable_battery_monitor, + Config_battery_u_min, + Config_battery_u_max, + Config_adc_divider_u_max, }; static constexpr char CFG_KEY_CURRENT_LANG[] PROGMEM = "current_lang"; static constexpr char CFG_KEY_WLANSSID[] PROGMEM = "wlanssid"; @@ -150,6 +154,10 @@ static constexpr char CFG_KEY_USER_INFLUX[] PROGMEM = "user_influx"; static constexpr char CFG_KEY_PWD_INFLUX[] PROGMEM = "pwd_influx"; static constexpr char CFG_KEY_MEASUREMENT_NAME_INFLUX[] PROGMEM = "measurement_name_influx"; static constexpr char CFG_KEY_SSL_INFLUX[] PROGMEM = "ssl_influx"; +static constexpr char CFG_KEY_ENABLE_BATTERY_MONITOR[] PROGMEM = "enable_battery_monitor"; +static constexpr char CFG_KEY_BATTERY_U_MIN[] PROGMEM = "battery_u_min"; +static constexpr char CFG_KEY_BATTERY_U_MAX[] PROGMEM = "battery_u_max"; +static constexpr char CFG_KEY_ADC_DIVIDER_U_MAX[] PROGMEM = "adc_divider_u_max"; static constexpr ConfigShapeEntry configShape[] PROGMEM = { { Config_Type_String, sizeof(cfg::current_lang)-1, CFG_KEY_CURRENT_LANG, cfg::current_lang }, { Config_Type_String, sizeof(cfg::wlanssid)-1, CFG_KEY_WLANSSID, cfg::wlanssid }, @@ -213,4 +221,8 @@ static constexpr ConfigShapeEntry configShape[] PROGMEM = { { Config_Type_Password, sizeof(cfg::pwd_influx)-1, CFG_KEY_PWD_INFLUX, cfg::pwd_influx }, { Config_Type_String, sizeof(cfg::measurement_name_influx)-1, CFG_KEY_MEASUREMENT_NAME_INFLUX, cfg::measurement_name_influx }, { Config_Type_Bool, 0, CFG_KEY_SSL_INFLUX, &cfg::ssl_influx }, + { Config_Type_Bool, 0, CFG_KEY_ENABLE_BATTERY_MONITOR, &cfg::enable_battery_monitor }, + { Config_Type_UInt, 0, CFG_KEY_BATTERY_U_MIN, &cfg::battery_u_min }, + { Config_Type_UInt, 0, CFG_KEY_BATTERY_U_MAX, &cfg::battery_u_max }, + { Config_Type_UInt, 0, CFG_KEY_ADC_DIVIDER_U_MAX, &cfg::adc_divider_u_max }, }; diff --git a/airrohr-firmware/airrohr-cfg.h.py b/airrohr-firmware/airrohr-cfg.h.py index 152b4e459..21362f800 100755 --- a/airrohr-firmware/airrohr-cfg.h.py +++ b/airrohr-firmware/airrohr-cfg.h.py @@ -63,6 +63,10 @@ Password pwd_influx String measurement_name_influx Bool ssl_influx +Bool enable_battery_monitor +UInt battery_u_min +UInt battery_u_max +UInt adc_divider_u_max """ with open("airrohr-cfg.h", "w") as h: diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 23a12611b..6d364dcb3 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -47,6 +47,10 @@ * * ************************************************************************ * + * latest with lib 2.7.1 + * DATA: [==== ] 39.5% (used 32380 bytes from 81920 bytes) + * PROGRAM: [===== ] 56.0% (used 584924 bytes from 1044464 bytes) + * * latest mit lib 2.6.1 * DATA: [==== ] 40.7% (used 33316 bytes from 81920 bytes) * PROGRAM: [===== ] 49.3% (used 514788 bytes from 1044464 bytes) @@ -196,6 +200,15 @@ namespace cfg { bool display_wifi_info = DISPLAY_WIFI_INFO; bool display_device_info = DISPLAY_DEVICE_INFO; + // ADC settings + unsigned adc_divider_u_max = ADC_DIVIDER_U_MAX; + unsigned adc_range_max = ADC_RANGE_MAX; + + // battery monitor measurement settings + bool enable_battery_monitor = ENABLE_BATTERY_MONITOR; + unsigned battery_u_max = BATTERY_U_MAX; + unsigned battery_u_min = BATTERY_U_MIN; + // API settings bool ssl_madavi = SSL_MADAVI; bool ssl_dusti = SSL_SENSORCOMMUNITY; @@ -345,6 +358,8 @@ unsigned long act_milli; unsigned long last_micro = 0; unsigned long min_micro = 1000000000; unsigned long max_micro = 0; +unsigned long battery_start_time; +unsigned long battery_monitor_period; bool is_SDS_running = true; enum { @@ -472,6 +487,12 @@ String last_data_string; int last_signal_strength; int last_disconnect_reason; +uint32_t battery_analog_value = 0; +uint32_t battery_capacity = 0; +uint32_t battery_last_value = 0; +uint32_t battery_sum = 0; +uint32_t battery_val_count = 0; + String esp_chipid; String esp_mac_id; String last_value_SDS_version; @@ -1093,6 +1114,33 @@ static void webserver_config_send_body_get(String& page_content) { add_form_checkbox(Config_display_device_info, FPSTR(INTL_DISPLAY_DEVICE_INFO)); server.sendContent(page_content); + page_content = emptyString; + + add_form_checkbox(Config_enable_battery_monitor, FPSTR(INTL_ENABLE_BATTERY_MONITOR)); + page_content += F(""); + add_form_input(page_content, Config_battery_u_min, FPSTR(INTL_BATTERY_U_MIN), 5); + add_form_input(page_content, Config_battery_u_max, FPSTR(INTL_BATTERY_U_MAX), 5); + add_form_input(page_content, Config_adc_divider_u_max, FPSTR(INTL_ADC_DIVIDER_U_MAX), 5); + page_content += FPSTR(TABLE_TAG_CLOSE_BR); + + page_content += F(""); + + server.sendContent(page_content); + //page_content = emptyString; page_content = FPSTR(WEB_BR_LF_B); page_content += F(INTL_FIRMWARE " "); add_form_checkbox(Config_auto_update, FPSTR(INTL_AUTO_UPDATE)); @@ -1590,6 +1638,11 @@ static void webserver_status() { page_content += FPSTR(EMPTY_ROW); add_table_row_from_value(page_content, FPSTR(SENSORS_SDS011), last_value_SDS_version); } + if (cfg::enable_battery_monitor){ + // String battery_state = F(String(battery_capacity) + " % (" + String(battery_analog_value / 1000.0) + "V)"); + String battery_state = String(battery_capacity) + " % (" + String(battery_analog_value / 1000.0) + "V)"; + add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CAPACITY), battery_state); + } page_content += FPSTR(EMPTY_ROW); page_content += F(""); @@ -3235,6 +3288,58 @@ static void fetchSensorSPS30(String& s) { debug_outln_verbose(FPSTR(DBG_TXT_END_READING), FPSTR(SENSORS_SPS30)); } +long battery_map(long x, long in_min, long in_max, long out_min, long out_max){ + return (x - in_min) * (out_max - out_min + 1) / (in_max - in_min + 1) + out_min; +} + +/***************************************************************** + read Battery voltage + *****************************************************************/ +static void readBatteryVoltage() { + battery_val_count++; + if(battery_val_count > 3){ + battery_sum = 0; + battery_last_value = 0; + if(msSince(battery_monitor_period) <= READINGTIME_ADC_MS) + return; + + battery_monitor_period = act_milli; + battery_val_count = 0; + return; + } + + String dbg_reading = "Battery voltage #" + String(battery_val_count); + debug_outln_verbose(FPSTR(DBG_TXT_START_READING), dbg_reading); + battery_last_value = analogRead(ADC_PIN); + battery_sum += battery_last_value; + + float battery_avg_value = battery_sum / static_cast(battery_val_count); + float ratio = cfg::adc_divider_u_max / static_cast(cfg::adc_range_max); + battery_analog_value = round(battery_avg_value * ratio); + debug_outln_verbose(F("Battery analog value (mV): "), String(battery_analog_value)); + String bat_min_max = String(cfg::battery_u_min) + " / " + String(cfg::battery_u_max); + battery_capacity = map(battery_analog_value, cfg::battery_u_min, cfg::battery_u_max, 0, 100); + if (battery_capacity < 0){ + battery_capacity = 0; + } + debug_outln_verbose(F("Battery capacity (%): "), String(battery_capacity)); + debug_outln_verbose(FPSTR(DBG_TXT_END_READING), F("Battery voltage")); + + battery_monitor_period = act_milli; +} + +/***************************************************************** + send Battery status + *****************************************************************/ +static void sendBatteryStatus(String& s) { + float battery_voltage = battery_analog_value / 1000.0; + add_Value2Json(s, F("Battery_voltage"), String(battery_voltage)); + add_Value2Json(s, F("Battery_capacity"), String(battery_capacity)); + debug_outln_info(F("Battery (V): "), String(battery_voltage)); + debug_outln_info(F("Battery (%): "), String(battery_capacity)); + debug_outln_info(FPSTR(DBG_TXT_SEP)); +} + /***************************************************************** read DNMS values *****************************************************************/ @@ -4264,6 +4369,7 @@ void setup(void) { esp_mac_id.replace(":", ""); esp_mac_id.toLowerCase(); #endif + pinMode(A0, INPUT); #if defined(ESP32) uint64_t chipid_num; chipid_num = ESP.getEfuseMac(); @@ -4310,6 +4416,7 @@ void setup(void) { starttime = millis(); // store the start time last_update_attempt = time_point_device_start_ms = starttime; last_display_millis = starttime_SDS = starttime; + battery_start_time = starttime; } /***************************************************************** @@ -4318,7 +4425,7 @@ void setup(void) { void loop(void) { String result_PPD, result_SDS, result_PMS, result_HPM; String result_GPS, result_DNMS; - + String result_BAT; unsigned sum_send_time = 0; @@ -4373,6 +4480,14 @@ void loop(void) { } } + if(cfg::enable_battery_monitor && !send_now){ + if (msSince(battery_start_time) > SAMPLETIME_BAT_MS){ + battery_start_time = act_milli; + readBatteryVoltage(); + //readBatteryVoltage(result_BAT); + } + } + if (cfg::ppd_read) { fetchSensorPPD(result_PPD); } @@ -4500,12 +4615,18 @@ void loop(void) { sum_send_time += sendSensorCommunity(result_GPS, GPS_API_PIN, F("GPS"), "GPS_"); result = emptyString; } + add_Value2Json(data, F("samples"), String(sample_count)); add_Value2Json(data, F("min_micro"), String(min_micro)); add_Value2Json(data, F("max_micro"), String(max_micro)); add_Value2Json(data, F("interval"), String(cfg::sending_intervall_ms)); add_Value2Json(data, F("signal"), String(last_signal_strength)); + if(cfg::enable_battery_monitor){ + sendBatteryStatus(result_BAT); + data += result_BAT; + } + if ((unsigned)(data.lastIndexOf(',') + 1) == data.length()) { data.remove(data.length() - 1); } diff --git a/airrohr-firmware/defines.h b/airrohr-firmware/defines.h index ea957fae6..3ca569368 100644 --- a/airrohr-firmware/defines.h +++ b/airrohr-firmware/defines.h @@ -56,6 +56,8 @@ constexpr const unsigned long DISPLAY_UPDATE_INTERVAL_MS = 5000; // time be constexpr const unsigned long ONE_DAY_IN_MS = 24 * 60 * 60 * 1000; constexpr const unsigned long PAUSE_BETWEEN_UPDATE_ATTEMPTS_MS = ONE_DAY_IN_MS; // check for firmware updates once a day constexpr const unsigned long DURATION_BEFORE_FORCED_RESTART_MS = ONE_DAY_IN_MS * 28; // force a reboot every ~4 weeks +constexpr const unsigned long READINGTIME_ADC_MS = 10000; +constexpr const unsigned long SAMPLETIME_BAT_MS = 1000; // Definition GPIOs for Zero based Arduino Feather M0 LoRaWAN #if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL) diff --git a/airrohr-firmware/ext_def.h b/airrohr-firmware/ext_def.h index 60842f195..19e183d47 100644 --- a/airrohr-firmware/ext_def.h +++ b/airrohr-firmware/ext_def.h @@ -125,6 +125,9 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; // PPD42NS, the cheaper version of the particle sensor #define PPD_PIN_PM1 GPS_SERIAL_TX #define PPD_PIN_PM2 GPS_SERIAL_RX + +#define ADC_PIN A0 +#define ADC_RANGE_MAX 1023; #endif @@ -163,6 +166,9 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; //#define RFM69_CS D0 //#define RFM69_RST D2 //#define RFM69_INT D4 + +#define ADC_PIN 36 +#define ADC_RANGE_MAX 4095; #endif // === pin assignments for lolin_d32_pro board =================================== @@ -283,7 +289,7 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; #define MHZ19_READ 0 // automatic firmware updates -#define AUTO_UPDATE 1 +#define AUTO_UPDATE 0 // use beta firmware #define USE_BETA 0 @@ -315,5 +321,14 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; // Show device info on displays #define DISPLAY_DEVICE_INFO 1 +#define ENABLE_BATTERY_MONITOR 0 + +// Adc maximum input voltage applied to the resistor devider's input +#define ADC_DIVIDER_U_MAX 5120 + +// Battery fully charged and fully discharged voltages +#define BATTERY_U_MAX 4200 +#define BATTERY_U_MIN 2800 + // Set debug level for serial output? #define DEBUG 3 diff --git a/airrohr-firmware/html-content.h b/airrohr-firmware/html-content.h index 5515f58e5..ae35292ca 100644 --- a/airrohr-firmware/html-content.h +++ b/airrohr-firmware/html-content.h @@ -22,6 +22,8 @@ const char DBG_TXT_CONNECTING_TO[] PROGMEM = "Connecting to "; const char DBG_TXT_FOUND[] PROGMEM = " ... found"; const char DBG_TXT_NOT_FOUND[] PROGMEM = " ... not found"; const char DBG_TXT_SEP[] PROGMEM = "----"; +const char DBG_TXT_VOLTAGE[] PROGMEM = "Voltage (V): "; +const char DBG_TXT_CAPACITY[] PROGMEM = "Capacity (%): "; const char SENSORS_SDS011[] PROGMEM = "SDS011"; const char SENSORS_PPD42NS[] PROGMEM = "PPD42NS"; diff --git a/airrohr-firmware/intl_bg.h b/airrohr-firmware/intl_bg.h index d5e7c0a5c..4768a1914 100644 --- a/airrohr-firmware/intl_bg.h +++ b/airrohr-firmware/intl_bg.h @@ -112,6 +112,11 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество на сигнала #define INTL_SENSOR "Сензор" #define INTL_PARAMETER "Параметър" #define INTL_VALUE "Стойност" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активиране на монитора на батерията"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Капацитет на батерията"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерията (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерията (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; //const char LUFTDATEN_INFO_LOGO_SVG[] PROGMEM = ""; diff --git a/airrohr-firmware/intl_cz.h b/airrohr-firmware/intl_cz.h index 0ae50774e..7b662f1db 100644 --- a/airrohr-firmware/intl_cz.h +++ b/airrohr-firmware/intl_cz.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalita signálu"; #define INTL_SENSOR "Modul" #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Hodnota" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povolit sledování baterie"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Kapacita baterie"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterie U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterie U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Dělič ADP U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_de.h b/airrohr-firmware/intl_de.h index 2fff3b6de..8d77d85fb 100644 --- a/airrohr-firmware/intl_de.h +++ b/airrohr-firmware/intl_de.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualität"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wert" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Batteriemonitor aktivieren"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batteriekapazität"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADW teiler U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_dk.h b/airrohr-firmware/intl_dk.h index cc5e7a7d6..5e8953ea6 100644 --- a/airrohr-firmware/intl_dk.h +++ b/airrohr-firmware/intl_dk.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Værdi" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivér batteriskærm"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterikapacitet"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADK divider U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_en.h b/airrohr-firmware/intl_en.h index 76a43f994..dca558b61 100644 --- a/airrohr-firmware/intl_en.h +++ b/airrohr-firmware/intl_en.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signal quality"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Value" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Battery capacity"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_es.h b/airrohr-firmware/intl_es.h index d488d492b..e966a4f6d 100644 --- a/airrohr-firmware/intl_es.h +++ b/airrohr-firmware/intl_es.h @@ -112,5 +112,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Calidad de Señal"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parámetro" #define INTL_VALUE "Valor" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de batería"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacidad de la batería"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batería U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batería U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Divisor CAD U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_fr.h b/airrohr-firmware/intl_fr.h index bfcebd4c2..8ffe419f8 100644 --- a/airrohr-firmware/intl_fr.h +++ b/airrohr-firmware/intl_fr.h @@ -112,5 +112,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualité du signal"; #define INTL_SENSOR "Capteur" #define INTL_PARAMETER "Paramètres" #define INTL_VALUE "Valeur" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Activer le moniteur de batterie"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacité de la batterie"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Diviseur de CAN U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_hu.h b/airrohr-firmware/intl_hu.h index b34c91f00..2a3398174 100644 --- a/airrohr-firmware/intl_hu.h +++ b/airrohr-firmware/intl_hu.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jelminőség"; #define INTL_SENSOR "Szenzor" #define INTL_PARAMETER "Paraméter" #define INTL_VALUE "Érték" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Engedélyezze az akkumulátorfigyelőt"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Akkumulátor-kapacitás"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Akkumulátor U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Akkumulátor U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADA elválasztó U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_it.h b/airrohr-firmware/intl_it.h index 87725a8f3..bbf5842a3 100644 --- a/airrohr-firmware/intl_it.h +++ b/airrohr-firmware/intl_it.h @@ -112,5 +112,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualità del segnale"; #define INTL_SENSOR "Sensore" #define INTL_PARAMETER "Parametro" #define INTL_VALUE "Valore" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Abilita il monitoraggio della batteria"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacità della batteria"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteria U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteria U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisore U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lu.h b/airrohr-firmware/intl_lu.h index bbe1cf65f..b19c1e136 100644 --- a/airrohr-firmware/intl_lu.h +++ b/airrohr-firmware/intl_lu.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualitéit"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wäert" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivéiert Batterie Monitor"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batteriekapazitéit"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_nl.h b/airrohr-firmware/intl_nl.h index 54f1bf3fc..f53fc3cfe 100644 --- a/airrohr-firmware/intl_nl.h +++ b/airrohr-firmware/intl_nl.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Signaalkwaliteit"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Waarde" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Schakel de batterijmonitor in"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterij capaciteit"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "batterij U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "batterij U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADO divider U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_pl.h b/airrohr-firmware/intl_pl.h index 7945eb298..389ec2169 100644 --- a/airrohr-firmware/intl_pl.h +++ b/airrohr-firmware/intl_pl.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jakość sygnału"; #define INTL_SENSOR "Czujnik" #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Wartość" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Włącz monitor baterii"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Pojemność baterii"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ACP dzielnik U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_pt.h b/airrohr-firmware/intl_pt.h index af8e588d5..e53a04dbb 100644 --- a/airrohr-firmware/intl_pt.h +++ b/airrohr-firmware/intl_pt.h @@ -112,5 +112,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualidade do Sinal"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parâmetro" #define INTL_VALUE "Valor" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de bateria"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacidade de carga"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisor U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_rs.h b/airrohr-firmware/intl_rs.h index de939b926..c099b86f3 100644 --- a/airrohr-firmware/intl_rs.h +++ b/airrohr-firmware/intl_rs.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalitet signala"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parametar" #define INTL_VALUE "Vrednost" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активирајте монитор батерије"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Капацитет батерије"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерије (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерије (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "АДП разделник U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ru.h b/airrohr-firmware/intl_ru.h index 29984680e..3640238e1 100644 --- a/airrohr-firmware/intl_ru.h +++ b/airrohr-firmware/intl_ru.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество"; #define INTL_SENSOR "Датчик" #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значение" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активируйте монитор батареи"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Емкость батареи"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареи (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареи (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_se.h b/airrohr-firmware/intl_se.h index 78d062156..9ed2d99f5 100644 --- a/airrohr-firmware/intl_se.h +++ b/airrohr-firmware/intl_se.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Värde" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivera batteriövervakare"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterikapacitet"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADО divider U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_sk.h b/airrohr-firmware/intl_sk.h index 3526c45a9..9eb976115 100644 --- a/airrohr-firmware/intl_sk.h +++ b/airrohr-firmware/intl_sk.h @@ -112,5 +112,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalita signálu"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Hodnota" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povoliť sledovanie batérie"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Kapacita batérie"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Batéria U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Batéria U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADP rozdeľovač U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_template.h b/airrohr-firmware/intl_template.h index 25f0b9d0a..08f8b64f5 100644 --- a/airrohr-firmware/intl_template.h +++ b/airrohr-firmware/intl_template.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = ""; #define INTL_SENSOR "" #define INTL_PARAMETER "" #define INTL_VALUE "" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; +const char INTL_BATTERY[] PROGMEM = "Battery"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (V):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (V):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_tr.h b/airrohr-firmware/intl_tr.h index 64311bb1f..4e92650c6 100644 --- a/airrohr-firmware/intl_tr.h +++ b/airrohr-firmware/intl_tr.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "sinyal kalitesi"; #define INTL_SENSOR "algılayıcı(Sensör)" #define INTL_PARAMETER "Parametre" #define INTL_VALUE "değer" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Pil monitörünü etkinleştir"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Pil kapasitesi"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Pil U min (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Pil U max (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADD bölücü U max (mV):"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ua.h b/airrohr-firmware/intl_ua.h index b89c0fc4c..5a20f5598 100644 --- a/airrohr-firmware/intl_ua.h +++ b/airrohr-firmware/intl_ua.h @@ -113,5 +113,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "якість сигналу"; #define INTL_SENSOR "Сенсор" #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значення" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активуйте монітор батареї"; +const char INTL_BATTERY_CAPACITY[] PROGMEM = "Ємкість батареї"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареї (mV):"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареї (mV):"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при подільника на АЦП (mV):"; #include "./airrohr-logo-common.h" From ddc86c5fd4b58672738eb7ac69ee3982c861b4ca Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Tue, 8 Dec 2020 19:17:50 +0200 Subject: [PATCH 02/20] Clean-up; --- airrohr-firmware/airrohr-firmware.ino | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 59e1df5b8..d55bb43b6 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -47,13 +47,9 @@ * * ************************************************************************ * - * latest with lib 2.7.1 - * DATA: [==== ] 39.5% (used 32380 bytes from 81920 bytes) - * PROGRAM: [===== ] 56.0% (used 584924 bytes from 1044464 bytes) - * - * latest mit lib 2.6.1 - * DATA: [==== ] 40.7% (used 33316 bytes from 81920 bytes) - * PROGRAM: [===== ] 49.3% (used 514788 bytes from 1044464 bytes) + * latest mit lib 2.6.2 + * DATA: [==== ] 39.5% (used 32392 bytes from 81920 bytes) + * PROGRAM: [===== ] 53.8% (used 580740 bytes from 1044464 bytes) * latest mit lib 2.5.2 * DATA: [==== ] 39.4% (used 32304 bytes from 81920 bytes) @@ -3288,10 +3284,6 @@ static void fetchSensorSPS30(String& s) { debug_outln_verbose(FPSTR(DBG_TXT_END_READING), FPSTR(SENSORS_SPS30)); } -long battery_map(long x, long in_min, long in_max, long out_min, long out_max){ - return (x - in_min) * (out_max - out_min + 1) / (in_max - in_min + 1) + out_min; -} - /***************************************************************** read Battery voltage *****************************************************************/ From 320567ca96b10555fbcf745d9552d3bad0c6e6da Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Wed, 9 Dec 2020 21:49:10 +0200 Subject: [PATCH 03/20] Removed "adc_range_max" from "cfg" namespace; --- airrohr-firmware/airrohr-firmware.ino | 3 +-- airrohr-firmware/ext_def.h | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index d55bb43b6..044b68598 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -198,7 +198,6 @@ namespace cfg { // ADC settings unsigned adc_divider_u_max = ADC_DIVIDER_U_MAX; - unsigned adc_range_max = ADC_RANGE_MAX; // battery monitor measurement settings bool enable_battery_monitor = ENABLE_BATTERY_MONITOR; @@ -3306,7 +3305,7 @@ static void readBatteryVoltage() { battery_sum += battery_last_value; float battery_avg_value = battery_sum / static_cast(battery_val_count); - float ratio = cfg::adc_divider_u_max / static_cast(cfg::adc_range_max); + float ratio = cfg::adc_divider_u_max / static_cast(ADC_RANGE_MAX); battery_analog_value = round(battery_avg_value * ratio); debug_outln_verbose(F("Battery analog value (mV): "), String(battery_analog_value)); String bat_min_max = String(cfg::battery_u_min) + " / " + String(cfg::battery_u_max); diff --git a/airrohr-firmware/ext_def.h b/airrohr-firmware/ext_def.h index 19e183d47..4c2eca70a 100644 --- a/airrohr-firmware/ext_def.h +++ b/airrohr-firmware/ext_def.h @@ -127,7 +127,7 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; #define PPD_PIN_PM2 GPS_SERIAL_RX #define ADC_PIN A0 -#define ADC_RANGE_MAX 1023; +#define ADC_RANGE_MAX 1023 #endif @@ -168,7 +168,7 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; //#define RFM69_INT D4 #define ADC_PIN 36 -#define ADC_RANGE_MAX 4095; +#define ADC_RANGE_MAX 4095 #endif // === pin assignments for lolin_d32_pro board =================================== @@ -323,10 +323,10 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; #define ENABLE_BATTERY_MONITOR 0 -// Adc maximum input voltage applied to the resistor devider's input +// Adc preset maximum input voltage applied to the voltage devider's input #define ADC_DIVIDER_U_MAX 5120 -// Battery fully charged and fully discharged voltages +// Battery preset fully charged and discharged states voltages #define BATTERY_U_MAX 4200 #define BATTERY_U_MIN 2800 From 26e51775c86ebb6fa712479a074ecf732f5185bf Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Tue, 27 Apr 2021 15:48:09 +0300 Subject: [PATCH 04/20] Removed unused variable 'battery_last_value'; --- airrohr-firmware/airrohr-firmware.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index eb268f2cb..1b94d92fb 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -501,7 +501,7 @@ int last_disconnect_reason; uint32_t battery_analog_value = 0; uint32_t battery_capacity = 0; -uint32_t battery_last_value = 0; +// uint32_t battery_last_value = 0; uint32_t battery_sum = 0; uint32_t battery_val_count = 0; @@ -3417,7 +3417,7 @@ static void readBatteryVoltage() { battery_val_count++; if(battery_val_count > 3){ battery_sum = 0; - battery_last_value = 0; + // battery_last_value = 0; if(msSince(battery_monitor_period) <= READINGTIME_ADC_MS) return; @@ -3428,8 +3428,9 @@ static void readBatteryVoltage() { String dbg_reading = "Battery voltage #" + String(battery_val_count); debug_outln_verbose(FPSTR(DBG_TXT_START_READING), dbg_reading); - battery_last_value = analogRead(ADC_PIN); - battery_sum += battery_last_value; + battery_sum += analogRead(ADC_PIN); + // battery_last_value = analogRead(ADC_PIN); + // battery_sum += battery_last_value; float battery_avg_value = battery_sum / static_cast(battery_val_count); float ratio = cfg::adc_divider_u_max / static_cast(ADC_RANGE_MAX); From cfabfefef03d56d914f7764de34974a46325c115 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Tue, 27 Apr 2021 15:53:45 +0300 Subject: [PATCH 05/20] Cleanup - removed commented out 'battery_last_value'; --- airrohr-firmware/airrohr-firmware.ino | 4 ---- 1 file changed, 4 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 1b94d92fb..a642baf14 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -501,7 +501,6 @@ int last_disconnect_reason; uint32_t battery_analog_value = 0; uint32_t battery_capacity = 0; -// uint32_t battery_last_value = 0; uint32_t battery_sum = 0; uint32_t battery_val_count = 0; @@ -3417,7 +3416,6 @@ static void readBatteryVoltage() { battery_val_count++; if(battery_val_count > 3){ battery_sum = 0; - // battery_last_value = 0; if(msSince(battery_monitor_period) <= READINGTIME_ADC_MS) return; @@ -3429,8 +3427,6 @@ static void readBatteryVoltage() { String dbg_reading = "Battery voltage #" + String(battery_val_count); debug_outln_verbose(FPSTR(DBG_TXT_START_READING), dbg_reading); battery_sum += analogRead(ADC_PIN); - // battery_last_value = analogRead(ADC_PIN); - // battery_sum += battery_last_value; float battery_avg_value = battery_sum / static_cast(battery_val_count); float ratio = cfg::adc_divider_u_max / static_cast(ADC_RANGE_MAX); From a416c1900b2940c0a97b9622dbffb8492df6302f Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Wed, 28 Apr 2021 16:40:19 +0300 Subject: [PATCH 06/20] Replaced BATTERY_CAPACITY with BATTERY_CHARGE; Also added additional BR tag befor battery settings for better UX; --- airrohr-firmware/airrohr-firmware.ino | 21 +++++++++++---------- airrohr-firmware/intl_bg.h | 2 +- airrohr-firmware/intl_cn.h | 6 ++++++ airrohr-firmware/intl_cz.h | 2 +- airrohr-firmware/intl_de.h | 2 +- airrohr-firmware/intl_dk.h | 2 +- airrohr-firmware/intl_ee.h | 5 +++++ airrohr-firmware/intl_en.h | 2 +- airrohr-firmware/intl_es.h | 2 +- airrohr-firmware/intl_fi.h | 5 +++++ airrohr-firmware/intl_fr.h | 2 +- airrohr-firmware/intl_gr.h | 5 +++++ airrohr-firmware/intl_hu.h | 2 +- airrohr-firmware/intl_it.h | 2 +- airrohr-firmware/intl_jp.h | 5 +++++ airrohr-firmware/intl_lt.h | 5 +++++ airrohr-firmware/intl_lu.h | 2 +- airrohr-firmware/intl_lv.h | 5 +++++ airrohr-firmware/intl_nl.h | 2 +- airrohr-firmware/intl_pl.h | 2 +- airrohr-firmware/intl_pt.h | 2 +- airrohr-firmware/intl_ro.h | 5 +++++ airrohr-firmware/intl_rs.h | 2 +- airrohr-firmware/intl_ru.h | 2 +- airrohr-firmware/intl_se.h | 2 +- airrohr-firmware/intl_si.h | 5 +++++ airrohr-firmware/intl_sk.h | 2 +- airrohr-firmware/intl_template.h | 8 ++++---- airrohr-firmware/intl_tr.h | 2 +- airrohr-firmware/intl_ua.h | 2 +- 30 files changed, 80 insertions(+), 33 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index a642baf14..3811adedd 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -500,7 +500,7 @@ int last_signal_strength; int last_disconnect_reason; uint32_t battery_analog_value = 0; -uint32_t battery_capacity = 0; +uint32_t battery_charge = 0; uint32_t battery_sum = 0; uint32_t battery_val_count = 0; @@ -1168,6 +1168,7 @@ static void webserver_config_send_body_get(String& page_content) { server.sendContent(page_content); page_content = emptyString; + page_content += FPSTR(BR_TAG); add_form_checkbox(Config_enable_battery_monitor, FPSTR(INTL_ENABLE_BATTERY_MONITOR)); page_content += F("
" INTL_ERROR "
"); add_form_input(page_content, Config_battery_u_min, FPSTR(INTL_BATTERY_U_MIN), 5); @@ -1712,9 +1713,9 @@ static void webserver_status() { add_table_row_from_value(page_content, FPSTR(SENSORS_SDS011), last_value_SDS_version); } if (cfg::enable_battery_monitor){ - // String battery_state = F(String(battery_capacity) + " % (" + String(battery_analog_value / 1000.0) + "V)"); - String battery_state = String(battery_capacity) + " % (" + String(battery_analog_value / 1000.0) + "V)"; - add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CAPACITY), battery_state); + // String battery_state = F(String(battery_charge) + " % (" + String(battery_analog_value / 1000.0) + "V)"); + String battery_state = String(battery_charge) + " % (" + String(battery_analog_value / 1000.0) + "V)"; + add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CHARGE), battery_state); } page_content += FPSTR(EMPTY_ROW); @@ -3433,11 +3434,11 @@ static void readBatteryVoltage() { battery_analog_value = round(battery_avg_value * ratio); debug_outln_verbose(F("Battery analog value (mV): "), String(battery_analog_value)); String bat_min_max = String(cfg::battery_u_min) + " / " + String(cfg::battery_u_max); - battery_capacity = map(battery_analog_value, cfg::battery_u_min, cfg::battery_u_max, 0, 100); - if (battery_capacity < 0){ - battery_capacity = 0; + battery_charge = map(battery_analog_value, cfg::battery_u_min, cfg::battery_u_max, 0, 100); + if (battery_charge < 0){ + battery_charge = 0; } - debug_outln_verbose(F("Battery capacity (%): "), String(battery_capacity)); + debug_outln_verbose(F("Battery capacity (%): "), String(battery_charge)); debug_outln_verbose(FPSTR(DBG_TXT_END_READING), F("Battery voltage")); battery_monitor_period = act_milli; @@ -3449,9 +3450,9 @@ static void readBatteryVoltage() { static void sendBatteryStatus(String& s) { float battery_voltage = battery_analog_value / 1000.0; add_Value2Json(s, F("Battery_voltage"), String(battery_voltage)); - add_Value2Json(s, F("Battery_capacity"), String(battery_capacity)); + add_Value2Json(s, F("battery_charge"), String(battery_charge)); debug_outln_info(F("Battery (V): "), String(battery_voltage)); - debug_outln_info(F("Battery (%): "), String(battery_capacity)); + debug_outln_info(F("Battery (%): "), String(battery_charge)); debug_outln_info(FPSTR(DBG_TXT_SEP)); } diff --git a/airrohr-firmware/intl_bg.h b/airrohr-firmware/intl_bg.h index ea27f9616..343223cd7 100644 --- a/airrohr-firmware/intl_bg.h +++ b/airrohr-firmware/intl_bg.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество на сигнала #define INTL_PARAMETER "Параметър" #define INTL_VALUE "Стойност" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активиране на монитора на батерията"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Капацитет на батерията"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд на батерията"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерията (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерията (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; diff --git a/airrohr-firmware/intl_cn.h b/airrohr-firmware/intl_cn.h index a0c9a8399..3fff5c0db 100644 --- a/airrohr-firmware/intl_cn.h +++ b/airrohr-firmware/intl_cn.h @@ -125,5 +125,11 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "信号质量"; #define INTL_SENSOR "传感器" #define INTL_PARAMETER "参数" #define INTL_VALUE "价值" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "启用电池监控器"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "电池充电"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "电池 U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "电池 U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC分频器 U max (mV)"; + #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_cz.h b/airrohr-firmware/intl_cz.h index 3bc63ba10..a5b0ca992 100644 --- a/airrohr-firmware/intl_cz.h +++ b/airrohr-firmware/intl_cz.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalita signálu"; #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Hodnota" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povolit sledování baterie"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Kapacita baterie"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Nabíjení baterie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterie U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Dělič ADP U max (mV):"; diff --git a/airrohr-firmware/intl_de.h b/airrohr-firmware/intl_de.h index 16c1f5366..7c86501cd 100644 --- a/airrohr-firmware/intl_de.h +++ b/airrohr-firmware/intl_de.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualität"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wert" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Batteriemonitor aktivieren"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batteriekapazität"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterieladung"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADW teiler U max (mV)"; diff --git a/airrohr-firmware/intl_dk.h b/airrohr-firmware/intl_dk.h index 4ef334599..c74474a68 100644 --- a/airrohr-firmware/intl_dk.h +++ b/airrohr-firmware/intl_dk.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Værdi" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivér batteriskærm"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterikapacitet"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Batteriopladning"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADK divider U max (mV):"; diff --git a/airrohr-firmware/intl_ee.h b/airrohr-firmware/intl_ee.h index da806af8e..57a1ff5b6 100644 --- a/airrohr-firmware/intl_ee.h +++ b/airrohr-firmware/intl_ee.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signaali kvaliteet"; #define INTL_SENSOR "Andur" #define INTL_PARAMETER "Parameeter" #define INTL_VALUE "Väärtus" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Luba aku monitor"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Aku laadimine"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Aku U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Aku U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC eraldaja U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_en.h b/airrohr-firmware/intl_en.h index d9fb3d014..72706f451 100644 --- a/airrohr-firmware/intl_en.h +++ b/airrohr-firmware/intl_en.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signal quality"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Value" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Battery capacity"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery charge"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (mV)"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV)"; diff --git a/airrohr-firmware/intl_es.h b/airrohr-firmware/intl_es.h index 5925093e9..dbb140173 100644 --- a/airrohr-firmware/intl_es.h +++ b/airrohr-firmware/intl_es.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Calidad de Señal"; #define INTL_PARAMETER "Parámetro" #define INTL_VALUE "Valor" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de batería"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacidad de la batería"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Bateria cargada"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batería U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batería U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Divisor CAD U max (mV):"; diff --git a/airrohr-firmware/intl_fi.h b/airrohr-firmware/intl_fi.h index 3efa03b2d..ab5f3517a 100644 --- a/airrohr-firmware/intl_fi.h +++ b/airrohr-firmware/intl_fi.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signaalin laatu"; #define INTL_SENSOR "Anturi" #define INTL_PARAMETER "Parametri" #define INTL_VALUE "Arvo" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ota akkumonitori käyttöön"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Akun varaus"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Akku U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Akku U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC-jakaja U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_fr.h b/airrohr-firmware/intl_fr.h index e076d845f..f7dae8ab0 100644 --- a/airrohr-firmware/intl_fr.h +++ b/airrohr-firmware/intl_fr.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualité du signal"; #define INTL_PARAMETER "Paramètres" #define INTL_VALUE "Valeur" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Activer le moniteur de batterie"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacité de la batterie"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Charge de la batterie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Diviseur de CAN U max (mV):"; diff --git a/airrohr-firmware/intl_gr.h b/airrohr-firmware/intl_gr.h index e064a7797..c55d3264a 100644 --- a/airrohr-firmware/intl_gr.h +++ b/airrohr-firmware/intl_gr.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "ποιότητα σήματος"; #define INTL_SENSOR "Αισθητήρας" #define INTL_PARAMETER "Παράμετρος" #define INTL_VALUE "Αξία" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ενεργοποίηση οθόνης μπαταρίας"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Φόρτιση μπαταρίας"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Μπαταρία U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Μπαταρία U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Διαχωριστικό ADC U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_hu.h b/airrohr-firmware/intl_hu.h index 02b9cb342..f5a17bde0 100644 --- a/airrohr-firmware/intl_hu.h +++ b/airrohr-firmware/intl_hu.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jelminőség"; #define INTL_PARAMETER "Paraméter" #define INTL_VALUE "Érték" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Engedélyezze az akkumulátorfigyelőt"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Akkumulátor-kapacitás"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Akkumulátortöltő"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Akkumulátor U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Akkumulátor U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADA elválasztó U max (mV):"; diff --git a/airrohr-firmware/intl_it.h b/airrohr-firmware/intl_it.h index c70327fe0..2c96d97f6 100644 --- a/airrohr-firmware/intl_it.h +++ b/airrohr-firmware/intl_it.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualità del segnale"; #define INTL_PARAMETER "Parametro" #define INTL_VALUE "Valore" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Abilita il monitoraggio della batteria"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacità della batteria"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Carica batterie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteria U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisore U max (mV):"; diff --git a/airrohr-firmware/intl_jp.h b/airrohr-firmware/intl_jp.h index 4399814a5..9c522f81c 100644 --- a/airrohr-firmware/intl_jp.h +++ b/airrohr-firmware/intl_jp.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "信号品質"; #define INTL_SENSOR "センサー" #define INTL_PARAMETER "パラメータ" #define INTL_VALUE "価値" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "バッテリーモニターを有効にする"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "充電"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "電池 U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "電池 U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC分周器 U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lt.h b/airrohr-firmware/intl_lt.h index ccb27bac2..20a09e7bd 100644 --- a/airrohr-firmware/intl_lt.h +++ b/airrohr-firmware/intl_lt.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signalo kokybė"; #define INTL_SENSOR "Jutiklis" #define INTL_PARAMETER "Parametras" #define INTL_VALUE "Vertė" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Įgalinti akumuliatoriaus monitorių"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Baterijos įkrovimas"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterija U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterija U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC daliklis U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lu.h b/airrohr-firmware/intl_lu.h index 352c719ff..403a0484f 100644 --- a/airrohr-firmware/intl_lu.h +++ b/airrohr-firmware/intl_lu.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualitéit"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wäert" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivéiert Batterie Monitor"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batteriekapazitéit"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterieladung"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV):"; diff --git a/airrohr-firmware/intl_lv.h b/airrohr-firmware/intl_lv.h index 9b72665e6..2137a76f4 100644 --- a/airrohr-firmware/intl_lv.h +++ b/airrohr-firmware/intl_lv.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signāla kvalitāte"; #define INTL_SENSOR "Sensors" #define INTL_PARAMETER "Parametrs" #define INTL_VALUE "Vērtība" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Akumulatora uzlāde"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Akumulators U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Akumulators U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC dalītājs U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_nl.h b/airrohr-firmware/intl_nl.h index 1d266a2b0..70f311032 100644 --- a/airrohr-firmware/intl_nl.h +++ b/airrohr-firmware/intl_nl.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Signaalkwaliteit"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Waarde" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Schakel de batterijmonitor in"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterij capaciteit"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterijlading"; const char INTL_BATTERY_U_MIN[] PROGMEM = "batterij U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "batterij U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADO divider U max (mV):"; diff --git a/airrohr-firmware/intl_pl.h b/airrohr-firmware/intl_pl.h index 79c8809ba..fce29d9f0 100644 --- a/airrohr-firmware/intl_pl.h +++ b/airrohr-firmware/intl_pl.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jakość sygnału"; #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Wartość" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Włącz monitor baterii"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Pojemność baterii"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Ładowanie baterii"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ACP dzielnik U max (mV):"; diff --git a/airrohr-firmware/intl_pt.h b/airrohr-firmware/intl_pt.h index 1e84be106..0dff7d74b 100644 --- a/airrohr-firmware/intl_pt.h +++ b/airrohr-firmware/intl_pt.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualidade do Sinal"; #define INTL_PARAMETER "Parâmetro" #define INTL_VALUE "Valor" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de bateria"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Capacidade de carga"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Carga da bateria"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisor U max (mV):"; diff --git a/airrohr-firmware/intl_ro.h b/airrohr-firmware/intl_ro.h index 4214041bd..aa2c409e0 100644 --- a/airrohr-firmware/intl_ro.h +++ b/airrohr-firmware/intl_ro.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "calitatea semnalului"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parametru" #define INTL_VALUE "Valoare" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Akumulatora uzlāde"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Akumulators U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Akumulators U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC dalītājs U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_rs.h b/airrohr-firmware/intl_rs.h index accf4e823..8fcbfbd94 100644 --- a/airrohr-firmware/intl_rs.h +++ b/airrohr-firmware/intl_rs.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalitet signala"; #define INTL_PARAMETER "Parametar" #define INTL_VALUE "Vrednost" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активирајте монитор батерије"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Капацитет батерије"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Пуњење батерије"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерије (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерије (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "АДП разделник U max (mV):"; diff --git a/airrohr-firmware/intl_ru.h b/airrohr-firmware/intl_ru.h index 776e6d71a..cbbe256b2 100644 --- a/airrohr-firmware/intl_ru.h +++ b/airrohr-firmware/intl_ru.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество"; #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значение" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активируйте монитор батареи"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Емкость батареи"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд батареи"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареи (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареи (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; diff --git a/airrohr-firmware/intl_se.h b/airrohr-firmware/intl_se.h index 370f23162..8fc851f2f 100644 --- a/airrohr-firmware/intl_se.h +++ b/airrohr-firmware/intl_se.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Värde" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivera batteriövervakare"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Batterikapacitet"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Batteriladdning"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADО divider U max (mV):"; diff --git a/airrohr-firmware/intl_si.h b/airrohr-firmware/intl_si.h index 2f1828a4a..f34dbb79f 100644 --- a/airrohr-firmware/intl_si.h +++ b/airrohr-firmware/intl_si.h @@ -125,5 +125,10 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kakovost signala"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Vrednost" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Omogoči nadzor baterije"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Polnjenje baterije"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterija U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterija U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC delilnik U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_sk.h b/airrohr-firmware/intl_sk.h index 5e36b412a..136810d15 100644 --- a/airrohr-firmware/intl_sk.h +++ b/airrohr-firmware/intl_sk.h @@ -125,7 +125,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalita signálu"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Hodnota" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povoliť sledovanie batérie"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Kapacita batérie"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Nabitie batérie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batéria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batéria U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADP rozdeľovač U max (mV):"; diff --git a/airrohr-firmware/intl_template.h b/airrohr-firmware/intl_template.h index 1fb13976c..9bcc70e3e 100644 --- a/airrohr-firmware/intl_template.h +++ b/airrohr-firmware/intl_template.h @@ -126,9 +126,9 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = ""; #define INTL_PARAMETER "" #define INTL_VALUE "" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; -const char INTL_BATTERY[] PROGMEM = "Battery"; -const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (V):"; -const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (V):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV):"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery charge"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (mV)"; +const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV)"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_tr.h b/airrohr-firmware/intl_tr.h index 2922c1366..f2ccbd7d5 100644 --- a/airrohr-firmware/intl_tr.h +++ b/airrohr-firmware/intl_tr.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "sinyal kalitesi"; #define INTL_PARAMETER "Parametre" #define INTL_VALUE "değer" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Pil monitörünü etkinleştir"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Pil kapasitesi"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Pil şarjı"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Pil U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Pil U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADD bölücü U max (mV):"; diff --git a/airrohr-firmware/intl_ua.h b/airrohr-firmware/intl_ua.h index 71e02d8da..3fbd935b2 100644 --- a/airrohr-firmware/intl_ua.h +++ b/airrohr-firmware/intl_ua.h @@ -126,7 +126,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "якість сигналу"; #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значення" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активуйте монітор батареї"; -const char INTL_BATTERY_CAPACITY[] PROGMEM = "Ємкість батареї"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд акумулятора"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареї (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареї (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при подільника на АЦП (mV):"; From 32d8b6a0b120e7950d3b0a51bc0cb1cfffde43c7 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Wed, 28 Apr 2021 22:18:55 +0300 Subject: [PATCH 07/20] Fixed issue with the map() function and % when the value of the 'battery_analog_value' is outside of the predefined range by any circumstances; --- airrohr-firmware/airrohr-firmware.ino | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 3811adedd..0e6fd0fbc 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -3434,10 +3434,13 @@ static void readBatteryVoltage() { battery_analog_value = round(battery_avg_value * ratio); debug_outln_verbose(F("Battery analog value (mV): "), String(battery_analog_value)); String bat_min_max = String(cfg::battery_u_min) + " / " + String(cfg::battery_u_max); - battery_charge = map(battery_analog_value, cfg::battery_u_min, cfg::battery_u_max, 0, 100); - if (battery_charge < 0){ - battery_charge = 0; - } + + // This will fix issues with the map() function when the value of the 'battery_analog_value' is outside of the predefined range by any circumstances. + uint32_t battery_voltage = (battery_analog_value < (uint32_t)cfg::battery_u_min) ? (uint32_t)cfg::battery_u_min : battery_analog_value; + battery_voltage = (battery_voltage > (uint32_t)cfg::battery_u_max) ? (uint32_t)cfg::battery_u_max : battery_voltage; + + battery_charge = map(battery_voltage, cfg::battery_u_min, cfg::battery_u_max, 0, 100); + debug_outln_verbose(F("Battery capacity (%): "), String(battery_charge)); debug_outln_verbose(FPSTR(DBG_TXT_END_READING), F("Battery voltage")); @@ -4618,7 +4621,6 @@ void loop(void) { if (msSince(battery_start_time) > SAMPLETIME_BAT_MS){ battery_start_time = act_milli; readBatteryVoltage(); - //readBatteryVoltage(result_BAT); } } From c34cc5ea3164c9a159d093839e8e0615c19ab12b Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Wed, 28 Apr 2021 22:52:46 +0300 Subject: [PATCH 08/20] Updated Memory Usage at comment area at the beginning of the airrohr-firmware.ino; --- airrohr-firmware/airrohr-firmware.ino | 8 ++++---- airrohr-firmware/platformio.ini | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 0e6fd0fbc..96739a523 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -48,12 +48,12 @@ ************************************************************************ * * latest mit lib 2.6.2 - * DATA: [==== ] 39.5% (used 32392 bytes from 81920 bytes) - * PROGRAM: [===== ] 53.8% (used 580740 bytes from 1044464 bytes) + * DATA: [==== ] 39.8% (used 32636 bytes from 81920 bytes) + * PROGRAM: [===== ] 54.9% (used 573916 bytes from 1044464 bytes) * latest mit lib 2.5.2 - * DATA: [==== ] 39.4% (used 32304 bytes from 81920 bytes) - * PROGRAM: [===== ] 48.3% (used 504812 bytes from 1044464 bytes) + * DATA: [==== ] 39.8% (used 32604 bytes from 81920 bytes) + * PROGRAM: [===== ] 54.9% (used 573904 bytes from 1044464 bytes) * ************************************************************************/ #include diff --git a/airrohr-firmware/platformio.ini b/airrohr-firmware/platformio.ini index 842cb753d..dab632a40 100644 --- a/airrohr-firmware/platformio.ini +++ b/airrohr-firmware/platformio.ini @@ -87,6 +87,7 @@ extra_scripts = platformio_script.py # needs to be adjusted to the matching version from # https://github.com/platformio/platform-espressif8266/releases platform_version = espressif8266@2.6.2 +; platform_version = espressif8266@2.5.2 platform_version_esp32 = espressif32@1.11.1 ; using Arduino core 1.0.4 [DISABLEDenv:lolin_d32_pro_debug] From 6b150df284aa379b9ee2702ca1c083337fd08137 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sun, 14 Nov 2021 06:54:21 +0200 Subject: [PATCH 09/20] Added .vs to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8fcbed29d..44fe95669 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ compile_mac.sh # Visual Studio Code -.vscode \ No newline at end of file +.vscode +.vs \ No newline at end of file From 29620d51950d73e7e736e356053518b5c2793a83 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sun, 14 Nov 2021 07:20:55 +0200 Subject: [PATCH 10/20] airrohr-firmware.ino: Updated memory usage comment --- airrohr-firmware/airrohr-firmware.ino | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 200304cea..c75cb55ca 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -47,14 +47,9 @@ * * ************************************************************************ * - * latest mit lib 2.6.2 - * DATA: [==== ] 39.8% (used 32636 bytes from 81920 bytes) - * PROGRAM: [===== ] 54.9% (used 573916 bytes from 1044464 bytes) - - * latest mit lib 2.5.2 - * DATA: [==== ] 39.8% (used 32604 bytes from 81920 bytes) - * PROGRAM: [===== ] 54.9% (used 573904 bytes from 1044464 bytes) - * + * latest mit lib 3.1.0 + * DATA: [==== ] 41.2% (used 33728 bytes from 81920 bytes) + * PROGRAM: [====== ] 57.6% (used 601633 bytes from 1044464 bytes) ************************************************************************/ #include #include From 6eb2ce6bfd6f3f6ef649fd0e75d6331915ecae8c Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sat, 15 Jan 2022 15:05:08 +0200 Subject: [PATCH 11/20] Added Adafruit's INA219 lib and its initial implementation --- airrohr-firmware/airrohr-firmware.ino | 16 ++++++++++++++++ airrohr-firmware/platformio.ini | 1 + 2 files changed, 17 insertions(+) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 8e5a8994f..eaffeac4a 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -112,6 +112,7 @@ String SOFTWARE_VERSION(SOFTWARE_VERSION_STR); #include "./bmx280_i2c.h" #include "./sps30_i2c.h" #include "./dnms_i2c.h" +#include #include "./intl.h" @@ -261,6 +262,7 @@ bool scd30_init_failed = false; bool dnms_init_failed = false; bool gps_init_failed = false; bool airrohr_selftest_failed = false; +bool ina219_init_failed = false; #if defined(ESP8266) ESP8266WebServer server(80); @@ -542,6 +544,11 @@ IPAddress addr_static_subnet; IPAddress addr_static_gateway; IPAddress addr_static_dns; +/***************************************************************** + * INA219 declaration * + *****************************************************************/ +Adafruit_INA219 ina219; + #define msSince(timestamp_before) (act_milli - (timestamp_before)) const char data_first_part[] PROGMEM = "{\"software_version\": \"" SOFTWARE_VERSION_STR "\", \"sensordatavalues\":["; @@ -4363,6 +4370,15 @@ static void powerOnTestSensors() { initDNMS(); } + if (cfg::enable_battery_monitor){ + if(!ina219.begin()){ + debug_outln_error(F("Check INA219 wiring")); + ina219_init_failed = true; + } else { + + } + } + } static void logEnabledAPIs() { diff --git a/airrohr-firmware/platformio.ini b/airrohr-firmware/platformio.ini index b92dd55fe..21a6aec38 100644 --- a/airrohr-firmware/platformio.ini +++ b/airrohr-firmware/platformio.ini @@ -53,6 +53,7 @@ lib_deps_external = bblanchon/ArduinoJson@6.18.3 ThingPulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.2.1 mikalhart/TinyGPSPlus@1.0.2 + adafruit/Adafruit INA219@^1.1.1 ; system libraries from platform -> no version number lib_deps_esp8266_platform = From c07e49e000e9cf51e2e31a3425c7fe9ff7036be7 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Fri, 21 Jan 2022 00:00:32 +0200 Subject: [PATCH 12/20] Added workflows files; --- .github/workflows/beta-ssn-build.yml | 64 ++++++++++++++ .github/workflows/beta-ssn-pull.yml | 51 ++++++++++++ .github/workflows/master-ssn-build.yml | 64 ++++++++++++++ .github/workflows/master-ssn-pull.yml | 51 ++++++++++++ .github/workflows/release_ssn.yml | 85 +++++++++++++++++++ .github/workflows/test.yml | 110 +++++++++++++++++++++++++ 6 files changed, 425 insertions(+) create mode 100644 .github/workflows/beta-ssn-build.yml create mode 100644 .github/workflows/beta-ssn-pull.yml create mode 100644 .github/workflows/master-ssn-build.yml create mode 100644 .github/workflows/master-ssn-pull.yml create mode 100644 .github/workflows/release_ssn.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/beta-ssn-build.yml b/.github/workflows/beta-ssn-build.yml new file mode 100644 index 000000000..38603ce54 --- /dev/null +++ b/.github/workflows/beta-ssn-build.yml @@ -0,0 +1,64 @@ +# SSN Airrohr Firmware CI workflow + +name: beta-ssn build status + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + push: + branches: [ beta-ssn ] + create: + branches: [ beta-ssn ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Load dependencies from cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Runs a single command using the runners shell + #- name: Run a one-line script + # run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install platformio + platformio --version + + - name: Run 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: Upload Release + # uses: ncipollo/release-action@v1 + # with: + # artifacts: "../airrohr-firmware/builds/*" + # token: ${{ secrets.GITHUB_TOKEN }} + # # Instead add tags through every Release related commit + # # tag: vSSN-NRZ-2021-134-B5 diff --git a/.github/workflows/beta-ssn-pull.yml b/.github/workflows/beta-ssn-pull.yml new file mode 100644 index 000000000..0451ade16 --- /dev/null +++ b/.github/workflows/beta-ssn-pull.yml @@ -0,0 +1,51 @@ +# SSN Airrohr Firmware CI workflow + +name: beta-ssn pr status + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + pull_request: + branches: + - beta-ssn + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Load dependencies from cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Runs a set of commands using the runners shell + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install platformio + platformio --version + + - name: Run 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/ diff --git a/.github/workflows/master-ssn-build.yml b/.github/workflows/master-ssn-build.yml new file mode 100644 index 000000000..a3d9dee33 --- /dev/null +++ b/.github/workflows/master-ssn-build.yml @@ -0,0 +1,64 @@ +# SSN Airrohr Firmware CI workflow + +name: master-ssn build status + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + push: + branches: [ master-ssn ] + create: + branches: [ master-ssn ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Load dependencies from cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Runs a single command using the runners shell + #- name: Run a one-line script + # run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install platformio + platformio --version + + - name: Run 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: Upload Release + # uses: ncipollo/release-action@v1 + # with: + # artifacts: "../airrohr-firmware/builds/*" + # token: ${{ secrets.GITHUB_TOKEN }} + # # Instead add tags through every Release related commit + # # tag: vSSN-NRZ-2021-134-B5 diff --git a/.github/workflows/master-ssn-pull.yml b/.github/workflows/master-ssn-pull.yml new file mode 100644 index 000000000..9a875f5a5 --- /dev/null +++ b/.github/workflows/master-ssn-pull.yml @@ -0,0 +1,51 @@ +# SSN Airrohr Firmware CI workflow + +name: master-ssn pr status + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + pull_request: + branches: + - master-ssn + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Load dependencies from cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Runs a set of commands using the runners shell + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install platformio + platformio --version + + - name: Run 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/ diff --git a/.github/workflows/release_ssn.yml b/.github/workflows/release_ssn.yml new file mode 100644 index 000000000..54634473d --- /dev/null +++ b/.github/workflows/release_ssn.yml @@ -0,0 +1,85 @@ +# SSN Airrohr Firmware CI workflow + +name: Create SSN Release + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + push: + # branches: + # - master-ssn + # - beta-ssn + tags: + - 'SSN-*' + + # Allows you to run this workflow manually from the Actions tab + # workflow_dispatch: + + # - name: Echo some Environment variables + # run: | + # echo github.run_number ${{ github.run_number }} + # echo GITHUB_REF $GITHUB_REF + # echo GITHUB_REF_NAME $GITHUB_REF_NAME + # echo GITHUB_REF_TYPE $GITHUB_REF_TYPE + # echo GITHUB_HEAD_REF $GITHUB_HEAD_REF + # echo GITHUB_BASE_REF $GITHUB_BASE_REF + +jobs: + prod-check-and-release: + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && contains(github.ref_name, 'SSN') + runs-on: ubuntu-latest + steps: + - run: echo "Creating release version $GITHUB_REF" + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Load dependencies from cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Run counter + run: echo github.run_number ${{ github.run_number }} + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip3 install platformio + platformio --version + - name: Run 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 List all + # run: pwd && ls -l airrohr-firmware/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 + 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 + with: + if-no-files-found: error + name: airrohr-update-loader + path: airrohr-update-loader/builds/latest_loader.bin + retention-days: 30 + - name: Upload Release + uses: ncipollo/release-action@v1 + with: + artifacts: "airrohr-firmware-builds.tar.gz, airrohr-update-loader/builds/latest_loader.bin" + token: ${{ secrets.GITHUB_TOKEN }} + # Use tag on push event + #tag: SSN-NRZ-2022-134-B${{ github.run_number }} + tag: $GITHUB_REF_NAME diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..d107589bd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,110 @@ +# SSN Airrohr Firmware CI workflow + +name: SSN test (test.yml) + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master-ssn branch + push: + tags: + - 'TEST-*' + # branches: + # - actions* + # create: + # branches: + # - actions* + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # - name: Dump GitHub context + # env: + # GITHUB_CONTEXT: ${{ toJson(github) }} + # run: echo "$GITHUB_CONTEXT" + # - name: Extract branch name + # shell: bash + # run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" + # - name: Test + # run: echo "${BRANCH_NAME}" + +# # A workflow run is made up of one or more jobs that can run sequentially or in parallel +# jobs: +# # This workflow contains a single job called "build" +# build: +# # The type of runner that the job will run on +# runs-on: ubuntu-latest + +# # map a step output to a job output +# # outputs: +# # version_num: ${{steps.version.outputs.VERSION}} + +# # Steps represent a sequence of tasks that will be executed as part of the job +# steps: +# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it +# - name: Checkout +# uses: actions/checkout@v2 + +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.7' + +# - name: Load dependencies from cache +# uses: actions/cache@v2 +# with: +# path: ~/.cache/pip +# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} +# restore-keys: | +# ${{ runner.os }}-pip- + +# # Runs a single command using the runners shell +# - name: Run a one-line script +# run: echo github.run_number ${{ github.run_number }} + +# # Runs a set of commands using the runners shell +# - name: Install dependencies +# run: | +# python3 -m pip install --upgrade pip +# pip3 install platformio +# platformio --version + +# - name: Run 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 List all +# run: pwd && ls -l airrohr-firmware/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 +# 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 +# with: +# if-no-files-found: error +# name: airrohr-update-loader +# path: airrohr-update-loader/builds/latest_loader.bin +# retention-days: 30 + +# - name: Upload Release +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "airrohr-firmware-builds.tar.gz, airrohr-update-loader/builds/latest_loader.bin" +# token: ${{ secrets.GITHUB_TOKEN }} +# # Instead add tags through every Release related commit +# tag: SSN-NRZ-2022-134-B${{ github.run_number }} From 05f7b966fc02c67cf12eedda31128c6e48832841 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Fri, 21 Jan 2022 08:13:17 +0200 Subject: [PATCH 13/20] changed release tag --- .github/workflows/release_ssn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_ssn.yml b/.github/workflows/release_ssn.yml index 54634473d..4569efb58 100644 --- a/.github/workflows/release_ssn.yml +++ b/.github/workflows/release_ssn.yml @@ -82,4 +82,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # Use tag on push event #tag: SSN-NRZ-2022-134-B${{ github.run_number }} - tag: $GITHUB_REF_NAME + tag: ${{ github.ref_name }} From 1bb2c4140984574a4b49382aba70a3e35f518812 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Fri, 21 Jan 2022 08:59:39 +0200 Subject: [PATCH 14/20] Changes in workflow files --- .github/workflows/beta-ssn-build.yml | 6 ++++-- .github/workflows/master-ssn-build.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/beta-ssn-build.yml b/.github/workflows/beta-ssn-build.yml index 38603ce54..cd0f7aecf 100644 --- a/.github/workflows/beta-ssn-build.yml +++ b/.github/workflows/beta-ssn-build.yml @@ -6,9 +6,11 @@ name: beta-ssn build status on: # Triggers the workflow on push or pull request events but only for the master-ssn branch push: - branches: [ beta-ssn ] + branches: + - beta-ssn create: - branches: [ beta-ssn ] + branches: + - beta-ssn # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/master-ssn-build.yml b/.github/workflows/master-ssn-build.yml index a3d9dee33..7ad860ab6 100644 --- a/.github/workflows/master-ssn-build.yml +++ b/.github/workflows/master-ssn-build.yml @@ -6,9 +6,11 @@ name: master-ssn build status on: # Triggers the workflow on push or pull request events but only for the master-ssn branch push: - branches: [ master-ssn ] + branches: + - master-ssn create: - branches: [ master-ssn ] + branches: + - master-ssn # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From 028b311b63682650dc07aa2879851ee56dd096d7 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sat, 22 Jan 2022 21:09:28 +0200 Subject: [PATCH 15/20] build workflow: make it run only if ref_type != 'tag' --- .github/workflows/beta-ssn-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta-ssn-build.yml b/.github/workflows/beta-ssn-build.yml index cd0f7aecf..315a5485e 100644 --- a/.github/workflows/beta-ssn-build.yml +++ b/.github/workflows/beta-ssn-build.yml @@ -18,7 +18,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: + prod-check-and-build: + if: github.ref_type != 'tag' # The type of runner that the job will run on runs-on: ubuntu-latest From 5bd6fd111efa9362248ea12368c4faac5d23e270 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Tue, 18 Oct 2022 16:19:10 +0300 Subject: [PATCH 16/20] Fixed issue with html after merge from 'beta' --- airrohr-firmware/airrohr-firmware.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index de6caa0fb..dc3760bef 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -1722,10 +1722,10 @@ static void webserver_config_send_body_get(String &page_content) add_form_input(page_content, Config_static_subnet, FPSTR(INTL_STATIC_SUBNET), 15); add_form_input(page_content, Config_static_gateway, FPSTR(INTL_STATIC_GATEWAY), 15); add_form_input(page_content, Config_static_dns, FPSTR(INTL_STATIC_DNS), 15); - page_content += FPSTR(BR_TAG); + page_content += FPSTR(TABLE_TAG_CLOSE_BR); server.sendContent(page_content); - page_content = emptyString; + // page_content = emptyString; page_content += FPSTR(BR_TAG); add_form_checkbox(Config_enable_battery_monitor, FPSTR(INTL_ENABLE_BATTERY_MONITOR)); From d85900b842b2104f05b8fed45a3ce48723f416f8 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Thu, 19 Sep 2024 07:25:04 +0300 Subject: [PATCH 17/20] Add support for INA219 based voltage & current monitor board; --- airrohr-firmware/airrohr-cfg.h | 6 +- airrohr-firmware/airrohr-cfg.h.py | 2 +- airrohr-firmware/airrohr-firmware.ino | 291 ++++++++++++++++++++------ airrohr-firmware/ext_def.h | 7 +- airrohr-firmware/html-content.h | 1 + airrohr-firmware/intl_en.h | 11 +- 6 files changed, 240 insertions(+), 78 deletions(-) diff --git a/airrohr-firmware/airrohr-cfg.h b/airrohr-firmware/airrohr-cfg.h index 5635afd0b..a5d376411 100644 --- a/airrohr-firmware/airrohr-cfg.h +++ b/airrohr-firmware/airrohr-cfg.h @@ -99,7 +99,7 @@ enum ConfigShapeId { Config_enable_battery_monitor, Config_battery_u_min, Config_battery_u_max, - Config_adc_divider_u_max, + Config_ina219_calibration, }; static constexpr char CFG_KEY_CURRENT_LANG[] PROGMEM = "current_lang"; static constexpr char CFG_KEY_WLANSSID[] PROGMEM = "wlanssid"; @@ -175,7 +175,7 @@ static constexpr char CFG_KEY_SSL_INFLUX[] PROGMEM = "ssl_influx"; static constexpr char CFG_KEY_ENABLE_BATTERY_MONITOR[] PROGMEM = "enable_battery_monitor"; static constexpr char CFG_KEY_BATTERY_U_MIN[] PROGMEM = "battery_u_min"; static constexpr char CFG_KEY_BATTERY_U_MAX[] PROGMEM = "battery_u_max"; -static constexpr char CFG_KEY_ADC_DIVIDER_U_MAX[] PROGMEM = "adc_divider_u_max"; +static constexpr char CFG_KEY_INA219_CALIBRATION[] PROGMEM = "ina219_calibration"; static constexpr ConfigShapeEntry configShape[] PROGMEM = { { Config_Type_String, sizeof(cfg::current_lang)-1, CFG_KEY_CURRENT_LANG, cfg::current_lang }, { Config_Type_String, sizeof(cfg::wlanssid)-1, CFG_KEY_WLANSSID, cfg::wlanssid }, @@ -251,5 +251,5 @@ static constexpr ConfigShapeEntry configShape[] PROGMEM = { { Config_Type_Bool, 0, CFG_KEY_ENABLE_BATTERY_MONITOR, &cfg::enable_battery_monitor }, { Config_Type_UInt, 0, CFG_KEY_BATTERY_U_MIN, &cfg::battery_u_min }, { Config_Type_UInt, 0, CFG_KEY_BATTERY_U_MAX, &cfg::battery_u_max }, - { Config_Type_UInt, 0, CFG_KEY_ADC_DIVIDER_U_MAX, &cfg::adc_divider_u_max }, + { Config_Type_UInt, 0, CFG_KEY_INA219_CALIBRATION, &cfg::ina219_calibration }, }; diff --git a/airrohr-firmware/airrohr-cfg.h.py b/airrohr-firmware/airrohr-cfg.h.py index 2adf939ea..2282aadec 100755 --- a/airrohr-firmware/airrohr-cfg.h.py +++ b/airrohr-firmware/airrohr-cfg.h.py @@ -75,7 +75,7 @@ Bool enable_battery_monitor UInt battery_u_min UInt battery_u_max -UInt adc_divider_u_max +UInt ina219_calibration """ with open("airrohr-cfg.h", "w") as h: diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index dc3760bef..a5b81418d 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -205,13 +205,11 @@ namespace cfg bool display_wifi_info = DISPLAY_WIFI_INFO; bool display_device_info = DISPLAY_DEVICE_INFO; - // ADC settings - unsigned adc_divider_u_max = ADC_DIVIDER_U_MAX; - // battery monitor measurement settings bool enable_battery_monitor = ENABLE_BATTERY_MONITOR; unsigned battery_u_max = BATTERY_U_MAX; unsigned battery_u_min = BATTERY_U_MIN; + unsigned ina219_calibration = INA219_CALIBRATION; // API settings bool ssl_madavi = SSL_MADAVI; @@ -254,7 +252,7 @@ namespace cfg } } -#define JSON_BUFFER_SIZE 2300 +#define JSON_BUFFER_SIZE 2500 LoggerConfig loggerConfigs[LoggerCount]; @@ -630,10 +628,15 @@ String last_data_string; int last_signal_strength; int last_disconnect_reason; -uint32_t battery_analog_value = 0; -uint32_t battery_charge = 0; -uint32_t battery_sum = 0; uint32_t battery_val_count = 0; +uint32_t battery_voltage_sum = 0; +uint32_t battery_voltage_mV = 0; +uint32_t battery_status = 0; +uint32_t current_draw_sum = 0; +uint32_t current_draw_mA = 0; +uint32_t power_consumption_sum = 0; +uint32_t power_consumption_mW = 0; +bool ina219_is_in_power_save = true; String esp_chipid; String esp_mac_id; @@ -676,8 +679,9 @@ IPAddress addr_static_gateway; IPAddress addr_static_dns; /***************************************************************** - * INA219 declaration * + * INA219 declaration * *****************************************************************/ +const uint8_t ina219_i2c_addresses[] = {0x40, 0x41, 0x44, 0x45}; // 0x40 is the default address Adafruit_INA219 ina219; #define msSince(timestamp_before) (act_milli - (timestamp_before)) @@ -1281,6 +1285,18 @@ static bool writeConfig() break; }; } + + /* NOTE: I suggest to keep this here for future use when new settings needs to be added */ + /* + debug_outln_verbose(F("ConfigShape element count: "), String(sizeof(configShape) / sizeof(configShape[0]))); + debug_outln_verbose(F("Json memory usage: "), String(json.memoryUsage())); + debug_outln_verbose(F("Json capacity: "), String(json.capacity())); + debug_outln_verbose(F("Configuration contents (config.json):")); + if(cfg::debug > DEBUG_MED_INFO) + { + serializeJson(json, Debug); + } + */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -1415,6 +1431,52 @@ static void end_html_page(String &page_content) server.sendContent_P(WEB_PAGE_FOOTER); } +static void add_form_select( + String &page_content, + const ConfigShapeId cfgid, + const __FlashStringHelper *names[], + uint32_t *values, + const __FlashStringHelper *label, + uint32_t val_size) +{ + RESERVE_STRING(s, XLARGE_STR); + ConfigShapeEntry c; + memcpy_P(&c, &configShape[cfgid], sizeof(ConfigShapeEntry)); + + String tmp; + s = F("" + "" + "" + ""); + s.concat(tmp); + + page_content += s; +} + static void add_form_input(String &page_content, const ConfigShapeId cfgid, const __FlashStringHelper *info, const int length) { RESERVE_STRING(s, MED_STR); @@ -1727,31 +1789,8 @@ static void webserver_config_send_body_get(String &page_content) server.sendContent(page_content); // page_content = emptyString; - page_content += FPSTR(BR_TAG); - add_form_checkbox(Config_enable_battery_monitor, FPSTR(INTL_ENABLE_BATTERY_MONITOR)); - page_content += F("
{i}: " + "" + "
"); - add_form_input(page_content, Config_battery_u_min, FPSTR(INTL_BATTERY_U_MIN), 5); - add_form_input(page_content, Config_battery_u_max, FPSTR(INTL_BATTERY_U_MAX), 5); - add_form_input(page_content, Config_adc_divider_u_max, FPSTR(INTL_ADC_DIVIDER_U_MAX), 5); - page_content += FPSTR(TABLE_TAG_CLOSE_BR); - - page_content += F(""); - server.sendContent(page_content); + page_content = FPSTR(WEB_BR_LF_B); page_content += F(INTL_FIRMWARE); page_content += FPSTR(WEB_B_BR); @@ -1775,6 +1814,34 @@ static void webserver_config_send_body_get(String &page_content) page_content += FPSTR(BR_TAG); add_form_checkbox(Config_powersave, FPSTR(INTL_POWERSAVE)); + add_form_checkbox(Config_enable_battery_monitor, FPSTR(INTL_ENABLE_BATTERY_MONITOR)); + page_content += F("
"); + unsigned ina219_values[3] = {1, 2, 3}; + const __FlashStringHelper *ina219_info[3] = {FPSTR(INTL_INA219_CAL_32V_2A), FPSTR(INTL_INA219_CAL_32V_1A), FPSTR(INTL_INA219_CAL_16V_400MA)}; + add_form_select(page_content, Config_ina219_calibration, ina219_info, ina219_values, FPSTR(INTL_INA219_SELECT_CALIBRATION), 3); + add_form_input(page_content, Config_battery_u_min, FPSTR(INTL_BATTERY_U_MIN), 5); + add_form_input(page_content, Config_battery_u_max, FPSTR(INTL_BATTERY_U_MAX), 5); + page_content += FPSTR(TABLE_TAG_CLOSE_BR); + + page_content += F(""); + + server.sendContent(page_content); + + page_content = FPSTR(BR_TAG); page_content += FPSTR(TABLE_TAG_OPEN); add_form_input(page_content, Config_debug, FPSTR(INTL_DEBUG_LEVEL), 1); add_form_input(page_content, Config_sending_intervall_ms, FPSTR(INTL_MEASUREMENT_INTERVAL), 5); @@ -2370,9 +2437,18 @@ static void webserver_status() add_table_row_from_value(page_content, FPSTR(SENSORS_SDS011), last_value_SDS_version); } if (cfg::enable_battery_monitor){ - // String battery_state = F(String(battery_charge) + " % (" + String(battery_analog_value / 1000.0) + "V)"); - String battery_state = String(battery_charge) + " % (" + String(battery_analog_value / 1000.0) + "V)"; - add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CHARGE), battery_state); + String battery_state_str = String(battery_voltage_mV / 1000.0) + "V | " + String(battery_status) + "%"; + add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CHARGE), battery_state_str); + + String current_draw_str = current_draw_mA >= 1000 + ? String(static_cast(current_draw_mA) / 1000.0) + "A" + : String(current_draw_mA) + "mA"; + add_table_row_from_value(page_content, FPSTR(INTL_CURRENT_DRAW), current_draw_str); + + String power_consumption_str = power_consumption_mW >= 1000 + ? String(static_cast(power_consumption_mW) / 1000.0) + "W" + : String(power_consumption_mW) + "mW"; + add_table_row_from_value(page_content, FPSTR(INTL_POWER_CONSUMPTION), power_consumption_str); } if (cfg::npm_read) { @@ -4542,38 +4618,70 @@ static void fetchSensorSPS30(String &s) } /***************************************************************** - read Battery voltage + read Battery state *****************************************************************/ -static void readBatteryVoltage() { +static void readBatteryState() { battery_val_count++; - if(battery_val_count > 3){ - battery_sum = 0; + + if(battery_val_count > 3) { + if(!ina219_is_in_power_save) + { + ina219_is_in_power_save = true; + debug_outln_verbose(F("INA219 is going to sleep...")); + ina219.powerSave(ina219_is_in_power_save); + debug_outln_info(FPSTR(DBG_TXT_SEP)); + } + + battery_voltage_sum = 0; + current_draw_sum = 0; + power_consumption_sum = 0; if(msSince(battery_monitor_period) <= READINGTIME_ADC_MS) - return; - + return; + battery_monitor_period = act_milli; battery_val_count = 0; + return; } - String dbg_reading = "Battery voltage #" + String(battery_val_count); - debug_outln_verbose(FPSTR(DBG_TXT_START_READING), dbg_reading); - battery_sum += analogRead(ADC_PIN); + ina219_is_in_power_save = false; + ina219.powerSave(ina219_is_in_power_save); + /* NOTE: According the TI's INA219 documentation: "Full recovery from Power-Down requires 40 μs." + * Still, let's be more generous here. + */ + delayMicroseconds(200); + debug_outln_verbose(F("INA219 is awake.")); + + debug_outln_verbose(FPSTR(DBG_TXT_START_READING), FPSTR(SENSORS_INA219)); + debug_outln_verbose(F("Reading #"), String(battery_val_count)); + + float voltage = ina219.getBusVoltage_V(); + battery_voltage_sum += static_cast(voltage * 1000); + battery_voltage_mV = battery_voltage_sum / battery_val_count; + + uint32_t current_draw = static_cast(ina219.getCurrent_mA()); + current_draw_sum += current_draw; + current_draw_mA = current_draw_sum / battery_val_count; - float battery_avg_value = battery_sum / static_cast(battery_val_count); - float ratio = cfg::adc_divider_u_max / static_cast(ADC_RANGE_MAX); - battery_analog_value = round(battery_avg_value * ratio); - debug_outln_verbose(F("Battery analog value (mV): "), String(battery_analog_value)); - String bat_min_max = String(cfg::battery_u_min) + " / " + String(cfg::battery_u_max); + uint32_t power_consumption = static_cast(ina219.getPower_mW()); + power_consumption_sum += power_consumption; + power_consumption_mW = power_consumption_sum / battery_val_count; + debug_outln_verbose(F("Battery voltge (mV): "), String(battery_voltage_mV)); + + // NOTE: This will fix issues with the map() function when the value of the 'battery_analog_value' is outside of the predefined range by any circumstances. + uint32_t battery_voltage_trimmed = (battery_voltage_mV < cfg::battery_u_min) + ? cfg::battery_u_min + : (battery_voltage_mV > cfg::battery_u_max) + ? cfg::battery_u_max + : battery_voltage_mV; - // This will fix issues with the map() function when the value of the 'battery_analog_value' is outside of the predefined range by any circumstances. - uint32_t battery_voltage = (battery_analog_value < (uint32_t)cfg::battery_u_min) ? (uint32_t)cfg::battery_u_min : battery_analog_value; - battery_voltage = (battery_voltage > (uint32_t)cfg::battery_u_max) ? (uint32_t)cfg::battery_u_max : battery_voltage; + battery_status = map(battery_voltage_trimmed, cfg::battery_u_min, cfg::battery_u_max, 0, 100); - battery_charge = map(battery_voltage, cfg::battery_u_min, cfg::battery_u_max, 0, 100); + debug_outln_verbose(F("Battery status (%): "), String(battery_status)); + debug_outln_verbose(F("Current draw (mA): "), String(current_draw_mA)); + debug_outln_verbose(F("Power consumption (mW): "), String(power_consumption_mW)); - debug_outln_verbose(F("Battery capacity (%): "), String(battery_charge)); - debug_outln_verbose(FPSTR(DBG_TXT_END_READING), F("Battery voltage")); + debug_outln_verbose(FPSTR(DBG_TXT_END_READING), FPSTR(SENSORS_INA219)); battery_monitor_period = act_milli; } @@ -4582,11 +4690,15 @@ static void readBatteryVoltage() { send Battery status *****************************************************************/ static void sendBatteryStatus(String& s) { - float battery_voltage = battery_analog_value / 1000.0; - add_Value2Json(s, F("Battery_voltage"), String(battery_voltage)); - add_Value2Json(s, F("battery_charge"), String(battery_charge)); - debug_outln_info(F("Battery (V): "), String(battery_voltage)); - debug_outln_info(F("Battery (%): "), String(battery_charge)); + float battery_voltage_data = battery_voltage_mV / 1000.0; + add_Value2Json(s, F("battery_voltage_V"), String(battery_voltage_data)); + add_Value2Json(s, F("battery_status"), String(battery_status)); + add_Value2Json(s, F("current_draw_mA"), String(current_draw_mA)); + add_Value2Json(s, F("power_consumption_mW"), String(power_consumption_mW)); + debug_outln_info(F("Battery (V): "), String(battery_voltage_data)); + debug_outln_info(F("Battery (%): "), String(battery_status)); + debug_outln_info(F("Current (mA): "), String(current_draw_mA)); + debug_outln_info(F("Power (mW): "), String(power_consumption_mW)); debug_outln_info(FPSTR(DBG_TXT_SEP)); } @@ -5487,6 +5599,29 @@ static bool initBMX280(char addr) } } +/***************************************************************** + * Init INA219 * + *****************************************************************/ +static bool initINA219() +{ + int n = sizeof(ina219_i2c_addresses) / sizeof(ina219_i2c_addresses[0]); + bool result = false; + for(int i = 0; i < n; i++) + { + ina219 = Adafruit_INA219(ina219_i2c_addresses[i]); + debug_out(String(F("Trying INA219 sensor on ")) + String(ina219_i2c_addresses[i], HEX), DEBUG_MIN_INFO); + if(!ina219.begin()){ + debug_outln_info(FPSTR(DBG_TXT_NOT_FOUND)); + } else { + debug_outln_info(FPSTR(DBG_TXT_FOUND)); + result = true; + break; + } + } + + return result; +} + /***************************************************************** Init SPS30 PM Sensor *****************************************************************/ @@ -5756,7 +5891,6 @@ static void powerOnTestSensors() { oneWire.begin(ONEWIRE_PIN); ds18b20.begin(); // Start DS18B20 - debug_outln_info(F("Read DS18B20...")); } if (cfg::dnms_read) @@ -5765,15 +5899,34 @@ static void powerOnTestSensors() initDNMS(); } - if (cfg::enable_battery_monitor){ - if(!ina219.begin()){ + if (cfg::enable_battery_monitor) + { + debug_outln_info(F("Read INA219...")); + if(!initINA219()) + { debug_outln_error(F("Check INA219 wiring")); ina219_init_failed = true; } else { - + switch(cfg::ina219_calibration) + { + case 2: + ina219.setCalibration_32V_1A(); + debug_outln_verbose(F("INA219 callibration's set to 32V, 1A")); + break; + case 3: + ina219.setCalibration_16V_400mA(); + debug_outln_verbose(F("INA219 callibration's set to 16V, 400mA")); + break; + case 1: + default: + ina219.setCalibration_32V_2A(); + debug_outln_verbose(F("INA219 callibration's set to 32V, 2A")); + break; + } + + ina219.powerSave(true); } } - } static void logEnabledAPIs() @@ -6128,10 +6281,12 @@ void loop(void) } } - if(cfg::enable_battery_monitor && !send_now){ - if (msSince(battery_start_time) > SAMPLETIME_BAT_MS){ + if(cfg::enable_battery_monitor && !send_now) + { + if (msSince(battery_start_time) > SAMPLETIME_BAT_MS) + { battery_start_time = act_milli; - readBatteryVoltage(); + readBatteryState(); } } diff --git a/airrohr-firmware/ext_def.h b/airrohr-firmware/ext_def.h index ffe93620e..53a097266 100644 --- a/airrohr-firmware/ext_def.h +++ b/airrohr-firmware/ext_def.h @@ -338,14 +338,15 @@ static const char MEASUREMENT_NAME_INFLUX[] PROGMEM = "feinstaub"; // Show device info on displays #define DISPLAY_DEVICE_INFO 1 +// Using INA219 based Volt & Current metter board #define ENABLE_BATTERY_MONITOR 0 -// Adc preset maximum input voltage applied to the voltage devider's input -#define ADC_DIVIDER_U_MAX 5120 - // Battery preset fully charged and discharged states voltages #define BATTERY_U_MAX 4200 #define BATTERY_U_MIN 2800 +// INA219 default calibration range of 32V, 2A +#define INA219_CALIBRATION 1 + // Set debug level for serial output? #define DEBUG 3 diff --git a/airrohr-firmware/html-content.h b/airrohr-firmware/html-content.h index 1ba786394..1cf478691 100644 --- a/airrohr-firmware/html-content.h +++ b/airrohr-firmware/html-content.h @@ -43,6 +43,7 @@ const char SENSORS_BMP180[] PROGMEM = "BMP180"; const char SENSORS_BME280[] PROGMEM = "BME280"; const char SENSORS_BMP280[] PROGMEM = "BMP280"; const char SENSORS_DNMS[] PROGMEM = "DNMS"; +const char SENSORS_INA219[] PROGMEM = "INA219"; const char WEB_PAGE_HEADER[] PROGMEM = "\ \ diff --git a/airrohr-firmware/intl_en.h b/airrohr-firmware/intl_en.h index afd3d342a..d933deb72 100644 --- a/airrohr-firmware/intl_en.h +++ b/airrohr-firmware/intl_en.h @@ -128,10 +128,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signal quality"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Value" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery charge"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor (INA219)"; +const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery status"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Current draw"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Power consumption"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Select calibration"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" From a11856723ca9af8cd4455c004a46b0fa38aa047a Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Thu, 19 Sep 2024 11:45:50 +0300 Subject: [PATCH 18/20] Resolve conflicts after merge from 'beta' --- airrohr-firmware/airrohr-firmware.ino | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 2489574e1..139a6ea04 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -1297,17 +1297,15 @@ static bool writeConfig() } /* NOTE: I suggest to keep this here for future use when new settings needs to be added */ - /* - debug_outln_verbose(F("ConfigShape element count: "), String(sizeof(configShape) / sizeof(configShape[0]))); - debug_outln_verbose(F("Json memory usage: "), String(json.memoryUsage())); - debug_outln_verbose(F("Json capacity: "), String(json.capacity())); - debug_outln_verbose(F("Configuration contents (config.json):")); - if(cfg::debug > DEBUG_MED_INFO) - { - serializeJson(json, Debug); - } - */ - + // debug_outln_verbose(F("ConfigShape element count: "), String(sizeof(configShape) / sizeof(configShape[0]))); + // debug_outln_verbose(F("Json memory usage: "), String(json.memoryUsage())); + // debug_outln_verbose(F("Json capacity: "), String(json.capacity())); + // debug_outln_verbose(F("Configuration contents (config.json):")); + // if(cfg::debug > DEBUG_MED_INFO) + // { + // serializeJson(json, Debug); + // } + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -6242,7 +6240,8 @@ void loop(void) { unsigned long sleep = SLEEPTIME_MS; String result_PPD, result_SDS, result_PMS, result_HPM, result_NPM, result_IPS; - String result_GPS, result_DNMS; + String result_GPS, result_DNMS, result_SCD30; + String result_BAT; unsigned sum_send_time = 0; From 896ba53e490439c44fa5566932e1ce6141f97fd8 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Sun, 29 Sep 2024 19:27:25 +0300 Subject: [PATCH 19/20] Add final touches on INA219 implementation; Add language translations; --- airrohr-firmware/Contributing.md | 2 ++ airrohr-firmware/airrohr-firmware.ino | 27 +++++++++++++++++---------- airrohr-firmware/intl_bg.h | 11 ++++++++--- airrohr-firmware/intl_br.h | 10 ++++++++++ airrohr-firmware/intl_cn.h | 12 ++++++++---- airrohr-firmware/intl_cz.h | 11 ++++++++--- airrohr-firmware/intl_de.h | 11 ++++++++--- airrohr-firmware/intl_dk.h | 11 ++++++++--- airrohr-firmware/intl_ee.h | 11 ++++++++--- airrohr-firmware/intl_en.h | 2 +- airrohr-firmware/intl_es.h | 11 ++++++++--- airrohr-firmware/intl_fi.h | 11 ++++++++--- airrohr-firmware/intl_fr.h | 11 ++++++++--- airrohr-firmware/intl_gr.h | 11 ++++++++--- airrohr-firmware/intl_hu.h | 11 ++++++++--- airrohr-firmware/intl_it.h | 11 ++++++++--- airrohr-firmware/intl_jp.h | 11 ++++++++--- airrohr-firmware/intl_lt.h | 11 ++++++++--- airrohr-firmware/intl_lu.h | 11 ++++++++--- airrohr-firmware/intl_lv.h | 11 ++++++++--- airrohr-firmware/intl_nl.h | 11 ++++++++--- airrohr-firmware/intl_pl.h | 11 ++++++++--- airrohr-firmware/intl_pt.h | 9 +++++++-- airrohr-firmware/intl_ro.h | 11 ++++++++--- airrohr-firmware/intl_rs.h | 12 +++++++++--- airrohr-firmware/intl_ru.h | 11 ++++++++--- airrohr-firmware/intl_se.h | 11 ++++++++--- airrohr-firmware/intl_si.h | 11 ++++++++--- airrohr-firmware/intl_sk.h | 11 ++++++++--- airrohr-firmware/intl_template.h | 14 ++++++++++---- airrohr-firmware/intl_tr.h | 10 ++++++++-- airrohr-firmware/intl_ua.h | 11 ++++++++--- 32 files changed, 256 insertions(+), 95 deletions(-) diff --git a/airrohr-firmware/Contributing.md b/airrohr-firmware/Contributing.md index f21421a80..aaf57e298 100644 --- a/airrohr-firmware/Contributing.md +++ b/airrohr-firmware/Contributing.md @@ -74,6 +74,7 @@ Additional Libraries needed for building: * [LiquidCrystal I2C](https://github.com/marcoschwartz/LiquidCrystal_I2C) (1.1.2) * [EspSoftwareSerial](https://github.com/plerup/espsoftwareserial)(6.3.0) * [TinyGPS++](http://arduiniana.org/libraries/tinygpsplus/) (1.0.2) (GNU Lesser Public License >=2.1) +* [Adafruit INA219](https://github.com/adafruit/Adafruit_INA219) (1.1.1) (BSD) ## Source Layout @@ -114,6 +115,7 @@ consistency accross and within the particular translation. | 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 | +| INA219 | Adafruit_INA219 | ina219_i2c_addresses[] | `Adafruit_INA219.h` | 0x40 (default), 0x41, 0x44, 0x45 | Do not forget to update the table above when you are implementing a new I2C device. diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 139a6ea04..5ac5d6cb6 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -49,8 +49,8 @@ ************************************************************************ * * latest build - * RAM: [==== ] 41.8% (used 34220 bytes from 81920 bytes) - * Flash: [======= ] 67.1% (used 701191 bytes from 1044464 bytes) + * RAM: [==== ] 41.8% (used 34276 bytes from 81920 bytes) + * Flash: [======= ] 67.8% (used 708175 bytes from 1044464 bytes) * ************************************************************************/ @@ -2449,15 +2449,21 @@ static void webserver_status() add_table_row_from_value(page_content, FPSTR(SENSORS_SDS011), last_value_SDS_version); } if (cfg::enable_battery_monitor){ - String battery_state_str = String(battery_voltage_mV / 1000.0) + "V | " + String(battery_status) + "%"; - add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_CHARGE), battery_state_str); + String battery_state_str = ina219_init_failed + ? "- V | - %" + : String(battery_voltage_mV / 1000.0) + "V | " + String(battery_status) + "%"; + add_table_row_from_value(page_content, FPSTR(INTL_BATTERY_STATE), battery_state_str); - String current_draw_str = current_draw_mA >= 1000 - ? String(static_cast(current_draw_mA) / 1000.0) + "A" - : String(current_draw_mA) + "mA"; + String current_draw_str = ina219_init_failed + ? "- mA" + : current_draw_mA >= 1000 + ? String(static_cast(current_draw_mA) / 1000.0) + "A" + : String(current_draw_mA) + "mA"; add_table_row_from_value(page_content, FPSTR(INTL_CURRENT_DRAW), current_draw_str); - String power_consumption_str = power_consumption_mW >= 1000 + String power_consumption_str = ina219_init_failed + ? "- mW" + : power_consumption_mW >= 1000 ? String(static_cast(power_consumption_mW) / 1000.0) + "W" : String(power_consumption_mW) + "mW"; add_table_row_from_value(page_content, FPSTR(INTL_POWER_CONSUMPTION), power_consumption_str); @@ -5636,7 +5642,8 @@ static bool initINA219() { ina219 = Adafruit_INA219(ina219_i2c_addresses[i]); debug_out(String(F("Trying INA219 sensor on ")) + String(ina219_i2c_addresses[i], HEX), DEBUG_MIN_INFO); - if(!ina219.begin()){ + if(!ina219.begin()) + { debug_outln_info(FPSTR(DBG_TXT_NOT_FOUND)); } else { debug_outln_info(FPSTR(DBG_TXT_FOUND)); @@ -6309,7 +6316,7 @@ void loop(void) } } - if(cfg::enable_battery_monitor && !send_now) + if(cfg::enable_battery_monitor && !ina219_init_failed && !send_now) { if (msSince(battery_start_time) > SAMPLETIME_BAT_MS) { diff --git a/airrohr-firmware/intl_bg.h b/airrohr-firmware/intl_bg.h index f60dfb57f..d2cf8caad 100644 --- a/airrohr-firmware/intl_bg.h +++ b/airrohr-firmware/intl_bg.h @@ -129,11 +129,16 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество на сигнала #define INTL_SENSOR "Сензор" #define INTL_PARAMETER "Параметър" #define INTL_VALUE "Стойност" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активиране на монитора на батерията"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд на батерията"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активиране на монитора на батерията (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Състояние на батерията"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Консумация на ток"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Консумация на енергия"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерията (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерията (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Изберете калибриране"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; //const char LUFTDATEN_INFO_LOGO_SVG[] PROGMEM = ""; diff --git a/airrohr-firmware/intl_br.h b/airrohr-firmware/intl_br.h index 1075e3b1d..39fecc56f 100644 --- a/airrohr-firmware/intl_br.h +++ b/airrohr-firmware/intl_br.h @@ -128,5 +128,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualidade do Sinal"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parâmetro" #define INTL_VALUE "Valor" +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Аtivar monitor de bateria (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Status da bateria"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Consumo de corrente"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consumo de energia"; +const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Selecione a calibração"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_cn.h b/airrohr-firmware/intl_cn.h index 3d504c208..dfc712646 100644 --- a/airrohr-firmware/intl_cn.h +++ b/airrohr-firmware/intl_cn.h @@ -129,11 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "信号质量"; #define INTL_SENSOR "传感器" #define INTL_PARAMETER "参数" #define INTL_VALUE "价值" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "启用电池监控器"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "电池充电"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "启用电池监控器 (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "电池状态"; +const char INTL_CURRENT_DRAW[] PROGMEM = "电流消耗"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "功耗"; const char INTL_BATTERY_U_MIN[] PROGMEM = "电池 U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "电池 U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC分频器 U max (mV)"; - +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "选择校准"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_cz.h b/airrohr-firmware/intl_cz.h index 4f6605ef6..a2ebcf28a 100644 --- a/airrohr-firmware/intl_cz.h +++ b/airrohr-firmware/intl_cz.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalita signálu"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Hodnota" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povolit sledování baterie"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Nabíjení baterie"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povolit sledování baterie (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Stav baterie"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Odběr proudu"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Spotřeba energie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterie U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Dělič ADP U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Vyberte kalibraci"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_de.h b/airrohr-firmware/intl_de.h index 08df5e921..d6ba57524 100644 --- a/airrohr-firmware/intl_de.h +++ b/airrohr-firmware/intl_de.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualität"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wert" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Batteriemonitor aktivieren"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterieladung"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Batteriemonitor aktivieren (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Batteriestatus"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Stromaufnahme"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Stromverbrauch"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADW teiler U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Kalibrierung auswählen"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_dk.h b/airrohr-firmware/intl_dk.h index efe4957f0..794fc6d1f 100644 --- a/airrohr-firmware/intl_dk.h +++ b/airrohr-firmware/intl_dk.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Værdi" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivér batteriskærm"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Batteriopladning"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivér batteriskærm (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Batteristatus"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Strømtræk"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Strømforbrug"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADK divider U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Vælg kalibrering"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ee.h b/airrohr-firmware/intl_ee.h index c6a74b54d..cc142831c 100644 --- a/airrohr-firmware/intl_ee.h +++ b/airrohr-firmware/intl_ee.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signaali kvaliteet"; #define INTL_SENSOR "Andur" #define INTL_PARAMETER "Parameeter" #define INTL_VALUE "Väärtus" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Luba aku monitor"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Aku laadimine"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Luba aku monitor (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Aku olek"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Voolutarve"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Energiatarve"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Aku U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Aku U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC eraldaja U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Valige kalibreerimine"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_en.h b/airrohr-firmware/intl_en.h index 41b8b5ef2..c4e40801d 100644 --- a/airrohr-firmware/intl_en.h +++ b/airrohr-firmware/intl_en.h @@ -130,7 +130,7 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signal quality"; #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Value" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor (INA219)"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery status"; +const char INTL_BATTERY_STATE[] PROGMEM = "Battery status"; const char INTL_CURRENT_DRAW[] PROGMEM = "Current draw"; const char INTL_POWER_CONSUMPTION[] PROGMEM = "Power consumption"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; diff --git a/airrohr-firmware/intl_es.h b/airrohr-firmware/intl_es.h index 66be1ab1c..34791888c 100644 --- a/airrohr-firmware/intl_es.h +++ b/airrohr-firmware/intl_es.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Calidad de Señal"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parámetro" #define INTL_VALUE "Valor" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de batería"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Bateria cargada"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de batería (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Estado de la batería"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Consumo de corriente"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consumo de energía"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batería U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batería U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Divisor CAD U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Seleccionar calibración"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_fi.h b/airrohr-firmware/intl_fi.h index b8884b275..86e32f1ce 100644 --- a/airrohr-firmware/intl_fi.h +++ b/airrohr-firmware/intl_fi.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signaalin laatu"; #define INTL_SENSOR "Anturi" #define INTL_PARAMETER "Parametri" #define INTL_VALUE "Arvo" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ota akkumonitori käyttöön"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Akun varaus"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ota akkumonitori käyttöön (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Akun tila"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Virranotto"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Virrankulutus"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Akku U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Akku U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC-jakaja U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Valitse kalibrointi"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_fr.h b/airrohr-firmware/intl_fr.h index c3a679c6f..ce05458d6 100644 --- a/airrohr-firmware/intl_fr.h +++ b/airrohr-firmware/intl_fr.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualité du signal"; #define INTL_SENSOR "Capteur" #define INTL_PARAMETER "Paramètres" #define INTL_VALUE "Valeur" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Activer le moniteur de batterie"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Charge de la batterie"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Activer le moniteur de batterie (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "État de la batterie"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Consommation de courant"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consommation d'énergie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Diviseur de CAN U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Sélectionner l'étalonnage"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_gr.h b/airrohr-firmware/intl_gr.h index 48cdfa72f..cf00df75a 100644 --- a/airrohr-firmware/intl_gr.h +++ b/airrohr-firmware/intl_gr.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "ποιότητα σήματος"; #define INTL_SENSOR "Αισθητήρας" #define INTL_PARAMETER "Παράμετρος" #define INTL_VALUE "Αξία" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ενεργοποίηση οθόνης μπαταρίας"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Φόρτιση μπαταρίας"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Ενεργοποίηση οθόνης μπαταρίας (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Κατάσταση μπαταρίας"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Τραβήξτε ρεύμα"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Κατανάλωση ρεύματος"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Μπαταρία U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Μπαταρία U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "Διαχωριστικό ADC U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Επιλέξτε βαθμονόμηση"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_hu.h b/airrohr-firmware/intl_hu.h index f943360b8..df133bc1e 100644 --- a/airrohr-firmware/intl_hu.h +++ b/airrohr-firmware/intl_hu.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jelminőség"; #define INTL_SENSOR "Szenzor" #define INTL_PARAMETER "Paraméter" #define INTL_VALUE "Érték" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Engedélyezze az akkumulátorfigyelőt"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Akkumulátortöltő"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Engedélyezze az akkumulátorfigyelőt (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Az akkumulátor állapota"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Áramfelvétel"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Energiafogyasztás"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Akkumulátor U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Akkumulátor U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADA elválasztó U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Válassza ki a kalibrálást"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_it.h b/airrohr-firmware/intl_it.h index 58b7d06f7..851659bf3 100644 --- a/airrohr-firmware/intl_it.h +++ b/airrohr-firmware/intl_it.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualità del segnale"; #define INTL_SENSOR "Sensore" #define INTL_PARAMETER "Parametro" #define INTL_VALUE "Valore" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Abilita il monitoraggio della batteria"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Carica batterie"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Abilita il monitoraggio della batteria (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Stato della batteria"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Assorbimento di corrente"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consumo energetico"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteria U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisore U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Seleziona la calibrazione"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_jp.h b/airrohr-firmware/intl_jp.h index 0abedd119..ff740a0c2 100644 --- a/airrohr-firmware/intl_jp.h +++ b/airrohr-firmware/intl_jp.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "信号品質"; #define INTL_SENSOR "センサー" #define INTL_PARAMETER "パラメータ" #define INTL_VALUE "価値" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "バッテリーモニターを有効にする"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "充電"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "バッテリーモニターを有効にする (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "バッテリーの状態"; +const char INTL_CURRENT_DRAW[] PROGMEM = "消費電流"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "消費電力"; const char INTL_BATTERY_U_MIN[] PROGMEM = "電池 U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "電池 U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC分周器 U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "キャリブレーションを選択"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lt.h b/airrohr-firmware/intl_lt.h index 924ddfb3c..ad1654e01 100644 --- a/airrohr-firmware/intl_lt.h +++ b/airrohr-firmware/intl_lt.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signalo kokybė"; #define INTL_SENSOR "Jutiklis" #define INTL_PARAMETER "Parametras" #define INTL_VALUE "Vertė" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Įgalinti akumuliatoriaus monitorių"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Baterijos įkrovimas"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Įgalinti akumuliatoriaus monitorių (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Baterijos būsena"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Srovės trauka"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Energijos suvartojimas"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterija U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterija U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC daliklis U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Pasirinkite kalibravimą"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lu.h b/airrohr-firmware/intl_lu.h index 7419a21c8..0c569ede9 100644 --- a/airrohr-firmware/intl_lu.h +++ b/airrohr-firmware/intl_lu.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualitéit"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Wäert" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivéiert Batterie Monitor"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterieladung"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivéiert Batterie Monitor (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Batterie Status"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Aktuell Zeechnen"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Stroumverbrauch"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batterie U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batterie U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Wielt Kalibratioun"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_lv.h b/airrohr-firmware/intl_lv.h index d27f5861f..6a2b24271 100644 --- a/airrohr-firmware/intl_lv.h +++ b/airrohr-firmware/intl_lv.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signāla kvalitāte"; #define INTL_SENSOR "Sensors" #define INTL_PARAMETER "Parametrs" #define INTL_VALUE "Vērtība" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Akumulatora uzlāde"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Akumulatora statuss"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Strāvas patēriņš"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Enerģijas patēriņš"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Akumulators U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Akumulators U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC dalītājs U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Izvēlieties kalibrēšanu"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_nl.h b/airrohr-firmware/intl_nl.h index e4b14eed0..9ed8dce66 100644 --- a/airrohr-firmware/intl_nl.h +++ b/airrohr-firmware/intl_nl.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Signaalkwaliteit"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Waarde" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Schakel de batterijmonitor in"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Batterijlading"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Schakel de batterijmonitor in (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Batterijstatus"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Stroomafname"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Stroomverbruik"; const char INTL_BATTERY_U_MIN[] PROGMEM = "batterij U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "batterij U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADO divider U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Selecteer kalibratie"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_pl.h b/airrohr-firmware/intl_pl.h index 67664e155..b634b731d 100644 --- a/airrohr-firmware/intl_pl.h +++ b/airrohr-firmware/intl_pl.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Jakość sygnału"; #define INTL_SENSOR "Czujnik" #define INTL_PARAMETER "Parametr" #define INTL_VALUE "Wartość" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Włącz monitor baterii"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Ładowanie baterii"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Włącz monitor baterii (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Stan baterii"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Pobór prądu"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Pobór mocy"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ACP dzielnik U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Wybierz kalibrację"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_pt.h b/airrohr-firmware/intl_pt.h index 10f16ff3e..1e22e9223 100644 --- a/airrohr-firmware/intl_pt.h +++ b/airrohr-firmware/intl_pt.h @@ -130,9 +130,14 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualidade do Sinal"; #define INTL_PARAMETER "Parâmetro" #define INTL_VALUE "Valor" const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Habilitar monitor de bateria"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Carga da bateria"; +const char INTL_BATTERY_STATE[] PROGMEM = "Estado da bateria"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Consumo atual"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consumo de energia"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Bateria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Bateria U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divisor U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Selecione a calibração"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ro.h b/airrohr-firmware/intl_ro.h index b5c0e688d..10f74c0ff 100644 --- a/airrohr-firmware/intl_ro.h +++ b/airrohr-firmware/intl_ro.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "calitatea semnalului"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parametru" #define INTL_VALUE "Valoare" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Akumulatora uzlāde"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Iespējot akumulatora monitoru (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Starea bateriei"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Consumul de curent"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Consum de putere"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Akumulators U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Akumulators U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC dalītājs U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Selectați calibrarea"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_rs.h b/airrohr-firmware/intl_rs.h index 168e33910..e7898b31b 100644 --- a/airrohr-firmware/intl_rs.h +++ b/airrohr-firmware/intl_rs.h @@ -129,10 +129,16 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalitet signala"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parametar" #define INTL_VALUE "Vrednost" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активирајте монитор батерије"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Пуњење батерије"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активирајте монитор батерије (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Статус батерије"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Повлачење струје"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Потрошња енергије"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батерије (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батерије (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "АДП разделник U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Изаберите калибрацију"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; + #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ru.h b/airrohr-firmware/intl_ru.h index e3f789307..6001325c5 100644 --- a/airrohr-firmware/intl_ru.h +++ b/airrohr-firmware/intl_ru.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Качество"; #define INTL_SENSOR "Датчик" #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значение" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активируйте монитор батареи"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд батареи"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активируйте монитор батареи (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Состояние батареи"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Потребляемый ток"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Потребляемая мощность"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареи (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареи (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при делителя на АЦП (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Выберите калибровку"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_se.h b/airrohr-firmware/intl_se.h index 93d7954f6..bc9508e20 100644 --- a/airrohr-firmware/intl_se.h +++ b/airrohr-firmware/intl_se.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Kvalitet"; #define INTL_SENSOR "Sensor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Värde" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivera batteriövervakare"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Batteriladdning"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Aktivera batteriövervakare (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Batteristatus"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Strömdrag"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Energiförbrukning"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batteri U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batteri U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADО divider U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Välj kalibrering"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_si.h b/airrohr-firmware/intl_si.h index 22da76ad1..25e966199 100644 --- a/airrohr-firmware/intl_si.h +++ b/airrohr-firmware/intl_si.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kakovost signala"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Vrednost" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Omogoči nadzor baterije"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Polnjenje baterije"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Omogoči nadzor baterije (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Stanje baterije"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Poraba toka"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Poraba energije"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Baterija U min (mV)"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Baterija U max (mV)"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC delilnik U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Izberite kalibracijo"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_sk.h b/airrohr-firmware/intl_sk.h index 915829877..3315ad671 100644 --- a/airrohr-firmware/intl_sk.h +++ b/airrohr-firmware/intl_sk.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "kvalita signálu"; #define INTL_SENSOR "Senzor" #define INTL_PARAMETER "Parameter" #define INTL_VALUE "Hodnota" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povoliť sledovanie batérie"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Nabitie batérie"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Povoliť sledovanie batérie (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Stav batérie"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Odber prúdu"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Spotreba energie"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Batéria U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Batéria U max (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADP rozdeľovač U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Vyberte kalibráciu"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_template.h b/airrohr-firmware/intl_template.h index 2807132ae..6477acb58 100644 --- a/airrohr-firmware/intl_template.h +++ b/airrohr-firmware/intl_template.h @@ -129,10 +129,16 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = ""; #define INTL_SENSOR "" #define INTL_PARAMETER "" #define INTL_VALUE "" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Enable battery monitor"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Battery charge"; -const char INTL_BATTERY_U_MIN[] PROGMEM = "Battery U min (mV)"; -const char INTL_BATTERY_U_MAX[] PROGMEM = "Battery U max (mV)"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = " (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = ""; +const char INTL_CURRENT_DRAW[] PROGMEM = ""; +const char INTL_POWER_CONSUMPTION[] PROGMEM = ""; +const char INTL_BATTERY_U_MIN[] PROGMEM = " U min (mV)"; +const char INTL_BATTERY_U_MAX[] PROGMEM = " U max (mV)"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADC divider U max (mV)"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = ""; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_tr.h b/airrohr-firmware/intl_tr.h index 77050e0ed..3ba6a3c82 100644 --- a/airrohr-firmware/intl_tr.h +++ b/airrohr-firmware/intl_tr.h @@ -129,10 +129,16 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "sinyal kalitesi"; #define INTL_SENSOR "algılayıcı(Sensör)" #define INTL_PARAMETER "Parametre" #define INTL_VALUE "değer" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Pil monitörünü etkinleştir"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Pil şarjı"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Pil monitörünü etkinleştir (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Pil durumu"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Akım çekişi"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Güç tüketimi"; const char INTL_BATTERY_U_MIN[] PROGMEM = "Pil U min (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "Pil U max (mV):"; const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "ADD bölücü U max (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Kalibrasyonu seçin"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" diff --git a/airrohr-firmware/intl_ua.h b/airrohr-firmware/intl_ua.h index c669695d7..076723f10 100644 --- a/airrohr-firmware/intl_ua.h +++ b/airrohr-firmware/intl_ua.h @@ -129,10 +129,15 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "якість сигналу"; #define INTL_SENSOR "Сенсор" #define INTL_PARAMETER "Параметр" #define INTL_VALUE "Значення" -const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активуйте монітор батареї"; -const char INTL_BATTERY_CHARGE[] PROGMEM = "Заряд акумулятора"; +const char INTL_ENABLE_BATTERY_MONITOR[] PROGMEM = "Активуйте монітор батареї (INA219)"; +const char INTL_BATTERY_STATE[] PROGMEM = "Стан батареї"; +const char INTL_CURRENT_DRAW[] PROGMEM = "Споживання струму"; +const char INTL_POWER_CONSUMPTION[] PROGMEM = "Споживана потужність"; const char INTL_BATTERY_U_MIN[] PROGMEM = "U min на батареї (mV):"; const char INTL_BATTERY_U_MAX[] PROGMEM = "U max на батареї (mV):"; -const char INTL_ADC_DIVIDER_U_MAX[] PROGMEM = "U max при подільника на АЦП (mV):"; +const char INTL_INA219_SELECT_CALIBRATION[] PROGMEM = "Виберіть калібрування"; +const char INTL_INA219_CAL_32V_2A[] PROGMEM = "32V, 2A"; +const char INTL_INA219_CAL_32V_1A[] PROGMEM = "32V, 1A"; +const char INTL_INA219_CAL_16V_400MA[] PROGMEM = "16V, 400mA"; #include "./airrohr-logo-common.h" From 421d7475bb0c9b55112c76c802f3074b5f455a67 Mon Sep 17 00:00:00 2001 From: Georgi Vidinski Date: Mon, 30 Sep 2024 04:40:21 +0300 Subject: [PATCH 20/20] Crear unrelated workflow files --- .github/workflows/beta-ssn-build.yml | 67 --------------- .github/workflows/beta-ssn-pull.yml | 51 ------------ .github/workflows/master-ssn-build.yml | 66 --------------- .github/workflows/master-ssn-pull.yml | 51 ------------ .github/workflows/release_ssn.yml | 85 ------------------- .github/workflows/test.yml | 110 ------------------------- 6 files changed, 430 deletions(-) delete mode 100644 .github/workflows/beta-ssn-build.yml delete mode 100644 .github/workflows/beta-ssn-pull.yml delete mode 100644 .github/workflows/master-ssn-build.yml delete mode 100644 .github/workflows/master-ssn-pull.yml delete mode 100644 .github/workflows/release_ssn.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/beta-ssn-build.yml b/.github/workflows/beta-ssn-build.yml deleted file mode 100644 index 315a5485e..000000000 --- a/.github/workflows/beta-ssn-build.yml +++ /dev/null @@ -1,67 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: beta-ssn build status - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - push: - branches: - - beta-ssn - create: - branches: - - beta-ssn - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - prod-check-and-build: - if: github.ref_type != 'tag' - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - - name: Load dependencies from cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - # Runs a single command using the runners shell - #- name: Run a one-line script - # run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip3 install platformio - platformio --version - - - name: Run 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: Upload Release - # uses: ncipollo/release-action@v1 - # with: - # artifacts: "../airrohr-firmware/builds/*" - # token: ${{ secrets.GITHUB_TOKEN }} - # # Instead add tags through every Release related commit - # # tag: vSSN-NRZ-2021-134-B5 diff --git a/.github/workflows/beta-ssn-pull.yml b/.github/workflows/beta-ssn-pull.yml deleted file mode 100644 index 0451ade16..000000000 --- a/.github/workflows/beta-ssn-pull.yml +++ /dev/null @@ -1,51 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: beta-ssn pr status - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - pull_request: - branches: - - beta-ssn - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - - name: Load dependencies from cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - # Runs a set of commands using the runners shell - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip3 install platformio - platformio --version - - - name: Run 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/ diff --git a/.github/workflows/master-ssn-build.yml b/.github/workflows/master-ssn-build.yml deleted file mode 100644 index 7ad860ab6..000000000 --- a/.github/workflows/master-ssn-build.yml +++ /dev/null @@ -1,66 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: master-ssn build status - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - push: - branches: - - master-ssn - create: - branches: - - master-ssn - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - - name: Load dependencies from cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - # Runs a single command using the runners shell - #- name: Run a one-line script - # run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip3 install platformio - platformio --version - - - name: Run 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: Upload Release - # uses: ncipollo/release-action@v1 - # with: - # artifacts: "../airrohr-firmware/builds/*" - # token: ${{ secrets.GITHUB_TOKEN }} - # # Instead add tags through every Release related commit - # # tag: vSSN-NRZ-2021-134-B5 diff --git a/.github/workflows/master-ssn-pull.yml b/.github/workflows/master-ssn-pull.yml deleted file mode 100644 index 9a875f5a5..000000000 --- a/.github/workflows/master-ssn-pull.yml +++ /dev/null @@ -1,51 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: master-ssn pr status - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - pull_request: - branches: - - master-ssn - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - - name: Load dependencies from cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - # Runs a set of commands using the runners shell - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip3 install platformio - platformio --version - - - name: Run 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/ diff --git a/.github/workflows/release_ssn.yml b/.github/workflows/release_ssn.yml deleted file mode 100644 index 4569efb58..000000000 --- a/.github/workflows/release_ssn.yml +++ /dev/null @@ -1,85 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: Create SSN Release - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - push: - # branches: - # - master-ssn - # - beta-ssn - tags: - - 'SSN-*' - - # Allows you to run this workflow manually from the Actions tab - # workflow_dispatch: - - # - name: Echo some Environment variables - # run: | - # echo github.run_number ${{ github.run_number }} - # echo GITHUB_REF $GITHUB_REF - # echo GITHUB_REF_NAME $GITHUB_REF_NAME - # echo GITHUB_REF_TYPE $GITHUB_REF_TYPE - # echo GITHUB_HEAD_REF $GITHUB_HEAD_REF - # echo GITHUB_BASE_REF $GITHUB_BASE_REF - -jobs: - prod-check-and-release: - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && contains(github.ref_name, 'SSN') - runs-on: ubuntu-latest - steps: - - run: echo "Creating release version $GITHUB_REF" - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Load dependencies from cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Run counter - run: echo github.run_number ${{ github.run_number }} - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip3 install platformio - platformio --version - - name: Run 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 List all - # run: pwd && ls -l airrohr-firmware/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 - 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 - with: - if-no-files-found: error - name: airrohr-update-loader - path: airrohr-update-loader/builds/latest_loader.bin - retention-days: 30 - - name: Upload Release - uses: ncipollo/release-action@v1 - with: - artifacts: "airrohr-firmware-builds.tar.gz, airrohr-update-loader/builds/latest_loader.bin" - token: ${{ secrets.GITHUB_TOKEN }} - # Use tag on push event - #tag: SSN-NRZ-2022-134-B${{ github.run_number }} - tag: ${{ github.ref_name }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index d107589bd..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,110 +0,0 @@ -# SSN Airrohr Firmware CI workflow - -name: SSN test (test.yml) - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master-ssn branch - push: - tags: - - 'TEST-*' - # branches: - # - actions* - # create: - # branches: - # - actions* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - # - name: Dump GitHub context - # env: - # GITHUB_CONTEXT: ${{ toJson(github) }} - # run: echo "$GITHUB_CONTEXT" - # - name: Extract branch name - # shell: bash - # run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" - # - name: Test - # run: echo "${BRANCH_NAME}" - -# # A workflow run is made up of one or more jobs that can run sequentially or in parallel -# jobs: -# # This workflow contains a single job called "build" -# build: -# # The type of runner that the job will run on -# runs-on: ubuntu-latest - -# # map a step output to a job output -# # outputs: -# # version_num: ${{steps.version.outputs.VERSION}} - -# # Steps represent a sequence of tasks that will be executed as part of the job -# steps: -# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it -# - name: Checkout -# uses: actions/checkout@v2 - -# - name: Set up Python -# uses: actions/setup-python@v2 -# with: -# python-version: '3.7' - -# - name: Load dependencies from cache -# uses: actions/cache@v2 -# with: -# path: ~/.cache/pip -# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} -# restore-keys: | -# ${{ runner.os }}-pip- - -# # Runs a single command using the runners shell -# - name: Run a one-line script -# run: echo github.run_number ${{ github.run_number }} - -# # Runs a set of commands using the runners shell -# - name: Install dependencies -# run: | -# python3 -m pip install --upgrade pip -# pip3 install platformio -# platformio --version - -# - name: Run 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 List all -# run: pwd && ls -l airrohr-firmware/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 -# 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 -# with: -# if-no-files-found: error -# name: airrohr-update-loader -# path: airrohr-update-loader/builds/latest_loader.bin -# retention-days: 30 - -# - name: Upload Release -# uses: ncipollo/release-action@v1 -# with: -# artifacts: "airrohr-firmware-builds.tar.gz, airrohr-update-loader/builds/latest_loader.bin" -# token: ${{ secrets.GITHUB_TOKEN }} -# # Instead add tags through every Release related commit -# tag: SSN-NRZ-2022-134-B${{ github.run_number }}