h2zero/NimBLE-Arduino -> 1.3.6 (#240)
* h2zero/NimBLE-Arduino -> 1.3.6 * Remove unneeded libs * Tweak retry code to wait longer
This commit is contained in:
parent
cc1155dc16
commit
d372d48a96
|
@ -86,7 +86,7 @@ void BleFingerprint::fingerprint(BLEAdvertisedDevice *advertisedDevice)
|
||||||
didQuery = false;
|
didQuery = false;
|
||||||
shouldQuery = true;
|
shouldQuery = true;
|
||||||
qryAttempts = 0;
|
qryAttempts = 0;
|
||||||
qryDelayMillis = 1;
|
qryDelayMillis = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -440,10 +440,10 @@ bool BleFingerprint::query()
|
||||||
Serial.printf("%d QryErr| MAC: %s, ID: %-60s rssi %d, try %d, retry after %dms\n", xPortGetCoreID(), getMac().c_str(), getId().c_str(), rssi, qryAttempts, qryDelayMillis);
|
Serial.printf("%d QryErr| MAC: %s, ID: %-60s rssi %d, try %d, retry after %dms\n", xPortGetCoreID(), getMac().c_str(), getId().c_str(), rssi, qryAttempts, qryDelayMillis);
|
||||||
|
|
||||||
qryAttempts++;
|
qryAttempts++;
|
||||||
if (qryDelayMillis < 60000)
|
if (qryDelayMillis < 30000)
|
||||||
qryDelayMillis *= 2;
|
qryDelayMillis *= qryAttempts;
|
||||||
else
|
else
|
||||||
qryDelayMillis = 60000;
|
qryDelayMillis = 30000;
|
||||||
didQuery = false;
|
didQuery = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -91,7 +91,7 @@ private:
|
||||||
NimBLEAddress address;
|
NimBLEAddress address;
|
||||||
String id, name, disc;
|
String id, name, disc;
|
||||||
short int idType = 0, rssi = -100, calRssi = NO_RSSI, mdRssi = NO_RSSI, asRssi = NO_RSSI, newest = NO_RSSI, recent = NO_RSSI, oldest = NO_RSSI;
|
short int idType = 0, rssi = -100, calRssi = NO_RSSI, mdRssi = NO_RSSI, asRssi = NO_RSSI, newest = NO_RSSI, recent = NO_RSSI, oldest = NO_RSSI;
|
||||||
int qryAttempts = 0, seenCount = 1, qryDelayMillis = 1;
|
int qryAttempts = 0, seenCount = 1, qryDelayMillis = 3;
|
||||||
float raw = 0, lastReported = 0, temp = 0, humidity = 0;
|
float raw = 0, lastReported = 0, temp = 0, humidity = 0;
|
||||||
unsigned long firstSeenMillis, lastSeenMillis = 0, lastReportedMillis = 0, lastQryMillis = 0;
|
unsigned long firstSeenMillis, lastSeenMillis = 0, lastReportedMillis = 0, lastQryMillis = 0;
|
||||||
uint16_t mv = 0;
|
uint16_t mv = 0;
|
||||||
|
|
|
@ -12,21 +12,24 @@
|
||||||
default_envs = esp32
|
default_envs = esp32
|
||||||
|
|
||||||
[common_env_data]
|
[common_env_data]
|
||||||
platform = espressif32
|
platform = espressif32@3.5
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps_external =
|
lib_deps_external =
|
||||||
haimoz/SoftFilters@^0.1.0
|
haimoz/SoftFilters@^0.1.0
|
||||||
marvinroger/AsyncMqttClient@^0.9.0
|
marvinroger/AsyncMqttClient@^0.9.0
|
||||||
bblanchon/ArduinoJson@^6.17.3
|
bblanchon/ArduinoJson@^6.17.3
|
||||||
https://github.com/ESPresense/ESP-WiFiSettings.git
|
https://github.com/ESPresense/ESP-WiFiSettings.git
|
||||||
https://github.com/h2zero/NimBLE-Arduino.git#1.3.3
|
h2zero/NimBLE-Arduino@^1.3.6
|
||||||
me-no-dev/AsyncTCP@^1.1.1
|
me-no-dev/AsyncTCP@^1.1.1
|
||||||
bbx10/DNSServer@^1.1.0
|
bbx10/DNSServer@^1.1.0
|
||||||
|
build_flags =
|
||||||
|
-D CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
|
||||||
|
|
||||||
|
[common_sensors]
|
||||||
|
lib_deps_external =
|
||||||
adafruit/Adafruit Unified Sensor @ ^1.1.4
|
adafruit/Adafruit Unified Sensor @ ^1.1.4
|
||||||
beegee-tokyo/DHT sensor library for ESPx @ ^1.18
|
beegee-tokyo/DHT sensor library for ESPx @ ^1.18
|
||||||
starmbi/hp_BH1750 @ ^1.0.0
|
starmbi/hp_BH1750 @ ^1.0.0
|
||||||
build_flags =
|
|
||||||
-D CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
|
|
||||||
|
|
||||||
[env:esp32]
|
[env:esp32]
|
||||||
platform = ${common_env_data.platform}
|
platform = ${common_env_data.platform}
|
||||||
|
@ -35,7 +38,7 @@ board = esp32dev
|
||||||
lib_deps = ${common_env_data.lib_deps_external}
|
lib_deps = ${common_env_data.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
upload_speed = 115200
|
upload_speed = 1500000
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
build_flags =
|
build_flags =
|
||||||
-D FIRMWARE='"esp32"'
|
-D FIRMWARE='"esp32"'
|
||||||
|
@ -126,7 +129,9 @@ build_flags =
|
||||||
platform = ${common_env_data.platform}
|
platform = ${common_env_data.platform}
|
||||||
framework = ${common_env_data.framework}
|
framework = ${common_env_data.framework}
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
lib_deps = ${common_env_data.lib_deps_external}
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
upload_speed = 115200
|
upload_speed = 115200
|
||||||
|
@ -139,7 +144,9 @@ build_flags =
|
||||||
platform = ${common_env_data.platform}
|
platform = ${common_env_data.platform}
|
||||||
framework = ${common_env_data.framework}
|
framework = ${common_env_data.framework}
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
lib_deps = ${common_env_data.lib_deps_external}
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
@ -152,7 +159,9 @@ build_flags =
|
||||||
platform = ${common_env_data.platform}
|
platform = ${common_env_data.platform}
|
||||||
framework = ${common_env_data.framework}
|
framework = ${common_env_data.framework}
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
lib_deps = ${common_env_data.lib_deps_external}
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
upload_speed = 1500000
|
upload_speed = 1500000
|
||||||
|
@ -169,6 +178,7 @@ board = m5stick-c
|
||||||
lib_deps =
|
lib_deps =
|
||||||
m5stack/M5StickC@^0.2.0
|
m5stack/M5StickC@^0.2.0
|
||||||
${common_env_data.lib_deps_external}
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
@ -184,6 +194,7 @@ board = m5stick-c
|
||||||
lib_deps =
|
lib_deps =
|
||||||
m5stack/M5StickCPlus@^0.0.2
|
m5stack/M5StickCPlus@^0.0.2
|
||||||
${common_env_data.lib_deps_external}
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
@ -201,6 +212,7 @@ lib_deps =
|
||||||
fastled/FastLED@^3.4.0
|
fastled/FastLED@^3.4.0
|
||||||
m5stack/m5atom@^0.0.5
|
m5stack/m5atom@^0.0.5
|
||||||
${common_env_data.lib_deps_external}
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_sensors.lib_deps_external}
|
||||||
board_build.partitions = partitions_singleapp.csv
|
board_build.partitions = partitions_singleapp.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
#include <AsyncMqttClient.h>
|
#include <AsyncMqttClient.h>
|
||||||
#include <AsyncTCP.h>
|
#include <AsyncTCP.h>
|
||||||
#include <DHTesp.h>
|
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
#include <HTTPUpdate.h>
|
#include <HTTPUpdate.h>
|
||||||
#include <NimBLEDevice.h>
|
#include <NimBLEDevice.h>
|
||||||
|
@ -24,7 +24,8 @@
|
||||||
#include <freertos/timers.h>
|
#include <freertos/timers.h>
|
||||||
#include <rom/rtc.h>
|
#include <rom/rtc.h>
|
||||||
|
|
||||||
//GY-302 lux sensor
|
#ifdef SENSORS
|
||||||
|
#include <DHTesp.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <hp_BH1750.h>
|
#include <hp_BH1750.h>
|
||||||
hp_BH1750 BH1750;
|
hp_BH1750 BH1750;
|
||||||
|
@ -33,6 +34,7 @@ float lux_BH1750;
|
||||||
int lux_BH1750_MQTT;
|
int lux_BH1750_MQTT;
|
||||||
String BH1750_I2c;
|
String BH1750_I2c;
|
||||||
bool I2CDebug;
|
bool I2CDebug;
|
||||||
|
#endif
|
||||||
|
|
||||||
AsyncMqttClient mqttClient;
|
AsyncMqttClient mqttClient;
|
||||||
TimerHandle_t reconnectTimer;
|
TimerHandle_t reconnectTimer;
|
||||||
|
|
Loading…
Reference in New Issue