For a few years now we are able to read BLE sensors with an ESP32. These sensors are advertizing their data with a one to many communication principle.
This type of BLE communication has the big advantage of being low power for the sensor, these BLE devices can last several months/years on a battery.
This is especially interesting with home automation or use cases that don't require a long-range communication. My test regarding BLE range gives outside around 60m/200ft with an LYWSD03MMC (a popular temperature and humidity sensor). That's enough to cover a house with one or a few gateways.
Where it could be difficult is when you want to have BLE sensors outside, so as to monitor your vegetable garden moisture, have some temperature sensors into your greenhouse or check that your garage/storage room door is closed. It may be difficult for the sensor to reach the BLE gateway inside and you may not have power outside. Also you may not want to invest into a communication technology with a bigger range like LORA.
In this case it could be relevant to have a gateway on a battery so as to behave as a range extender of your home automation network. The data would go this way:
BLE sensor -> BLEtoMQTT gateway Wifi on battery -> Wifi router
This way the gateway can be located at the limits of your wifi network so as to retrieve the BLE datas coming from the sensors that are out of reach of your inside BLE gateway.
But you may think that a gateway running on battery would be too much maintenance due to the necessary frequent battery recharge?
The answer is no, with the low power mode of OpenMQTTGateway, with a LOLIN ESP32 Lite configured to retrieve BLE data every 9 minutes you can easily reach one month of battery life with a 3.7V 3000mAh Lipo Battery.
How ? The gateway goes to deep sleep between the scans and reduces its current consumption to less than 100uA!
The adequate platformio configuration can be found below:
You can notice several characteristics:
- We don't use wifi manager, we use the wifi manual setup so as to save time during start
- We don't connect to BLE sensors
- We scan every 9 minutes
- The scans are passive scans
Commentaires
Enregistrer un commentaire