BC04P beacon and KSensor protocol without ESP32

I bought a Blue Charm Beacon BC04P. It showed up via iBeacon Tracker integration right away, but it is acting very erratic. While lying on the table in the same spot, distance fluctuates from 20 ft to 150 ft (true distance is about 15 ft), goes unavailable, then reappears. Walking around with it seems have no impact on the distance readings or availability.

I am able to connect to the beacon using KBeaconPro app. I made sure it’s always on (and not motion-activated) and I set the power to maximum.

Forums seem to suggest that the problem is in iBeacon Tracker integration and the solution is using the KBeacon protocol via ESPresense/ESP32s instead. Is there any way to make this beacon work with the bluetooth dongle I have in the HA PC?

Hi Au,

I am not sure what is happening on the HA side, but here’s a few tips:

To check the signal strength of the beacon, use the scan page on KBeaconPro. It’s the first page that shows when you open the app. If there are too many things showing up there, and it gets difficult to see your target beacon, use the filter method at the top of the page so that only your target beacon shows on the scan screen.

Now put the beacon down somewhere and walk with your phone away from the beacon. The RSSI strength number should get weaker, i.e. lower and lower. For example, if it was -35 at the start, it will change to -43 then -56 then -68, etc. as you walk away from the beacon.

Be sure to restart the scan on the KBeaconPro app every so often since it will automatically time out. Just tap the “Scan” button in the upper right corner when it appears again (i.e. the scan has timed out). During the scan, the Scan button will change to Stop.

Be sure not to stay connected to the beacon with the KBeaconPro app. Staying connected stops the beacon from working. Connecting is only for configuring, then when done, you need to disconnect.

Assuming the RSSI numbers shown on the KBeaconPro app screen are behaving as expected, then the beacon is fine.

Re power setting for the beacon: You should not set it higher than needed. Default is 0, and it sounds like you have turned it up to +8. If you need it that powerful for your usage case, then fine. If not, I would recommend you turn it down to save battery power. Also, lower TX power levels are more stable. That said, this is not the reason why you are seeing unstable distance readings on your HA.

Some random speculation on the HA side:

First, a guess: You may have misidentified your target iBeacon when you first started. You might be tracking some other BLE item instead of your beacon.

Distance: The distance figures jumping around oddly could be caused by something wrong with your bluetooth dongle. These distance figures are calculated by your HA using a mathematical formula with the RSSI numbers as the key input. So if you already checked the RSSI numbers from the beacon (described above), and they are fine, then the only reason for the distance numbers to be weird is something being wrong with the dongle or maybe some strange thing happening with the HA. Some HA experts here can help on this.

Re: “the solution is using the KBeacon protocol via ESPresense/ESP32s instead”: Maybe this is just a wording mistake by someone, but this makes no sense and in fact is not possible. There is no such thing as “KBeacon protocol”. All our beacons use standard iBeacon protocol. They work fine with any scanner that scans for iBeacons.

Someone may have been having trouble with the iBeacon protocol because their scanner setup was wrong, then they switched on our KSensor protocol (broadcasts xyz accelerometer data) to try to fix the problem. Then after making twelve more adjustments to their scanner/HA :wink:, everything started to work, so they concluded that using KSensor was the magical trick. But I can assure you that it is not. Using our standard iBeacon protocol will work fine as long as the scanner is setup correctly.

By the way, I wrote a comment one time about how to set up and use the iBeacon Tracker integration. Hopefully it is still roughly the same process now: Anyone else experience issues with iBeacons? - #5 by BlueCharmBeacons

Thank you for such a detailed and helpful answer!

Indeed one of the problems was me trying to monitor the beacon simultaneously with the app and HA. Disconnecting from the app solved the issue of HA not updating at all. I reset the power to the default 0. I did not make mistake identifying the beacon. It has a very distinct name.

Although as you pointed out the “KBeacon protocol” is not a real thing, there seems to be some truth in recommendation to use ESPresense instead of HA’s iBeacon integration. I got an ESP32 device, flashed it with ESPresense and positioned it a foot away from the HA’s host computer’s bluetooth dongle which is used for iBeacon. That set up allowed me to track the same KBeacon simultaneously with both.

The difference is stark. iBeacon integration updates once a minute or so, shows ridiculously inaccurate distances, jumps back and forth while being stationary. ESPresense updates every second, is accurate with error of a foot or two, and doesn’t do unexplained jumps. However, it only tracks the beacon up to ~20 ft and then loses it. I played with all the settings in HA and ESPresense, no luck of extending that.

I got this beacon after reading “300 meters” in the description and planned to keep it in my car so that HA can detect it from blocks away as I’m returning home. It doesn’t look like it is remotely feasible to accomplish this in HA. The beacon seems to be a quality product and probably it can be used in such a way with some platform, but I can’t see how HA/ESPresense could pull this…

For the record, you need a Phy scanner to achieve 300 meter distance. There are no ESPs or dongles on the market that are Phy scanning capable. Only very specialized BLE scanner gateways are Phy capable at this time.

From our product description:
" This beacon can achieve ranges of up to 300 meters using its PHY-coded broadcast and a PHY scanner, 150 meters using the legacy iBeacon broadcast and a typical BLE scanner such as a smartphone."

Re the scanning reliability issue:
I have successfully used the iBeacon Tracker integration with my HA as the scanner (see my link in my earlier comment). My HA is an rPi with built-in BLE, so nothing special. It doesn’t even have an external antenna. I get pretty stable distance readings from it, but the triggers for automations are a bit slow for my taste. Still, it works fairly well. So I still would be suspicious that the problem lies with your BLE dongle.

Using my HA as the scanner and the iBeacon Tracker integration, I get “coming into range” notifications/triggers within a couple of seconds every time. So definitely the integration is not scanning only once per minute like you experienced. That makes me think again that your dongle is the root of the problem. The dongle should also have a scanning interval and scanning window setting. So you might look into how to adjust those numbers for your dongle. then it will scan more frequently and hand off results to the HA equally frequently. Set it to something like scan interval 1000ms and scan window 800ms.

On the other hand, if you got the ESP working now, then maybe stick with it! :grinning_face_with_smiling_eyes:

Re the short 20 ft scanning range of the ESP:

Isn’t there a “maximum distance” thing that you need to adjust in the ESPresence settings? Something like “ignore all beacons beyond X feet”. Maybe that needs to be turned off or adjusted so you can get longer distance readings.

I get the feeling that the ESPresence was designed as a room by room scanner, so I don’t think they worried too much about super long distance scanning. Most of the people that contact me about it are concerned with the scan zones being too large not too small.

Another idea to consider is getting ESP hardware with the ability to add an external antenna. I think they usually have a “U” at the end of the product number, indicating they require an external antenna. I once played around with some ESP32WROOMU modules and attached an antenna and got improved distance results.

Something like this: https://www.amazon.com/gp/product/B09D3TGJGD/

But be careful since this is a C3 variant which is different from the typical ESP32D variant. I am not sure if ESPresence can be flashed and run on this one. check with the ESPresence gurus on this before spending money.

For antennas, I first used these below, then later switched to slightly longer ones I bought somewhere else:

https://www.amazon.com/gp/product/B07D1Z3W7T/

When I set up ESP32s I set the maximum distance to 100 meters for all of them. Yet the furthest they register of any beacon (and they pick up like 30 in my house - I have no idea what half of them even are) - is 10.5 meters. I tried iPhone, Blue Charm Beacon, Govee hydrometer - they are gone when beyond 10 meters or so…

On the ESPresence config page, it has these settings:

So you can try to change:
Maximum distance to report: 500
Skip reporting if message age is less than this (in milliseconds): 10
Report early if beacon has moved more than this distance: 0

I set ESPresense to 500 but still can’t get anything register beyond 10 meters.

I replaced the HA BT dongle with a “long range” one which has external antenna and promises 100 meters. It now detects the BC04P from further (maybe 30 meters) but readings are absolutely wacky. It only updates once a minute at most and registers wild jumps. In the meantime, ESPresense gets ok readings every second from the same beacon.

Here are the readings by ESPresense sensor (purple) and iBeacon of the same BC04P (I only have one). It’s sitting ~4 ft away and not moving entire time. ESPresense and iBeacon BT are a foot apart.

Absolutely insane!

I don’t know what else to try. The choice seems to be either ok readings from ESPresense with 10m distance limit, or super slow and wildly inaccurate iBeacon readings which reach 30m. And I hoped to get readings from 100m away every second…

Re ESP: Maybe ask some of the ESPresence experts in the forum for their ideas on how to adjust it.

Re the dongle: The BT dongle looks slightly hopeless from that chart. The distance reading jumping from 2m to 8m then back to 2m is basically worthless.

Checking the beacon: Just to double check that you did not accidentally change any of the beacon settings, you can use the KBeaconPro app to connect to it then click “reset configuration” to set it back to its default settings.