Optical Flow sensor working?

Greetings,

Has anyone tried using the Optical Flow sensor successfully in 3.1?

Mission Planner detects it (or rather complains on boot if I disconnect the sensor), but all the readings are zeros in console (test -> optflow).

I have read data and images successfully with 3.1-rc5 test program (with modified library code). But in Mission Planner it reads only zeros whether I am using official 3.1 firmware or my modified 3.1-rc5 firmware. (The modification in library was to read the registers twice, since the incoming data appeared to be one byte “delayed”.)

I am using APM 2.5.1, have resoldered the 3.3V/5V jumper as shown on the wiki page, tried adjusting the focus and I did have the camera lid removed. I also think the wires are OK, as the test example was working.

Any suggestions would be appreciated

I’ve tested it with AC3.1 and it was working. I fixed a bug in one of the later release candidates (-rc7?) to make sure the SPI bus was running in the correct mode when talking to the sensor and that made it all start working for me.

Any updates on this? I’ve installed an optflow sensor in my indoor miniquad, but I have the same issue: the hardware is definitely working (test sketch shows OK values, Python script to show sensor image works as well), but the terminal test in 3.1 only shows 0/0 values, and entering OF_Loiter from AltHold doesn’t do anything, the copter keeps drifting slowly, requiring manual corrections to hover.

I tried to capture a piece of SPI communication with a logic analyzer.

The bus speed seems to be OK now. (It is still @ 8 Mhz, but I noticed later that it is reduced to 2 MHz each time the OpticalFlow sensor is adressed, so it should be no problem.)

This traffic was repeated each 100 ms:

MOSI, MISO
0x05, 0x00
0x00, 0x00
(delay of 54us)
0x02, 0x00
0x00, 0x41

The capture file is here: https://dl.dropboxusercontent.com/u/15737085/spi.logicdata
It can be opened with program from the manufacturer: saleae.com/downloads
Unfortunately I wasn’t able to capture initialization on boot.
Could it be that the sensor is misconfigured in any way?

It appears that the communication is working both ways, since the sensor is responding with Motion register being 0x41, which suggests that DPI was set to 1600. Is that correct?

From all this I would think that there is just too little light for the sensor to work, but i have it tested at night with only a table lamp (a lightbulb).

olexs: How much light did you have when your test sketch was working with movement values (not photos)?
Does the sensor hate fluorescent tubes?

Thanks for any help.

Is it also working on PX4FLOW Camera with SONAR with pixhawk and AC3.1 ?

Is it also working on PX4FLOW Camera with SONAR with pixhawk and AC3.1 ?
No. It will be in a future release