BME680: removed altitude (makes no sence without calibration on node)

This commit is contained in:
Klaus K Wilting 2018-11-18 16:04:40 +01:00
parent 06dcad6484
commit 8ba97afa83
8 changed files with 3 additions and 11 deletions

View File

@ -205,7 +205,6 @@ Hereafter described is the default *plain* format, which uses MSB bit numbering.
bytes 3-4: Pressure [hPa] bytes 3-4: Pressure [hPa]
bytes 5-6: Humidity [%] bytes 5-6: Humidity [%]
bytes 7-8: Gas resistance [kOhm] bytes 7-8: Gas resistance [kOhm]
bytes 9-10: Altitude [meter]
# Remote control # Remote control

View File

@ -51,7 +51,6 @@ typedef struct {
uint16_t pressure; // Barometic pressure in hecto pascals uint16_t pressure; // Barometic pressure in hecto pascals
float humidity; // Relative humidity in percent float humidity; // Relative humidity in percent
uint16_t gas_resistance; // Resistance in MOhms uint16_t gas_resistance; // Resistance in MOhms
uint16_t altitude; // Altitude in meters
} bmeStatus_t; } bmeStatus_t;
// global variables // global variables

View File

@ -29,7 +29,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng
[common] [common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c" ; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
release_version = 1.6.8 release_version = 1.6.81
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 0 debug_level = 0

View File

@ -43,7 +43,7 @@ function Decoder(bytes, port) {
if (port === 7) { if (port === 7) {
// BME680 sensor data // BME680 sensor data
return decode(bytes, [temperature, uint16, humidity, uint16, temperature], ['temperature', 'pressure', 'humidity', 'air', 'altitude']); return decode(bytes, [temperature, uint16, humidity, uint16], ['temperature', 'pressure', 'humidity', 'air']);
} }
} }

View File

@ -47,7 +47,6 @@ function Decoder(bytes, port) {
decoded.pressure = ((bytes[i++] << 8) | bytes[i++]); decoded.pressure = ((bytes[i++] << 8) | bytes[i++]);
decoded.humidity = ((bytes[i++] << 8) | bytes[i++]); decoded.humidity = ((bytes[i++] << 8) | bytes[i++]);
decoded.air = ((bytes[i++] << 8) | bytes[i++]); decoded.air = ((bytes[i++] << 8) | bytes[i++]);
decoded.altitude = ((bytes[i++] << 8) | bytes[i++]);
} }
return decoded; return decoded;

View File

@ -34,7 +34,6 @@ bool bme_read(void) {
bme_status.pressure = (uint16_t)(bme.pressure / 100.0); // convert Pa -> hPa bme_status.pressure = (uint16_t)(bme.pressure / 100.0); // convert Pa -> hPa
bme_status.humidity = bme.humidity; bme_status.humidity = bme.humidity;
bme_status.gas_resistance = (uint16_t)(bme.gas_resistance / 1000.0); // convert Ohm -> kOhm bme_status.gas_resistance = (uint16_t)(bme.gas_resistance / 1000.0); // convert Ohm -> kOhm
bme_status.altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
ESP_LOGI(TAG, "BME680 sensor data read success"); ESP_LOGI(TAG, "BME680 sensor data read success");
} else { } else {
ESP_LOGI(TAG, "BME680 sensor read error"); ESP_LOGI(TAG, "BME680 sensor read error");

View File

@ -97,7 +97,6 @@ void PayloadConvert::addBME(bmeStatus_t value) {
#ifdef HAS_BME #ifdef HAS_BME
int16_t temperature = (int16_t)(value.temperature); // float -> int int16_t temperature = (int16_t)(value.temperature); // float -> int
uint16_t humidity = (uint16_t)(value.humidity); // float -> int uint16_t humidity = (uint16_t)(value.humidity); // float -> int
int16_t altitude = (int16_t)(value.altitude); // float -> int
buffer[cursor++] = highByte(temperature); buffer[cursor++] = highByte(temperature);
buffer[cursor++] = lowByte(temperature); buffer[cursor++] = lowByte(temperature);
buffer[cursor++] = highByte(value.pressure); buffer[cursor++] = highByte(value.pressure);
@ -106,8 +105,6 @@ void PayloadConvert::addBME(bmeStatus_t value) {
buffer[cursor++] = lowByte(humidity); buffer[cursor++] = lowByte(humidity);
buffer[cursor++] = highByte(value.gas_resistance); buffer[cursor++] = highByte(value.gas_resistance);
buffer[cursor++] = lowByte(value.gas_resistance); buffer[cursor++] = lowByte(value.gas_resistance);
buffer[cursor++] = highByte(altitude);
buffer[cursor++] = lowByte(altitude);
#endif #endif
} }
@ -174,7 +171,6 @@ void PayloadConvert::addBME(bmeStatus_t value) {
writeUint16(value.pressure); writeUint16(value.pressure);
writeHumidity(value.humidity); writeHumidity(value.humidity);
writeUint16(value.gas_resistance); writeUint16(value.gas_resistance);
writeTemperature(value.altitude);
#endif #endif
} }

View File

@ -234,7 +234,7 @@ void get_gps(uint8_t val[]) {
gps_read(); gps_read();
payload.reset(); payload.reset();
payload.addGPS(gps_status); payload.addGPS(gps_status);
SendPayload(GPSPORT) SendPayload(GPSPORT);
#else #else
ESP_LOGW(TAG, "GPS function not supported"); ESP_LOGW(TAG, "GPS function not supported");
#endif #endif