Skip to content

Commit b85cdc4

Browse files
committed
Better highlight BME280 and BMP280
We can differenciate easily what variant of Bosh sensors we have, so name it clearly in the UI. Also show the differnce between BMP and BME in the config dialog.
1 parent 03fee73 commit b85cdc4

24 files changed

+39
-35
lines changed

airrohr-firmware/Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Pinout:
120120
* Pin 7 (RX) -> Pin D2 (GPIO4)
121121
* Pin 8 (GND) -> GND
122122

123-
### BMP180 / BMP280 / BME280 / HTU21D / SHT3x (I2C)
123+
### BMP180 / BME/P280 / HTU21D / SHT3x (I2C)
124124
* VCC -> Pin 3V3
125125
* GND -> Pin GND
126126
* SCL -> Pin D4 (GPIO2)
@@ -163,9 +163,9 @@ the following API pins hardcoded. These match what the Sensor.Community API expe
163163
by default when selecting the correct sensor model.
164164

165165
* HPM/PMS/SDS011/SPS30 => Pin 1
166+
* BME280 => Pin 11
166167
* BMP180/BMP280 => Pin 3
167168
* DHT22/HTU21D/SHT3x => Pin 7
168169
* GPS(Neo-6M) => Pin 9
169-
* BME280 => Pin 11
170170
* DS18B20 => Pin 13
171171
* DNMS +> Pin 15

airrohr-firmware/Versions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
NRZ-2020-130-B11
22
* Remove floating point subroutines from IRAM (related to #789)
3+
* Show clearly in webui whether we have BME280 or a BMP280
34

45
NRZ-2020-130-B10
56
* Show GPS date+time also as datetime timestamp

airrohr-firmware/airrohr-firmware.ino

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,10 +1483,11 @@ static void webserver_values() {
14831483
page_content += FPSTR(EMPTY_ROW);
14841484
}
14851485
if (cfg::bmx280_read) {
1486-
add_table_t_value(FPSTR(SENSORS_BMX280), FPSTR(INTL_TEMPERATURE), last_value_BMX280_T);
1487-
add_table_value(FPSTR(SENSORS_BMX280), FPSTR(INTL_PRESSURE), check_display_value(last_value_BMX280_P / 100.0f, (-1 / 100.0f), 2, 0), unit_P);
1486+
const char* const sensor_name = (bmx280.sensorID() == BME280_SENSOR_ID) ? SENSORS_BME280 : SENSORS_BMP280;
1487+
add_table_t_value(FPSTR(sensor_name), FPSTR(INTL_TEMPERATURE), last_value_BMX280_T);
1488+
add_table_value(FPSTR(sensor_name), FPSTR(INTL_PRESSURE), check_display_value(last_value_BMX280_P / 100.0f, (-1 / 100.0f), 2, 0), unit_P);
14881489
if (bmx280.sensorID() == BME280_SENSOR_ID) {
1489-
add_table_h_value(FPSTR(SENSORS_BMX280), FPSTR(INTL_HUMIDITY), last_value_BME280_H);
1490+
add_table_h_value(FPSTR(sensor_name), FPSTR(INTL_HUMIDITY), last_value_BME280_H);
14901491
}
14911492
page_content += FPSTR(EMPTY_ROW);
14921493
}
@@ -2389,7 +2390,8 @@ static void fetchSensorSHT3x(String& s) {
23892390
* read BMP280/BME280 sensor values *
23902391
*****************************************************************/
23912392
static void fetchSensorBMX280(String& s) {
2392-
debug_outln_verbose(FPSTR(DBG_TXT_START_READING), FPSTR(SENSORS_BMX280));
2393+
const char* const sensor_name = (bmx280.sensorID() == BME280_SENSOR_ID) ? SENSORS_BME280 : SENSORS_BMP280;
2394+
debug_outln_verbose(FPSTR(DBG_TXT_START_READING), FPSTR(sensor_name));
23932395

23942396
bmx280.takeForcedMeasurement();
23952397
const auto t = bmx280.readTemperature();
@@ -2414,7 +2416,7 @@ static void fetchSensorBMX280(String& s) {
24142416
}
24152417
}
24162418
debug_outln_info(FPSTR(DBG_TXT_SEP));
2417-
debug_outln_verbose(FPSTR(DBG_TXT_END_READING), FPSTR(SENSORS_BMX280));
2419+
debug_outln_verbose(FPSTR(DBG_TXT_END_READING), FPSTR(sensor_name));
24182420
}
24192421

24202422
/*****************************************************************
@@ -3595,11 +3597,11 @@ static void display_values() {
35953597
p_value = last_value_BMP_P;
35963598
}
35973599
if (cfg::bmx280_read) {
3598-
t_sensor = p_sensor = FPSTR(SENSORS_BMX280);
3600+
t_sensor = p_sensor = FPSTR(SENSORS_BMP280);
35993601
t_value = last_value_BMX280_T;
36003602
p_value = last_value_BMX280_P;
36013603
if (bmx280.sensorID() == BME280_SENSOR_ID) {
3602-
h_sensor = FPSTR(SENSORS_BMX280);
3604+
h_sensor = t_sensor = FPSTR(SENSORS_BME280);
36033605
h_value = last_value_BME280_H;
36043606
}
36053607
}
@@ -3848,7 +3850,7 @@ static void init_display() {
38483850
* Init BMP280/BME280 *
38493851
*****************************************************************/
38503852
static bool initBMX280(char addr) {
3851-
debug_out(String(F("Trying BMP280/BME280 sensor on ")) + String(addr, HEX), DEBUG_MIN_INFO);
3853+
debug_out(String(F("Trying BMx280 sensor on ")) + String(addr, HEX), DEBUG_MIN_INFO);
38523854

38533855
if (bmx280.begin(addr)) {
38543856
debug_outln_info(FPSTR(DBG_TXT_FOUND));
@@ -4031,9 +4033,9 @@ static void powerOnTestSensors() {
40314033
}
40324034

40334035
if (cfg::bmx280_read) {
4034-
debug_outln_info(F("Read BMP280/BME280..."));
4036+
debug_outln_info(F("Read BMxE280..."));
40354037
if (!initBMX280(0x76) && !initBMX280(0x77)) {
4036-
debug_outln_error(F("Check BMP280/BME280 wiring"));
4038+
debug_outln_error(F("Check BMx280 wiring"));
40374039
bmx280_init_failed = true;
40384040
}
40394041
}
@@ -4431,9 +4433,9 @@ void loop(void) {
44314433
fetchSensorBMX280(result);
44324434
data += result;
44334435
if (bmx280.sensorID() == BME280_SENSOR_ID) {
4434-
sum_send_time += sendSensorCommunity(result, BME280_API_PIN, FPSTR(SENSORS_BMX280), "BME280_");
4436+
sum_send_time += sendSensorCommunity(result, BME280_API_PIN, FPSTR(SENSORS_BME280), "BME280_");
44354437
} else {
4436-
sum_send_time += sendSensorCommunity(result, BMP280_API_PIN, FPSTR(SENSORS_BMX280), "BMP280_");
4438+
sum_send_time += sendSensorCommunity(result, BMP280_API_PIN, FPSTR(SENSORS_BMP280), "BMP280_");
44374439
}
44384440
result = emptyString;
44394441
}

airrohr-firmware/html-content.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const char SENSORS_DS18B20[] PROGMEM = "DS18B20";
3434
const char SENSORS_HTU21D[] PROGMEM = "HTU21D";
3535
const char SENSORS_SHT3X[] PROGMEM = "SHT3x";
3636
const char SENSORS_BMP180[] PROGMEM = "BMP180";
37-
const char SENSORS_BMX280[] PROGMEM = "BMP/E280";
37+
const char SENSORS_BME280[] PROGMEM = "BME280";
38+
const char SENSORS_BMP280[] PROGMEM = "BMP280";
3839
const char SENSORS_DNMS[] PROGMEM = "DNMS";
3940

4041
const char WEB_PAGE_HEADER[] PROGMEM = "<!DOCTYPE html><html lang='" INTL_LANG "'>\

airrohr-firmware/intl_bg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2727
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2828
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
2929
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
30-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
30+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3131
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3232
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3333
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

airrohr-firmware/intl_cz.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2828
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2929
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
3030
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
31-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
31+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3232
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3333
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3434
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

airrohr-firmware/intl_de.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2828
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2929
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
3030
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
31-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
31+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3232
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3333
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3434
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

airrohr-firmware/intl_dk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2828
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2929
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
3030
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
31-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
31+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3232
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3333
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3434
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

airrohr-firmware/intl_en.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2828
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2929
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
3030
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
31-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
31+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3232
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3333
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3434
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

airrohr-firmware/intl_es.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const char INTL_PPD42NS[] PROGMEM = "PPD42NS ({pm})";
2727
const char INTL_DHT22[] PROGMEM = "DHT22 ({t}, {h})";
2828
const char INTL_HTU21D[] PROGMEM = "HTU21D ({t}, {h})";
2929
const char INTL_BMP180[] PROGMEM = "BMP180 ({t}, {p})";
30-
const char INTL_BMX280[] PROGMEM = "BMP280/BME280 ({t}, {h}, {p})";
30+
const char INTL_BMX280[] PROGMEM = "BME280 ({t}, {h}, {p}), BMP280 ({t}, {p})";
3131
const char INTL_SHT3X[] PROGMEM = "SHT3X ({t}, {h})";
3232
const char INTL_DS18B20[] PROGMEM = "DS18B20 ({t})";
3333
const char INTL_DNMS[] PROGMEM = "DNMS ({l_a})";

0 commit comments

Comments
 (0)