cassou / vl53l0x_rasp Goto Github PK
View Code? Open in Web Editor NEWVL53L0X Api port for Raspberry Pi
License: Other
VL53L0X Api port for Raspberry Pi
License: Other
Hi,
Thanks for taking the time to write this library.
I am using a VL53L0X on a RPi3 to measure the water level in a tank. The tank is a large (105,000 litre) concrete tank, sunk into the ground. No light gets in, it's dark inside. The RPi is mounted on the top of the tank in a weatherproof box and the VL53L0X "sees" down through a hole in the box. As you can imagine, the water level is fairly static and the surface calm.
I used your code from the vl53l0x_SingleRanging_Long_Range_Example.c example but seem to get wildly varying results...
Measured distance: 254
Measured distance: 261
Measured distance: 251
Measured distance: 268
Measured distance: 246
Measured distance: 262
Measured distance: 262
Measured distance: 265
Measured distance: 252
Measured distance: 256
Measured distance: 252
Measured distance: 252
Measured distance: 261
Measured distance: 268
Measured distance: 267
Measured distance: 254
Measured distance: 261
Measured distance: 264
Measured distance: 270
Measured distance: 257
Measured distance: 259
Measured distance: 254
Measured distance: 257
Measured distance: 252
Measured distance: 257
Measured distance: 255
Measured distance: 251
Measured distance: 249
Measured distance: 252
Measured distance: 255
Measured distance: 253
Measured distance: 261
Measured distance: 262
Measured distance: 253
Measured distance: 252
Measured distance: 263
Measured distance: 277
Measured distance: 252
Measured distance: 261
Measured distance: 264
Measured distance: 268
Measured distance: 270
Measured distance: 262
Measured distance: 244
Measured distance: 272
Measured distance: 253
Measured distance: 283
Measured distance: 250
Measured distance: 253
Measured distance: 258
Min=244 and Max=283. I was assuming this sensor would be quite accurate with minimal variation.
I need to be able to measure from about 110mm to around 1780mm.
Do you have any suggestions on how to improve the accuracy or minimise the variation? The manual talks about a "High Accuracy" setting but a max range of 1.2m - that might have to do, if it works.
Thanks.
Hey, I'm using this on Jetson Nano but for some reason, it shows me this error, Ive tried to reinstall this many times, but it always shows up this error.
I'm using the VL53L0X sensors with a TCA9548A multiplexer
VL53L0X_GetDeviceInfo:
Device Name : VL53L0X ES1 or later
Device Type : VL53L0X
Device ID : VL53L0CAV0DH/1$5
ProductRevisionMajor : 1
ProductRevisionMinor : 1
API Status: 0 : No Error
VL53L0X Start Ranging Address 0x29 TCA9548A Device 2 TCA9548A Address 0x70
VL53L0X_GetDeviceInfo:
Device Name : VL53L0X ES1 or later
Device Type : VL53L0X
Device ID : VL53L0CAV0DH/1$5
ProductRevisionMajor : 1
ProductRevisionMinor : 1
API Status: 0 : No Error
Segmentation fault
I've just downloaded the latest version and having the exactly same output:
Example
VL53L0X PAL Continuous Ranging example
VL53L0X API Version Error: Your firmware has 1.0.2 (revision 4823). This example requires 1.0.1.
Call of VL53L0X_DataInit
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
API Status: -20 : Control Interface Error
API Status: -20 : Control Interface Error
Close Comms
VL53L0X_i2c_close
API Status: -20 : Control Interface Error
pi@raspberrypi:~/scripts/VL/VL53L0X_rasp/bin $
I receive this error after compiling the examples:
pi@raspberrypi:~/VL53L0X_rasp-master/bin $ ./vl53l0x_ContinuousRanging_Example
VL53L0X PAL Continuous Ranging example
VL53L0X API Version Error: Your firmware has 1.0.2 (revision 4823). This example requires 1.0.1.
Call of VL53L0X_DataInit
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
Failed to write to the i2c bus.
API Status: -20 : Control Interface Error
API Status: -20 : Control Interface Error
Close Comms
VL53L0X_i2c_close
API Status: -20 : Control Interface Error
My Action --> change the examples from 1 to 2
#define VERSION_REQUIRED_MAJOR 1
#define VERSION_REQUIRED_MINOR 0
#define VERSION_REQUIRED_BUILD **2**
i don't know if it is the wright way, but the API Version error disappeared
my next Problem: Failed to write to the i2c bus.
This is the answer from i2cdetect on bus 1 (Raspi2)
pi@raspberrypi:~/VL53L0X_rasp-master/bin $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Hardware:
CJMCU-530
Raspi2B
Any tipps for me?
Hi,
For using this in another project, all the h files you have written are still under the ST license which is fine, however the main platform c code and the examples have no license information. I know it's pedantic but it would be awesome if you could put a license on the platform code c file, as the current license (or lack of) technically prohibits the use of your platform code in any other project (I believe).
Hi,
The API has been updated recently to 1.0.2 - I modified your build to expect 1.0.2 but now I am getting failures. Could you please check if your implementation still works with 1.0.2. I'm trying to debug but I'm unsure if it's my soldering, my old raspberry pi, my misunderstanding of how this sensor works or if the API update broke something in your code. Helpfully the documentation is not particularly descriptive about what changed :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.