ESP32 based BLE tracking for mqtt_room

A little bit of bad news: I managed to kill two of my three ESP32 modules yesterday evening, along with a breadboard power supply. I’ve order more units, but they tend to take about 2 months to arrive. I’ve still got one remaining dev board that I can use for testing and development, but progress will be a little bit slower than I’d anticipated.

There’s a known issue of watchdog timer causing the board to stop responding after a few minutes. I’m working on it, and I’ll be updating the repository when I’ve found a fix. I may end up moving the entire project into a different platform such as mongoose to try and address the issue.

Cheers,
James

Curious how you killed your boards?
I don’t want to repeat what you did.

I was using the carrier board with the bare ESP32 module, and had a dead short across the power supply rails on one of them, due to terrible soldering by the user (me).

When I plugged in the second board, it fried the linear power regulator on my power supply, which proceeded to dump 12v straight into the other board that was still connected.

Moral of the story: unplug things that are working before plugging in things that are not.

1 Like

Oh, well that sucks.
I usually check my soldering with a meter for shorts and opens, especially on power wires, before I plug them in. And yeah, if you just worked on it, plug in the board alone.

Randy

Thanks for sharing. Can you provide all library names?

After writing esp8266, how do you complete the configuration in homeassistant?

Can IOS devices be detected?

Thank you. Cheers. This is a good solution for indoor positioning.

Release v0.0.1 is now available on the github repo. A couple of improvements in this release:

  1. PlatformIO support! You can now use PlatformIO to build and upload the code. In fact, you’ll need to use it, as I’ve stopped development and support for the Arduino IDE. Big thanks to Kyle Gordon for adding a pull request with all the required frameworks in place to get it functional. It was a great bonus, as it helped with the second big change, which is…

  2. Async MQTT! Sounds unimpressive, but I was getting issues with watchdog timers firing exceptions, which was making the whole system entirely unreliable and useless. Since we’re using PlatformIO, you don’t have to worry about installing the required libraries, just build and upload. You may want to change the specified upload_port in platformio.ini, as it was attempting to use my USB hub as the default and I had to manually set the correct port.

Please migrate to the new code and let me know if you come across any issues. I’m keen to hear back from folks about any bugs lurking.

Hi ptrsnja,

Being now happy bubbles no more supported/sold I was wondering why someone (with propor skills :slight_smile: ) does not adapt their firmware to esp32 (happy bubbles is based on esp8266)

From a logical point of view it should be much straightforward isn’t it?

I know this is in development but, will this work with iPhones? I can see that the mac address and uuid are changing randomly.

You’ll need to use an app to broadcast a beacon from your iPhone. If you can do that, you can enter the beacon UUID (without any dashes) into your mqtt_room sensor, and it should work properly. That’s how I’m tracking my android devices.

Which android app do you use?

Thanks
Randy

I use Beacon Simulator on my OnePlus 5 (although I can’t get it to persist reliably), and on my old Nexus 5 I’m using an app called Beacon Toy. I can’t seem to find it in the play store any more, however.

I’ve also tried Beacon Locate but couldn’t manage to get it to broadcast in the background.

1 Like

Seems like you can download the apk for beacon toy
https://apkpure.com/beacon-toy/com.uriio/versions

Esp32 installed, do not know how to configure the IOS phone.

@eric3616191 This is a solution to track iBeacons locally, not iPhones. Unfortunately, Apple does not allow iOS devices to broadcast beacons in the background. You’ll need to use another solution to track your iPhone, maybe owntracks.

I’m looking at configuring the ESP32 to broadcast a beacon packet as well as detect other beacons. This may enable you to use the ESP32 transceivers to inform owntracks of your room (this is not yet implemented).

How to configure Android mobile phone?

What Android app is installed?

Thank you!

hi ptrsnja,

is it compatible with happy bubble presence server?
shouldn’t be too difficult reading here:
https://www.happybubbles.tech/presence/detector

just needed to publish rigth values on MQTT

@mspinolo It would certainly be possible to use this with the Happy Bubbles server, but I can’t seem to find the spec for what messages the server expects to receive from the sensor nodes. It’s possible that @happybubbles might be able to provide more information, but I’m not clear that using the server would improve things in any way as compared to using the standard mqtt_room component as it’s currently designed.

As an update, I’m still working on addressing the watchdog timeout problem. It appears to be a widespread issue that affects ESP32 projects using the Arduino framework. I’ve tried a few things, and I’ve managed to improve stability, but it still crashes after a random (and now very long) period of time.

I’m also waiting on additional boards for development, but Canada Post has gone on strike, so progress is going to be delayed.

Maybe we should share the results of our tests depending on the board on a spreadsheet or an equivalent

@ptrsnja : you can find information at the link above, i will report here for completeness (hoping this is what you are looking for as I am really far from being an expert)

In terms of advantage it will be for people (like me obviously :slight_smile: ) who already have some happy bubbles around the house and would like just to add more sensors on the same system

Happy Bubbles will publish all advertisments it sees to the MQTT topic:

happy-bubbles/ble/<the-hostname>/raw/<the-bluetooth-MAC-address>

with a payload like:

{ "hostname": "living-room", "mac": "dd6ed85b7a80", "rssi": -94, "is_scan_response": "0", "type": "3", "data": "0201061aff4c000215e2c56db5dffb48d2b060d0f5a71096e000680068c5" }

@mspinolo The information you referenced is what the Happy Bubbles server sends to Home Assistant. What I need to know is what the sensor nodes send to the Happy Bubbles server (that is, one step earlier in the chain). I couldn’t uncover that information on the site, and I’ve not tried to parse the source code for that project, as it’s written in a language I don’t know.

If you’re able, you could use a simple mqtt client to subscribe to the happy bubbles topic and paste the results here. It won’t provide the full picture, but it would be a good start