LoPy stops detecting BLE advertisements
-
@alanm101 AFAIK there’s no frequency selection in BLE, it uses frequency hopping on predefined frequencies.
-
@jcaron ah sorry you meant the frequency of the advertisements. It’s usually not possible to find on the receiver side (as it does not necessarily listen all the time), but there are often ways to change it on the beacon (it’s a matter of compromise between time to discovery and power consumption)
-
@jcaron Yes, I meant broadcast rate/frequency. Apologies. Sadly I can't configure these.
-
@alanm101 this: https://community.estimote.com/hc/en-us/articles/204100806-What-are-the-default-settings-of-Estimote-Beacons-How-to-edit-settings- says you should be able to adjust them.
Alternatively you may want to try to see if varying the number of beacons has an influence on the time to failure. Just in case it’s a simple matter of the code failing after receiving a given number of advertisements (which would also explain the issue you had at the exhibition).
-
@jcaron Sadly, you have to "own" the Estimotes to make changes. The ones I have were allocated to someone else who now has no access to the registered email.
I'm running a test with the native IDF on a DOIT ESP32 board. Hacked the gatt_client.c code. No problems so far (58 minutes).
-
@alanm101 haven’t checked the whole thread to see if you already explored this option, but it might be interesting to log free memory and/or call the garbage collector periodically...
-
@jcaron In a past experiment, I called the gc every few cycles. No difference. Free mem. Hmm. That's a good call. Btw, it's now 3 hours with native IDF on a DOIT ESP32 board. No problems.
@all (Edited for clarity) Question: is it safe to flash the native IDF onto a Lopy? That would potentially eliminate hardware and IDF. I suspect flashing the standard IDF won't brick the Lopy, but opinions welcome before I try that.
-
20000 then I made a keyboard interrupt, on the latest software.
I have Ruuvi tags running in the other end of my house and recieve from them.
20000 ~ 5.55... hours.20000 10edb0e93366 74
-
@frida That's good news. So what must we conclude? Does the Pycom version of the BLE code break when the beacons are from Estimote? Sadly I don't have other physical beacons, but I can make a couple of devices emulate beacons. I'll try that.
-
@alanm101 said in LoPy stops detecting BLE advertisements:
So what must we conclude? Does the Pycom version of the BLE code break when the beacons are from Estimote?
Same thing for Estimote and EMbeacons on WiPy. See here.
-
@duffo64 Thanks, that's good info. Maybe one needs to buy a few ESP32s and use them to broadcast BLE ads. I wonder whether that would be better. Anyone tried that yet?
-
@jcaron I ran a test with gc every few cycles. Free RAM was around 50000. After 33 minutes scanning died. <Sigh>
-
@alanm101 Tried a ton of times, but at this point I am pretty sure that this behaviour is not due to a free memory issue.
Just having high hopes about IDF 3.0 that is due in a few days. Oh, well.... -
My next demo is on the 16th <shudder...>. Any ideas? Use Lopy for WiFi scanning and Lora broadcast, with a separate ESP32 for BLE scanning? Or abandon the Lopy and use an ESP32 with a Lora chip? Both options will stress my ability, so advice gratefully accepted,
-
@duffo64 I empathise duff. But I don't think it's an IDF issue. Seems fine with native IDF 2.1 and raw C code.
-
On reflection, I proposed a stupid solution. In a complex environment, you cannot dictate specific technologies. Estimotes abound, whether we like it or not.
-
@alanm101 you may be right. Increase the complexity in your test environment.
It seems that you are using unblocked communication. So yor timings are not the same when your device is connected to your PC or runs stand alone. Femove the print statements or write to an SD card to make the timings compareable.
You may receive corrupt data in your demo. Fix A beacon on yourself and your pet. Walk in and out of the BT range during the test. Send data over BT with your mobile.
And more important. Test your system wit the same settings as the demo. If you cannot increase the amount of beacons in your test, reduce the amount in the demo.
-
@crumble Good thoughts. However, since some of the original posts, there are new indicators. In a controlled environment (home) where I have 4 beacons, the simple test fails when using Lopy and the Pycom firmware downloaded early this week. See the test code posted a few hours ago.
Using DIOT ESP32 dev board with official espressif firmware and a simplified version of the gatt_client example, no problems in the same environment.
Btw, the demo environment is usually at an exhibition centre where there are myriad devices and beacons.
-
@alanm101
What is this gatt_client.c code? do you mean the gatt_client project at https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/gatt_client ?Did you change any esp_ble_scan_params_t there?
I’m glad you got good results with IDF directly, but I still feel it’s not optimal. My plan is to use the HCI layer directly to scan beacons and skip 90% of the stack.
-
@jmarcelino Yes, that's the code.
Changes:
Line 313: Changed time from 30s to 20000s.
Lines 331 - 347 removed.I'm getting interesting results with further tests. Will post later.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login