I would like to use my ESP32 to read a sensor and put a limited amount of data into a BLE advertising packet for communications.
I wrote the below in an attempt to use the manufacturers data to store my dynamic data.
Using a BLE scanner on a phone, I can see the advertisement, but no mfg data shows up.
is there an example somewhere?
#import the ESP32 BLE driver: a BLE capable VM is also needed!
from espressif.esp32ble import esp32ble as bledrv
then import the BLE modue
from wireless import ble
Set GAP name
Start the BLE stack
# Update the manufacturer section of the advertising packet
# Stop advertising
# Update data must put in first parameter (interval)
ble.advertising(100, payload = Mfg_data)
Initial data load
r_val = random(0,100)
print("r_val: ", r_val)