Bluetooth over Core2
-
Hello friends of the M5Stack.
Who has Bluetooth over UIFlow running in the Core2.
I need it to scan Bluetooth sensors.
Does anyone have a sample code for me? -
Doesn't anyone have a simple BLE example where I can just scan the ad data from Bluetooth?
-
Official MicroPython examples may help you.
https://github.com/micropython/micropython/blob/master/examples/bluetooth/ble_temperature_central.py
Need to change a littlefrom ble_advertising import decode_services, decode_name
->from ble.ble_advertising import decode_services, decode_name
and if you run from UIFlow,
__name__
is not"__main__"
but"flow.m5cloud"
removeif __name__ == "__main__":
and just calldemo()
if event == _IRQ_SCAN_RESULT:
is where receive advertisement dataAnother thing to note is the current UIFlow (v1.7.1) MicroPython cannot perform active scan. On some devices, the advertisement data does not contain the required data (name, etc.) but is included in the scan data which require active scan.
-
Thank You