I checked Lidar Lite v3 with Rasbian 2016-11-25 and figured out what’s happening – due to upgraded kernel this change has been merged and now I2C interface always uses repeated start (though it should be enabled explicitly via I2C_RDWR ioctl call – Combined R/W transfer (one STOP only)).
I’ll reverse this patch on my machine, test it and try to fix this.
If the kernel upgrade causes the I2C driver to force repeated starts, then there is not much to be done to use the LIDAR-Lite v3 since it does not support repeated starts at this time.
Therefore, the two main options would be:
Use a previous kernel that does not have this issue (forced repeated starts). Older versions are available here.
Apply a kernel patch to this kernel to remove this issue.
We figure option #1 is the simplest for more people, as #2 requires quite a bit of more knowledge and work.
Third long-term option – they (engineers/manufacturers) should fix Lidars’ I2C chip in next iteration, as I2C protocol explicitly allows combined R/W. It’s in the spec (and it’s faster + mitigates clock stretching issues).
@krookdfinger I’ll try to dip my hands in this issue tomorrow. This needs to be fixed in kernel module.
it’s unbelievable look like there is no responsibility behind open source product, manufacturer don’t care about their product and Kerner has been updated and no one in the world can run their Lidar lite v3 on Raspberry Pi, I really appreciate if someone can resolve this issue
Thanks for the good link on the upgrade/downgrade for the kernel. We are certain this will help users who are less knowledgeable about kernel downgrades (or even patching!) to be able to use their LIDAR-Lite v3 properly.
As for your other comments, I’m not too sure what to say. I have a feeling that the repeated start feature of the I2C specification, which was meant to allow a master in a multiple master setup to keep control over the bus, has started to be used by default as a way to save sending a stop condition in single master buses, too. While that is not wrong, it is possible for slaves to require a stop condition in some cases (and sometimes with good reason). This answer here is quite detailed about this. Here’s an excerpt of the answer:
This is most likely the same design idea that went towards the LIDAR-Lite’s handling of I2C communications.
Concerning the kernel patch, well, if it really does force repeated starts (no matter what is requested) - which seems to be the case currently - it most likely needs to be reported as an issue and it can then be patched quickly.
The manufacturer most certainly care about their product, but these things do not change quickly or easily. It must be especially difficult to justify a design change (read: cost/time/effort) to fix something that is not broken and is instead an external issue (other entity’s products/code using repeated starts).
Thanks Scharette for your descriptive comment, I’m actually new to this so I find that link really easy to use and I though it’s good to share with others.
Taghvaei rocks. I can confirm that this procedure worked on a SD card with the most recent version of Stretch. I have great sadness that I needed to lobotomize my kernel to get the Garmin to work, but great happiness that it is now working.
We are glad to have another confirmation that the procedure works.
As for patching the kernel, if you read the post above, you will notice this is a bug in the kernel code that was introduced recently: the code no longer allows you to choose between start/stop and repeated starts. It simply always uses repeated starts no matter what is asked.
So, you are in fact providing help to the kernel, not lobotomizing it!