UIFlow Guide
Connect to Blynk App via BLE to achieve wireless control from mobile phone. Note: Only models with PSRAM (e.g. M5Fire, M5Core2) are supported. This function only supports Blynk legacy, the new version of Blynk no longer provides BLE support.
1.Create a new project in Blynk legacy, select ESP32 Dev Board, select the access method as BLE, and record AUTH TOKEN. follow the steps below to add the components, of which BLE connection is a necessary component.
2.Use Blynk to control the color and brightness of M5StackFire's RGB light bar and display it on the screen in real time.
from ble import blynk
blynk.init('Device Name', 'Token', blynk.BLE)
def blynk_write_all(*args):
global msg, num
num, msg = args[0], args[1]
pass
blynk.handle_event('write v*', blynk_write_all)
def blynk_read_all(*args):
global num
num = args[0]
pass
blynk.handle_event('read v*', blynk_read_all)
blynk.notify('')
def blynk_connected():
# global params
print('connected')
pass
blynk.handle_event('connected', blynk_connected)
blynk.tweet('')
blynk.virtual_write(1, '')