BT Scanning is Broken

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

BT Scanning is Broken

Post by devnull » Wed Aug 05, 2020 10:02 am

I have just updated to latest commit of micropython, after 3 months away:

Code: Select all

200804-9883d8e.hex
I now seem unable to get bluetooth scanning to detect anything, this is code that previously worked, but now it appears that bluetooth scanning is not doing anything at all !

Code: Select all

import time, bluetooth
bt = bluetooth.BLE()
then = time.ticks_ms(); 

_IRQ_SCAN_RESULT   = const(1 << 4)

def irq(event,adv):
  if event == _IRQ_SCAN_RESULT:
    print('@mins:',round(time.ticks_diff(time.ticks_ms(),then)/1000/60,2),adv[1])

bt.irq(handler=irq)
bt.active(True)

## scan forever
bt.gap_scan(0,10000, 10000)
What has changed ???
Last edited by devnull on Wed Aug 05, 2020 10:10 am, edited 2 times in total.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: BT Scanning broken ???

Post by devnull » Wed Aug 05, 2020 10:05 am

Confirmed, I just reverted back to:

Code: Select all

200419-1b1ceb6.hex
And everything works perfectly !

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: BT Scanning is Broken

Post by jimmo » Thu Aug 06, 2020 5:14 am


Post Reply