Add BME280 Sensor
- Plumb BME280 all the way through to Prometheus. - Add README detailing the diff between BME280 and BMP280 - Refactor source files to be *_drv.c to avoid naming clashes with upstream libraries.
This commit is contained in:
@ -2,8 +2,9 @@
|
||||
#include "mgos_prometheus_metrics.h"
|
||||
#include "mgos_prometheus_sensors.h"
|
||||
|
||||
void dht_init();
|
||||
void veml6075_init();
|
||||
void dht_drv_init();
|
||||
void veml6075_drv_init();
|
||||
void bme280_drv_init();
|
||||
|
||||
static void pushgateway_timer(void *user_data) {
|
||||
mgos_prometheus_metrics_push(MGOS_APP, mgos_sys_config_get_device_id());
|
||||
@ -11,8 +12,9 @@ static void pushgateway_timer(void *user_data) {
|
||||
}
|
||||
|
||||
bool mgos_prometheus_sensors_init(void) {
|
||||
dht_init();
|
||||
veml6075_init();
|
||||
dht_drv_init();
|
||||
veml6075_drv_init();
|
||||
bme280_drv_init();
|
||||
if (mgos_sys_config_get_sensors_pushgateway_period()>0)
|
||||
mgos_set_timer(mgos_sys_config_get_sensors_pushgateway_period()*1000, true, pushgateway_timer, NULL);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user