[Solved] Lightware LW20 reporting a constant 654.36 metres

Hi,

I recently began using a Lightware LW20 on my quadplane + Pixhawk 2.1 with some firmware on master (commit e76865e to be exact) that was working well. I was receiving the correct distances from the LW20. However, after a single test hover, the LW20 began to constantly report this exact reading in cm (reading_cm): 65436 (0xFF9C) - referring to line https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_LightWareI2C.cpp#L83 - which Arduplane used as a 654.36m distance indication. This persists across two different Pixhawk 2.1s with the same firmware installed.

The be16_t val variable on the same line when printed indicates 40191 (0x9CFF) constantly. The wiring between the LW20 and Pixhawk 2.1 is alright, so I’m wondering if something might have been set on the LW20 to force it into a different mode. Also, does anyone know how to read/write to I2C ports with MAVProxy/nsh? I’ve tried the devop module in MAVProxy and it doesn’t seem to work, and nsh doesn’t have an i2c application as indicated in some placed online.

Thanks!

Did you test the sensor with Lightware testing software ?

Did you try to disconnect all other I2C devices ?

I know that Lightware is working on a GUI configuration software for the I2C Lidars similar to serial Lidars, it should be ready next March.

Unfortunately I don’t have an I2C to USB converter on hand right now :frowning: I was trying to find another way, like connecting through nsh directly to read/write to the I2C bus.

Yes, all other I2C devices are disconnected.

I’m not sure if this is relevant, but I had the LW20 on an I2C splitter together with an airspeed sensor (a MS 4525DO-based one) (https://hobbyking.com/en_us/hk-pilot-analog-air-speed-sensor-and-pitot-tube-set-update-pitot-tube.html)

If the sensor was working and then without any change in the system it do not work anymore it could be a problem related to the sensor itself.

Ask for you problem to Lightware they have an good customer support.

I also have a LW20 but because of the lack of a configuration tool for I2C version did not use yet for my project, I was tempted to send it back to Lighware service and switch the cable to the serial connector inside.

Ok, thanks @lucamax :slight_smile:

Just to follow up on this - there was a small manufacturing error in this particular LW20, which was RMAed and replaced quickly - many thanks to Lightware for the quick response.