Hi.
I’m trying to read some BLE sensor. But it seems I do not get all the bytes.
I’m using this config for testing.
on_ble_advertise:
- mac_address: 28:2C:02:41:04:74
then:
- lambda: |-
ESP_LOGD("ble_adv", "New BLE device");
ESP_LOGD("ble_adv", " address: %s", x.address_str().c_str());
ESP_LOGD("ble_adv", " name: %s", x.get_name().c_str());
ESP_LOGD("ble_adv", " Advertised service UUIDs:");
for (auto uuid : x.get_service_uuids()) {
ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
}
ESP_LOGD("ble_adv", " Advertised service data:");
for (auto data : x.get_service_datas()) {
ESP_LOGD("ble_adv", " - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
}
ESP_LOGD("ble_adv", " Advertised manufacturer data:");
for (auto data : x.get_manufacturer_datas()) {
ESP_LOGD("ble_adv", " - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
for (int i = 0; i < data.data.size(); i++)
{
ESP_LOGD("ble_adv", "[%i] - %02x", i, data.data[i]);
}
}
on_ble_manufacturer_data_advertise:
- mac_address: 28:2C:02:41:04:74
manufacturer_id: 026C
then:
- lambda: |-
ESP_LOGD("ble_man_adv[1]", " - %02x: ", x[0]);
ESP_LOGD("ble_man_adv[2]", " - %02x: ", x[1]);
ESP_LOGD("ble_man_adv[3]", " - %02x: ", x[2]);
ESP_LOGD("ble_man_adv[4]", " - %02x: ", x[3]);
ESP_LOGD("ble_man_adv[5]", " - %02x: ", x[4]);
ESP_LOGD("ble_man_adv[6]", " - %02x: ", x[5]);
ESP_LOGD("ble_man_adv[7]", " - %02x: ", x[6]);
ESP_LOGD("ble_man_adv[8]", " - %02x: ", x[7]);
ESP_LOGD("ble_man_adv[9]", " - %02x: ", x[8]);
ESP_LOGD("ble_man_adv[10]", " - %02x: ", x[9]);
ESP_LOGD("ble_man_adv[11]", " - %02x: ", x[10]);
ESP_LOGD("ble_man_adv[12]", " - %02x: ", x[11]);
ESP_LOGD("ble_man_adv[13]", " - %02x: ", x[12]);
ESP_LOGD("ble_man_adv[14]", " - %02x: ", x[13]);
ESP_LOGD("ble_man_adv[15]", " - %02x: ", x[14]);
ESP_LOGD("ble_man_adv[16]", " - %02x: ", x[15]);
ESP_LOGD("ble_man_adv[17]", " - %02x: ", x[16]);
ESP_LOGD("ble_man_adv[18]", " - %02x: ", x[17]);
ESP_LOGD("ble_man_adv[19]", " - %02x: ", x[18]);
ESP_LOGD("ble_man_adv[20]", " - %02x: ", x[19]);
ESP_LOGD("ble_man_adv[21]", " - %02x: ", x[20]);
ESP_LOGD("ble_man_adv[22]", " - %02x: ", x[21]);
ESP_LOGD("ble_man_adv[23]", " - %02x: ", x[22]);
ESP_LOGD("ble_man_adv[24]", " - %02x: ", x[23]);
Log output is:
[00:41:02][VV][esp32_ble_tracker:520]: Name: 'EfentoSensor'
[00:41:02][VV][esp32_ble_tracker:528]: Ad Flag: 6
[00:41:02][VV][esp32_ble_tracker:534]: Manufacturer data: 02.05.15.01.00.00.0D.90.00.03.00.0B.01.00.00.02.43.43.FF.FF.00.00.CD.5F (24)
[00:41:02][VV][esp32_ble_tracker:550]: Adv data: 02.01.06.0D.09.45.66.65.6E.74.6F.53.65.6E.73.6F.72.1B.FF.6C.02.02.05.15.01.00.00.0D.90.00.03.00.0B.01.00.00.02.43.43.FF.FF.00.00.CD.5F (45)
[00:41:02][D][ble_adv:035]: New BLE device
[00:41:02][D][ble_adv:036]: address: 28:2C:02:41:04:74
[00:41:02][D][ble_adv:037]: name: EfentoSensor
[00:41:02][D][ble_adv:038]: Advertised service UUIDs:
[00:41:02][D][ble_adv:042]: Advertised service data:
[00:41:02][D][ble_adv:046]: Advertised manufacturer data:
[00:41:02][D][ble_adv:048]: - 0x026C: (length 24)
[00:41:02][D][ble_adv:051]: [0] - 02
[00:41:02][D][ble_adv:051]: [1] - 05
[00:41:02][D][ble_adv:051]: [2] - 15
[00:41:02][D][ble_adv:051]: [3] - 01
[00:41:02][D][ble_adv:051]: [4] - 00
[00:41:02][D][ble_adv:051]: [18] - ff
[00:41:02][D][ble_adv:051]: [19] - ff
[00:41:02][D][ble_adv:051]: [20] - 00
[00:41:02][D][ble_adv:051]: [21] - 00
[00:41:02][D][ble_adv:051]: [22] - cd
[00:41:02][D][ble_adv:051]: [23] - 5f
[00:41:02][D][ble_man_adv[1]:060]: - 02:
[00:41:02][D][ble_man_adv[2]:061]: - 05:
[00:41:02][D][ble_man_adv[3]:062]: - 15:
[00:41:02][D][ble_man_adv[4]:063]: - 01:
[00:41:02][D][ble_man_adv[5]:064]: - 00:
[00:41:02][D][ble_man_adv[6]:065]: - 00:
[00:41:02][D][ble_man_adv[7]:066]: - 0d:
[00:41:02][D][ble_man_adv[8]:067]: - 90:
[00:41:02][D][ble_man_adv[9]:068]: - 00:
[00:41:02][D][ble_man_adv[10]:069]: - 03:
[00:41:02][D][ble_man_adv[11]:070]: - 00:
[00:41:02][D][ble_man_adv[12]:071]: - 0b:
[00:41:02][D][ble_man_adv[13]:072]: - 01:
[00:41:02][D][ble_man_adv[14]:073]: - 00:
[00:41:02][D][ble_man_adv[20]:079]: - ff:
[00:41:02][D][ble_man_adv[22]:081]: - 00:
[00:41:02][D][ble_man_adv[23]:082]: - cd:
[00:41:02][D][ble_man_adv[24]:083]: - 5f:
Some bytes do not show up in the print loop but all the bytes are shown in the verbose log line.
What am I doing wrong?
Any help would be appreciated.
Cheers,
Mateusz