Lidar-Lite v3 return always zero with raspberry pi 3
Trying to get an Adafruit servo hat to work on Raspberry Pi 3... and a PulsedLight Lidar-Lite v2 unit.
Using I2C for comms - servo hat on 0x40 and Lidar on 0x62.
Tried on Pi2 and the Lidar was fine but the same code returns 0 for distance/velocity on Pi3.
(if I2C tools not installed then first run these commands)
Issue is that the latest Raspbian kernel is auto restarting the I2C and the LidarLite unit doesn't like this.. hence python code returns 0 for distance and 0 for speed - even though the I2C detect has demonstrated the device is connected correctly.
Bump the kernel back to an earlier version - I'm using 4.4.38 which works.
You copy the hex code (in this case af9cb14d5053f89857225bd18d1df59a089c171e) and run it like this:
If rpi-update not installed first run this: sudo apt-get install rpi-update
sudo rpi-update af9cb14d5053f89857225bd18d1df59a089c171e
... it'll take a while then ask you to reboot your Pi. If you get an error message then try running the command again (possibly a few times) as it could be a missing packet of data from the network corrupting the file - this happened to me twice - 3rd time it worked fine.
Thanks to Isa Hatipoglu for the information on rpi-update: