Yes, bug in my code caused by bad data.
All seems good now, thanks again
BLE Scan forever stops after 7+ Hours
Re: BLE Scan forever stops after 7+ Hours
Oops, hold your horses, need to test it again !
Re: BLE Scan forever stops after 7+ Hours
Still not fixed, timestamp of 11464919 shows that it failed after about 3 hours and stopped discovering.
Re: BLE Scan forever stops after 7+ Hours
Uh oh.
I spoke to another person who was previously seeing this issue frequently and they claim that it's solid now.
If you have any additional information about how to repro this (or if you have a really minimal test case that I can try) then that would be useful.
I spoke to another person who was previously seeing this issue frequently and they claim that it's solid now.
If you have any additional information about how to repro this (or if you have a really minimal test case that I can try) then that would be useful.
Re: BLE Scan forever stops after 7+ Hours
Same Issue....
Just scanning every 1min for 10sec duration .2sec interval .18sec window
The main.py uses wifi with email, and a WDT 2.5min see email attachment of reboot logs.
I also have a very striped down version with just bt.gap_scan and faster timings.
Same results except able to run sometimes for 23hr straight. Code below.
IS There a known fix or work around?
Just scanning every 1min for 10sec duration .2sec interval .18sec window
The main.py uses wifi with email, and a WDT 2.5min see email attachment of reboot logs.
I also have a very striped down version with just bt.gap_scan and faster timings.
Same results except able to run sometimes for 23hr straight. Code below.
Code: Select all
import ubluetooth
import utime
from micropython import const
from machine import Timer
wdt = WDT(timeout=180000) # timeout 2.5min
_IRQ_SCAN_RESULT = const(1 << 4)
_IRQ_SCAN_COMPLETE = const(1 << 5)
def ble(tm):
def bt_irq(event, data):
if event == _IRQ_SCAN_RESULT:
print(data)
elif event == _IRQ_SCAN_COMPLETE:
uData(utime.time())
bt.gap_scan(5_000, 200_000, 180_000) # 5.0 / .20 / .18 seconds
print("scan start")
bt.irq(handler = bt_irq)
def uData(y):
print("scan complete")
print("free memory: " + gc.mem_free() +"\n")
print("complete run time:",y,"sec\n")
bt=ubluetooth.BLE()
bt.active(True)
ble('x')
tm = Timer(-1)
tm.init(period=15000, mode=Timer.PERIODIC, callback=ble)
- Attachments
-
- BLE-reboot-log.png (16.66 KiB) Viewed 4282 times
Re: BLE Scan forever stops after 7+ Hours
Tried this repo (a3f3c7bdc3e81d88eba076c31cd92bca9fadd02c) and have many Bizarre issues with ble scan,jimmo wrote: ↑Tue Mar 31, 2020 11:47 pmOh... they did backport it to v4.0 but they just re-used the same tag. Argh. This cursed chip.
Anyway. To test this out. In your esp-idf repo,
The last line should be a3f3c7bdc3e81d88eba076c31cd92bca9fadd02cCode: Select all
git fetch origin git checkout origin/release/v4.0 git reset --hard HEAD git submodule update --init --recursive git rev-parse HEAD
Update esp32/Makefile and set ESPIDF_SUPHASH_V4 to that, then "make clean" and "make". This compiles for me, but I haven't had a chance to test it yet.
if event == _IRQ_SCAN_RESULT: not functioning now.
I tried the new idf 4.0.1 but won't build.
Is there a timeline on when micropython will commit.
Re: BLE Scan forever stops after 7+ Hours
Latest build with...
ESP-IDF v4.0.1 4c81978a3e2220674a432a588292a4c860eef27b
micropython 1e6d18c915ccea0b6a19ffec9710d33dd7e5f866
and esp32/Make file updated to fa2c8f1ef8687aa4025f2fbbc7333ae925363585
Has appeared to correct BLE scan unexpectedly stopping issue.
Previous build would not run for more than ~ 3hr.
This latest build is running... and has past 24 hr so far.
also somewhere along the line
_IRQ_SCAN_RESULT = const(1 << 4) changed to cont(5) and
_IRQ_SCAN_COMPLETE = const(1 << 5) changed to cont(6)
corrected... if event == _IRQ_SCAN_RESULT: not passing
ESP-IDF v4.0.1 4c81978a3e2220674a432a588292a4c860eef27b
micropython 1e6d18c915ccea0b6a19ffec9710d33dd7e5f866
and esp32/Make file updated to fa2c8f1ef8687aa4025f2fbbc7333ae925363585
Has appeared to correct BLE scan unexpectedly stopping issue.
Previous build would not run for more than ~ 3hr.
This latest build is running... and has past 24 hr so far.
also somewhere along the line
_IRQ_SCAN_RESULT = const(1 << 4) changed to cont(5) and
_IRQ_SCAN_COMPLETE = const(1 << 5) changed to cont(6)
corrected... if event == _IRQ_SCAN_RESULT: not passing
Re: BLE Scan forever stops after 7+ Hours
That's good to hear!! Thanks for the update
https://github.com/micropython/micropython/pull/6033 made some breaking API changes (this is still an in-development API).
The docs are updated, but I also summarised the main differences here https://github.com/micropython/micropyt ... -641057340