Bluetooth deinit bug in RC7-RC10
I think I found a bug inside the firmware, 1.20.0.rc7 and further.
I'm using bluetooth to detect bluetooth beacons nearby.
Inside my code I'm disable and enable bluetooth sometimes, using init() and deinit().
But when I'm using a newer RC version and I've called deinit(), the bluetooth is not working anymore.
I've used the init() function after the deinit() and then it can't find anything anymore.
With the same code on RC4 it's working.
This is my test code:
def bt_test(self): self.bt.init() time.sleep(2) self.bt.start_scan(2) time.sleep(2) adv = self.bt.get_advertisements() print(adv) self.bt.deinit()
The first time it found some devices and the second time nothing.
This is still an issue in the latest frimware!
Light sleep mode ( machine.sleep() ) is affected too as bluetooth does not initialise after waking up.
Pycom MicroPython 1.20.1.r1 [v1.11-3138a13] on 2019-10-08; LoPy4 with ESP32
Pybytes Version: 1.1.3