First time really doing anything with BLE. I'm using a Connectivity 2040 board and had some questions about general approach...
What I'm trying to accomplish is to connect and bond with a mobile device (via mobile app), and for WiFi credentials to be shared over that secure BLE connection (so it can swap from BLE to WiFi for downloading firmware updates, for example). For bonus points, I also want to share some characteristics over that connection like SIM status, firmware version, etc. I want to restrict access to reading/writing WiFi credentials to bonded devices.
I'm currently testing against this with the nRF Connect Android app (it's great for debugging what is being advertised, testing connection and bonding, reading/writing characteristics, etc.).
I've got to a point where I have the ESP initialise BLE, it starts GATT services, then starts advertising itself. I also have bonding supported where it responds to a bonding (pairing?) request from the mobile app and correctly bonds.
Next up- the GATT services and characteristics. It seems like these aren't configurable at run-time, and need to be set in mfg_nvs.bin on the ESP. With the default GATT config, I don't think I have a way of restricting read/write to bonded devices- everything seems to be set as "read" or "write without response"- I can't restrict characteristics with encryption/authorisation.
So- my question is, is what the recommended approach from here?
Looking at Espressif documentation, I see I can do a custom build of the Espressif firmware with updated GATT config, or I think I can just update the mfg_nvs.bin file. That link talks about updating the mfg_nvs partition, but when I run AT+SYSFLASH? I don't see that partition, only:
Code: Select all
+SYSFLASH:"ble_data",64,1,0x1f000,0x6000
+SYSFLASH:"server_cert",64,2,0x25000,0x2000
+SYSFLASH:"server_key",64,3,0x27000,0x2000
+SYSFLASH:"server_ca",64,4,0x29000,0x2000
+SYSFLASH:"client_cert",64,5,0x2b000,0x2000
+SYSFLASH:"client_key",64,6,0x2d000,0x2000
+SYSFLASH:"client_ca",64,7,0x2f000,0x2000
+SYSFLASH:"factory_param",64,8,0x31000,0x1000
+SYSFLASH:"wpa2_cert",64,9,0x32000,0x2000
+SYSFLASH:"wpa2_key",64,10,0x34000,0x2000
+SYSFLASH:"wpa2_ca",64,11,0x36000,0x2000
+SYSFLASH:"mqtt_cert",64,12,0x38000,0x2000
+SYSFLASH:"mqtt_key",64,13,0x3a000,0x2000
+SYSFLASH:"mqtt_ca",64,14,0x3c000,0x2000
+SYSFLASH:"fatfs",1,129,0x47000,0x19000
Thanks for the help!