First, set the “Partition Scheme” like my screenshot :
Next, you can remove Bridge related code if you don’t need it. You also can try to delete any libraries (like esp_log for example) and try if it’s still work. To be honest, I copied a code without checking if every library is needed.
To implement multiple sensors, you can declare multiple address’ :
static BLEAddress MJAddress(MJ_ADDR);
static BLEAddress MJAddress1(MJ_ADDR);
static BLEAddress MJAddress2(MJ_ADDR);
static BLEAddress MJAddress3(MJ_ADDR);
static BLEAddress MJAddress4(MJ_ADDR);
Then, you can call your function connectToServer(MJAddress1)
when you want to have the data of the 2nd sensor, and repeat for the next sensor etc.