Bluetooth LE Scanning and Govee Thermometers

I’ve been programming Bluetooth software to communicate with Govee thermometers for a couple of years now and still learning how Bluetooth works. I’ve been working with several devices, H5074, H5075, H5174, H5177, plus the meat thermometers H5182 and H5183. (I’ve got pictures of each at https://github.com/wcbonner/GoveeBTTempLogger/tree/master/DeviceImages)

I’ve liked the H5074 the most because of its compact size and the fact that it uses a CR2477 lithium battery for power and seems to run for close to two years without replacement. It also has been surprisingly robust when placed inside my freezer or outside on a balcony railing.

The thermometers broadcast their data over Bluetooth Low Energy (BLE) advertisements. Each of these thermometers stores the previous 20 days or more of data internally and can also be queried directly to retrieve the stored data. I only recently got the code for the direct connection download working. To connect directly the host must stop listening to advertisements, make the connection, download the data, close the connection, and then go back to scanning for advertisements.

There are two modes the host scanning can be set to, Active or Passive. Active mode is the mode I’ve been using for most of this time, and I only recently investigated the differences between Active and Passive.

Passive mode is exactly what it sounds like. The Bluetooth stack only listens for advertisements and makes them available to my program.

Active mode is more complicated. Every time the Bluetooth stack receives an advertisement, it sends a query message to the device that advertised asking for more details. This is all done by the stack with no visibility to my program. It may affect timing of messages arriving or even over the air collisions. I’ve not found detailed descriptions related to this.

The different Govee thermometers appear to operate differently. The H5075, H5174, and H5177 broadcast their temperature, humidity, and battery data while the H5074 only sends the data in a secondary response. This means that data can be gathered from the first three with a host running in passive mode, while a host running in active mode is required to get the data from the H5074. This is unfortunate in a noisy Bluetooth environment because it means that the host itself is adding to the Bluetooth noise.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s