Edi Supriyadi
This project is for ESP32 and Thermometer LYWSD03MMC
on custom firmware by Aaron Christopel
MENU:
- WiFi credential (saved in EEPROM)
- Change scan interval (default 10 s, >=10 s)
- Change server name (saved in EEPROM)
- Report scanned devices to server
- Report heap size as BLE notification
- Change PIN
- Core 0 running for:
- WiFi -> sending data to server
- Core 1 running for:
- BLE -> capturing service data from target devices and setting parameters
SETUP
- Connecting to network (reading EEPROM first for WiFi credential, if available, then using hardcoded one)
- Asking server for mac adresses of BLE devices to capture (TARGET DEVICE)
LOOP
- Scanning BLE devices for service data. First priority: TARGET DEVICE, otherwise just capturing devices with service data in advertising packet.
- Send service data to server
- Wifi credential (SSID and password, max 20 characters): changed via SETTING
- Server address (max 50 characters): changed via SETTING
- BLE scan failure limit : default to 3 times (hardcoded) -> restarting after the limit exceeded
- BLE scan interval: default to 60 s, changed via SETTING
- Target mac adresses (max 10 devices): supplied via server
- PIN to enter SETTING
This project is written in VS Code with platformIO.
Arduino IDE
- Delete line #include <Arduino.h>
- Don't forget to setup partition. Otherwise you'll get oversize warning
- Depending the ESP32 BLE library you are using, if you get warning about advertisedDevice.getServiceData(), just change to advertisedDevice.getServiceData(0)