I'm trying to connect my ESP32 (Lolin Lite) to a bluetooth heart monitor, a Polar H7 and I'm having trouble getting the example code to scan for anything.
I'm using the ble_temperature_central.py from the version of the code tagged "1.12" on Github as suggested on another thread, I've not changed anything yet apart from adding "window" & "interval" as parameters to the "scan" method. I have "MicroPython v1.12-652-gcaaaa2b1f on 2020-07-22; ESP32 module with ESP32" loaded on the ESP32.
I am getting scan results, it's just that the event that being passed to "_irq" doesn't match any of the constants defined. Here's a few lines of debug I've added to _irq, the number on it's own is "event" and the array under that is "data". The "master" version of the examples has 5 defined as SCAN_RESULT which would make sense. I've also tried the master version of the example central & while it did detect the incoming events properly, it could never decode any of the data (the line "if payload[i + 1] == adv_type:" never matched.
Here's an example of the debug I get dumping "event" and "data" from "_irq"
Code: Select all
5
(0, b'\xbe\x89@\x00\x85\xc1', 0, -84, b'\x02\x01\x06\x03\x02\x12\x18\x0e\tELK-BLEDOM ')
5
(1, b'm=&e\x98\xa8', 0, -39, b'\x02\x01\x06\n\xffL\x00\x10\x05A\x1cy\xa6\xe7')
5
(1, b'd\xa7U\xa3}\xbb', 0, -39, b'\x02\x01\x06\n\xffL\x00\x10\x05A\x1cy\xa6\xe7')
5
(0, b'\xbe\x89@\x00\x85\xc1', 0, -83, b'\x02\x01\x06\x03\x02\x12\x18\x0e\tELK-BLEDOM ')
5
(1, b'm=&e\x98\xa8', 0, -39, b'\x02\x01\x06\n\xffL\x00\x10\x05A\x1cy\xa6\xe7')
5
(1, b'd\xa7U\xa3}\xbb', 0, -39, b'\x02\x01\x06\n\xffL\x00\x10\x05A\x1cy\xa6\xe7')
5
(1, b'e\x8b\xac\x0c)M', 0, -79, b'\x02\x01\x1a\x02\n\x0c\n\xffL\x00\x10\x05\x06\x18$\xee\x94')
5
(0, b'\xbe\x89@\x00\x85\xc1', 0, -86, b'\x02\x01\x06\x03\x02\x12\x18\x0e\tELK-BLEDOM ')
5
(0, b'\xbe\x89@\x00\x85\xc1', 0, -82, b'\x02\x01\x06\x03\x02\x12\x18\x0e\tELK-BLEDOM ')