|
@ -86,6 +86,8 @@ String sensorTopic; |
|
|
const IPAddress udpMulticastAddress(239,255,255,245); |
|
|
const IPAddress udpMulticastAddress(239,255,255,245); |
|
|
const uint16_t udpMulticastPort = 5555; |
|
|
const uint16_t udpMulticastPort = 5555; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup() { |
|
|
void setup() { |
|
|
// gpio configuration
|
|
|
// gpio configuration
|
|
|
// rtc_gpio_deinit((gpio_num_t)buttonPin);
|
|
|
// rtc_gpio_deinit((gpio_num_t)buttonPin);
|
|
@ -282,14 +284,12 @@ void transmitStatus() { |
|
|
float internal_temp = temperatureRead(); |
|
|
float internal_temp = temperatureRead(); |
|
|
int internal_hall = hallRead(); |
|
|
int internal_hall = hallRead(); |
|
|
|
|
|
|
|
|
if (!bme280.valid) return; // TODO
|
|
|
if (!bme280.valid) { |
|
|
|
|
|
bme280.reinit(); // TODO
|
|
|
for (int retry=0; retry<3 && !bme280.valid; retry++) { |
|
|
if (!bme280.valid) return; |
|
|
bme280.reinit(); |
|
|
|
|
|
delay(250); |
|
|
|
|
|
humi = bme280.readHumidity(); |
|
|
|
|
|
bme280.readPressure(); |
|
|
|
|
|
temp = bme280.readTemperature(); |
|
|
temp = bme280.readTemperature(); |
|
|
|
|
|
humi = bme280.readHumidity(); |
|
|
|
|
|
pres = bme280.readPressure(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
StaticJsonBuffer<200> jsonBuffer; |
|
|
StaticJsonBuffer<200> jsonBuffer; |
|
|