madewhatnow / TFmini-I2C-Python

A Python implementation to read data from the Benewake TFmini I2C LIDAR sensor
4 stars 5 forks source link

Issue reading data from TFmini Plus #5

Open IOrtegAmp opened 4 years ago

IOrtegAmp commented 4 years ago

Thanks for your help providing the code, was struggling reading it on a Rpi 4, but sometimes I got wrong measures, aiming to the same object the distance can trigger from 90 to 600, 300, etc, and the strength signal remains the same, what can cause it?

wschmied commented 4 years ago

Just to double-check: are you actually using the TFmini Plus? The code I wrote is for the older TFmini I2C, not for the TFmini Plus.

wschmied commented 4 years ago

A quick look at the datasheet for the TFmini Plus suggests that it uses a different set of commands, and returns the data in a different format, so my code is not going to be directly applicable. If you want to, you could probably modify it to work, though.

It looks like you also first need to switch the sensor from serial into I2C mode to get it working, but that might depend on where you bought it (and which specific model).

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiug4G9lYDrAhWI4J4KHS4vDNcQFjACegQIBBAB&url=https%3A%2F%2Facroname.com%2Fsites%2Fdefault%2Ffiles%2Fassets%2Fsj-gu-tfmini_plus-01-a04-datasheet_en.pdf&usg=AOvVaw3FfoLr042IbJbqnTBCkg5e