cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a Linux / Python Library for the VL53L5? I'm trying to get a simple range measurement out of the device using a Raspberry Pi 4. Is a VL53L3 or VL53L0X library close enough to get a basic distance measurement out of the device?

JDunn.1
Associate II
 
1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

Soon - very soon. The data sheet came out on July 7, and the Graphical User Interface will be out by the 15th.

There is some X-cube code up on the web site, but it's incorrect.

Only solution I have for you is to wait a couple more days.

Everything should be there by July 15.

I've been promised.

And this sensor is completely different from the prior VL53 sensors, so none of that code will work.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

View solution in original post

8 REPLIES 8
John E KVAM
ST Employee

Soon - very soon. The data sheet came out on July 7, and the Graphical User Interface will be out by the 15th.

There is some X-cube code up on the web site, but it's incorrect.

Only solution I have for you is to wait a couple more days.

Everything should be there by July 15.

I've been promised.

And this sensor is completely different from the prior VL53 sensors, so none of that code will work.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
GSUN.1
Associate

@John E KVAM​ When you say "There is some X-cube code up on the web site, but it's incorrect.", which version you mean to say, because I'm using the "X-Cube-TOF 1.2.0.0", no error reported, but I can't get any data from the sensor, because the L5 never rise any interrupt to the HOST, could you please help check, that would be very helpful for us, thanks.

John,

I'm checking back in on this topic. Any luck getting a Arduino /Linux / Python Library for the VL53L5 yet?

I haven't seen any of the updates that were coming on July 15th.

thanks,

-Joe

John E KVAM
ST Employee

All the code is up there - finally.

Go to ST.com and search for VL53L5 - it will bring you to the product page.

Then click on 'tools and software"

One of the options is the Linux Driver -

STSW_IMG025

That should set you up.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Thank you for following up! I will check it out!
John E KVAM
ST Employee

I fear I have steered you in the wrong direction.

There is a linux driver and it does work - but it's too hard. Unless you are serious about putting stuff in the kernel I have a better way.

The Linux driver is fine for systems that don't want to give I2C access to user level code.

But in your RPi, you have the freedom to write to the I2C form user code.

And user code is easier to debug.

The easy way to use the VL53L5 on the RaspberryPi is to start with:

STSW-IMG023

Ultra Lite Driver (ULD) for VL53L5CX multi-zone sensor

It is pretty simple.

But there is a trick - This code does NOT know which CPU/MCU you are using. YOu must edit the platform.c file (which is generally empty) and fill it with the code needed to access your I2C. (There are lots of references on how to open an I2C device - you can google it.)

When done you can run any of the examples.

And one of them is a basic ranging program that takes the data and prints it out. Modify this program to your liking.

I then 'pipe' the output of this program into my Python programs to make using the data easier.

  • john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
KWine
Senior

Arduino driver for the VL53L5CX here.

Julien NGUYEN
ST Employee

Python code is here:

https://pypi.org/project/VL53L5CX/#files

https://github.com/mp-extras/vl53l5cx

Please let's us know if it works.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.