diff --git a/lib/vl53l1x-1.0.0/.travis.yml b/lib/vl53l1x-1.0.0/.travis.yml
deleted file mode 100644
index f3ed70c21..000000000
--- a/lib/vl53l1x-1.0.0/.travis.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-language: python
-
-cache:
- directories:
- - "~/.platformio"
-
-install:
-- pip install -U platformio
-
-env:
-- BOARD=uno
-- BOARD=leonardo
-- BOARD=micro
-- BOARD=megaatmega2560
-- BOARD=due
-- BOARD=yun
-- BOARD=genuino101
-- BOARD=zero
-
-script:
-- set -eo pipefail;
- for e in examples/*; do
- platformio ci --board=$BOARD --lib=. $e/*;
- done
diff --git a/lib/vl53l1x-1.0.0/LICENSE.txt b/lib/vl53l1x-arduino-1.01/LICENSE.txt
similarity index 100%
rename from lib/vl53l1x-1.0.0/LICENSE.txt
rename to lib/vl53l1x-arduino-1.01/LICENSE.txt
diff --git a/lib/vl53l1x-1.0.0/README.md b/lib/vl53l1x-arduino-1.01/README.md
similarity index 98%
rename from lib/vl53l1x-1.0.0/README.md
rename to lib/vl53l1x-arduino-1.01/README.md
index 1a955e4ab..41ec21d9f 100644
--- a/lib/vl53l1x-1.0.0/README.md
+++ b/lib/vl53l1x-arduino-1.01/README.md
@@ -1,7 +1,7 @@
# VL53L1X library for Arduino
-Version: 1.0.0
-Release date: 2018-05-31
+Version: 1.0.1
+Release date: 2018-09-19
[![Build Status](https://travis-ci.org/pololu/vl53l1x-arduino.svg?branch=master)](https://travis-ci.org/pololu/vl53l1x-arduino)
[www.pololu.com](https://www.pololu.com/)
@@ -149,7 +149,7 @@ This library is intended to provide a quicker and easier way to get started usin
* `static const char * rangeStatusToString(RangeStatus status)`
Converts a `RangeStatus` into a readable string describing that status.
-
+
Note that on an AVR, the strings in this function are stored in RAM (dynamic memory), which makes working with them easier but uses up 200+ bytes of RAM (many AVR-based Arduinos only have about 2000 bytes of RAM). You can avoid this memory usage if you do not call this function in your sketch.
* `void setTimeout(uint16_t timeout)`
@@ -163,4 +163,5 @@ This library is intended to provide a quicker and easier way to get started usin
## Version history
+* 1.0.1 (2018-09-19): Fix Arduino 101 hanging in init().
* 1.0.0 (2018-05-31): Original release.
diff --git a/lib/vl53l1x-1.0.0/VL53L1X.cpp b/lib/vl53l1x-arduino-1.01/VL53L1X.cpp
similarity index 98%
rename from lib/vl53l1x-1.0.0/VL53L1X.cpp
rename to lib/vl53l1x-arduino-1.01/VL53L1X.cpp
index ab96a87e7..78d93e2d2 100644
--- a/lib/vl53l1x-1.0.0/VL53L1X.cpp
+++ b/lib/vl53l1x-arduino-1.01/VL53L1X.cpp
@@ -42,10 +42,16 @@ bool VL53L1X::init(bool io_2v8)
delayMicroseconds(100);
writeReg(SOFT_RESET, 0x01);
+ // give it some time to boot; otherwise the sensor NACKs during the readReg()
+ // call below and the Arduino 101 doesn't seem to handle that well
+ delay(1);
+
// VL53L1_poll_for_boot_completion() begin
startTimeout();
- while ((readReg(FIRMWARE__SYSTEM_STATUS) & 0x01) == 0)
+
+ // check last_status in case we still get a NACK to try to deal with it correctly
+ while ((readReg(FIRMWARE__SYSTEM_STATUS) & 0x01) == 0 || last_status != 0)
{
if (checkTimeoutExpired())
{
@@ -675,7 +681,7 @@ void VL53L1X::getRangingData()
break;
case 6: // SIGMATHRESHOLDCHECK
- ranging_data.range_status = SignalFail;
+ ranging_data.range_status = SigmaFail;
break;
case 7: // PHASECONSISTENCY
diff --git a/lib/vl53l1x-1.0.0/VL53L1X.h b/lib/vl53l1x-arduino-1.01/VL53L1X.h
similarity index 100%
rename from lib/vl53l1x-1.0.0/VL53L1X.h
rename to lib/vl53l1x-arduino-1.01/VL53L1X.h
diff --git a/lib/vl53l1x-1.0.0/examples/Continuous/Continuous.ino b/lib/vl53l1x-arduino-1.01/examples/Continuous/Continuous.ino
similarity index 99%
rename from lib/vl53l1x-1.0.0/examples/Continuous/Continuous.ino
rename to lib/vl53l1x-arduino-1.01/examples/Continuous/Continuous.ino
index d00edb3ad..e910466fa 100644
--- a/lib/vl53l1x-1.0.0/examples/Continuous/Continuous.ino
+++ b/lib/vl53l1x-arduino-1.01/examples/Continuous/Continuous.ino
@@ -20,7 +20,7 @@ void setup()
Serial.println("Failed to detect and initialize sensor!");
while (1);
}
-
+
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
diff --git a/lib/vl53l1x-1.0.0/examples/ContinuousWithDetails/ContinuousWithDetails.ino b/lib/vl53l1x-arduino-1.01/examples/ContinuousWithDetails/ContinuousWithDetails.ino
similarity index 97%
rename from lib/vl53l1x-1.0.0/examples/ContinuousWithDetails/ContinuousWithDetails.ino
rename to lib/vl53l1x-arduino-1.01/examples/ContinuousWithDetails/ContinuousWithDetails.ino
index 48a4d05b8..938b79bfc 100644
--- a/lib/vl53l1x-1.0.0/examples/ContinuousWithDetails/ContinuousWithDetails.ino
+++ b/lib/vl53l1x-arduino-1.01/examples/ContinuousWithDetails/ContinuousWithDetails.ino
@@ -1,8 +1,8 @@
/*
-This example takes range measurements with the VL53L1X and displays additional
+This example takes range measurements with the VL53L1X and displays additional
details (status and signal/ambient rates) for each measurement, which can help
you determine whether the sensor is operating normally and the reported range is
-valid. The range is in units of mm, and the rates are in units of MCPS (mega
+valid. The range is in units of mm, and the rates are in units of MCPS (mega
counts per second).
*/
@@ -23,7 +23,7 @@ void setup()
Serial.println("Failed to detect and initialize sensor!");
while (1);
}
-
+
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
@@ -41,7 +41,7 @@ void setup()
void loop()
{
sensor.read();
-
+
Serial.print("range: ");
Serial.print(sensor.ranging_data.range_mm);
Serial.print("\tstatus: ");
@@ -50,6 +50,6 @@ void loop()
Serial.print(sensor.ranging_data.peak_signal_count_rate_MCPS);
Serial.print("\tambient: ");
Serial.print(sensor.ranging_data.ambient_count_rate_MCPS);
-
+
Serial.println();
}
\ No newline at end of file
diff --git a/lib/vl53l1x-1.0.0/keywords.txt b/lib/vl53l1x-arduino-1.01/keywords.txt
similarity index 100%
rename from lib/vl53l1x-1.0.0/keywords.txt
rename to lib/vl53l1x-arduino-1.01/keywords.txt
diff --git a/lib/vl53l1x-1.0.0/library.properties b/lib/vl53l1x-arduino-1.01/library.properties
similarity index 95%
rename from lib/vl53l1x-1.0.0/library.properties
rename to lib/vl53l1x-arduino-1.01/library.properties
index 7ea2eb7f2..1bf06dae9 100644
--- a/lib/vl53l1x-1.0.0/library.properties
+++ b/lib/vl53l1x-arduino-1.01/library.properties
@@ -1,5 +1,5 @@
name=VL53L1X
-version=1.0.0
+version=1.0.1
author=Pololu
maintainer=Pololu
sentence=VL53L1X distance sensor library
diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h
index 49f1e10a3..6f865bcef 100644
--- a/tasmota/my_user_config.h
+++ b/tasmota/my_user_config.h
@@ -531,7 +531,7 @@
// #define USE_SPS30 // [I2cDriver30] Enable Sensiron SPS30 particle sensor (I2C address 0x69) (+1.7 code)
#define USE_ADE7953 // [I2cDriver7] Enable ADE7953 Energy monitor as used on Shelly 2.5 (I2C address 0x38) (+1k5)
// #define USE_VL53L0X // [I2cDriver31] Enable VL53L0x time of flight sensor (I2C address 0x29) (+4k code)
-// #define USE_VL53L1X // Enable support for VL53L1X sensor (I2C addres 0x52) using Pololu VL53L1X library (+2k9 code)
+// #define USE_VL53L1X // [I2cDriver53] Enable support for VL53L1X sensor (I2C addres 0x52) using Pololu VL53L1X library (+2k9 code)
// #define USE_MLX90614 // [I2cDriver32] Enable MLX90614 ir temp sensor (I2C address 0x5a) (+0.6k code)
// #define USE_CHIRP // [I2cDriver33] Enable CHIRP soil moisture sensor (variable I2C address, default 0x20)
// #define USE_PAJ7620 // [I2cDriver34] Enable PAJ7620 gesture sensor (I2C address 0x73) (+2.5k code)