{"action":"created","issue":{"url":"https://api.github.com/repos/PX4/Firmware/issues/1678","labels_url":"https://api.github.com/repos/PX4/Firmware/issues/1678/labels{/name}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/1678/comments","events_url":"https://api.github.com/repos/PX4/Firmware/issues/1678/events","html_url":"https://github.com/PX4/Firmware/pull/1678","id":54940911,"number":1678,"title":"Rework the LIDAR Lite driver (ll40ls) to prevent timeouts and failure.","user":{"login":"sjwilks","id":1179086,"avatar_url":"https://avatars.githubusercontent.com/u/1179086?v=3","gravatar_id":"","url":"https://api.github.com/users/sjwilks","html_url":"https://github.com/sjwilks","followers_url":"https://api.github.com/users/sjwilks/followers","following_url":"https://api.github.com/users/sjwilks/following{/other_user}","gists_url":"https://api.github.com/users/sjwilks/gists{/gist_id}","starred_url":"https://api.github.com/users/sjwilks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjwilks/subscriptions","organizations_url":"https://api.github.com/users/sjwilks/orgs","repos_url":"https://api.github.com/users/sjwilks/repos","events_url":"https://api.github.com/users/sjwilks/events{/privacy}","received_events_url":"https://api.github.com/users/sjwilks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-20T21:16:27Z","updated_at":"2015-01-20T21:58:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PX4/Firmware/pulls/1678","html_url":"https://github.com/PX4/Firmware/pull/1678","diff_url":"https://github.com/PX4/Firmware/pull/1678.diff","patch_url":"https://github.com/PX4/Firmware/pull/1678.patch"},"body":"**This is a WIP, do not merge.** This is potentially close to a fix or at least a significant improvement on the current state.\r\n\r\nAfter several long running tests this change appears to prevent or at least significantly extend the time until communication fails. Typically communication with the Lidar fails within minutes, especially if another I2C device such as the PX4Flow is on the same I2C bus (need more testing to confirm this).\r\n\r\nThe current state of the Read() function illustrates (will not currently run) what appears to be the correct way of communicating with the device and resulted in 0 errors. The proper implementation in cycle(), collect() and measure() aims for a more practical variant. The ideal delay between writing and reading is 15ms. Shorter times trigger read/write errors. Preventing out of sequence reads/writes is also critical. Multiple attempts sometimes need to be made to write/read but currently always succeed within 8 attempts but this isn't a guarantee and running over will probably still lead to a failure or signal a pending unavoidable failure.\r\n\r\nMore longer running tests, timing refinement and cleanup needed.\r\n"},"comment":{"url":"https://api.github.com/repos/PX4/Firmware/issues/comments/70742621","html_url":"https://github.com/PX4/Firmware/pull/1678#issuecomment-70742621","issue_url":"https://api.github.com/repos/PX4/Firmware/issues/1678","id":70742621,"user":{"login":"sjwilks","id":1179086,"avatar_url":"https://avatars.githubusercontent.com/u/1179086?v=3","gravatar_id":"","url":"https://api.github.com/users/sjwilks","html_url":"https://github.com/sjwilks","followers_url":"https://api.github.com/users/sjwilks/followers","following_url":"https://api.github.com/users/sjwilks/following{/other_user}","gists_url":"https://api.github.com/users/sjwilks/gists{/gist_id}","starred_url":"https://api.github.com/users/sjwilks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjwilks/subscriptions","organizations_url":"https://api.github.com/users/sjwilks/orgs","repos_url":"https://api.github.com/users/sjwilks/repos","events_url":"https://api.github.com/users/sjwilks/events{/privacy}","received_events_url":"https://api.github.com/users/sjwilks/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T21:58:30Z","updated_at":"2015-01-20T21:58:30Z","body":"@tridge yep, I will remove them once I work out the timing and if it really will fix the problem. I'm still not convinced this is going to be a great solution but may ended up holding things over till PulsedLight reviews their approach.\r\n\r\nThe latest test is up to 44k polls without failure. I'll let it run overnight."}}