inav icon indicating copy to clipboard operation
inav copied to clipboard

"sensor lost" with FPort when GPS fix captured

Open lo4wai opened this issue 8 years ago • 18 comments

FPort telemetries are fine before GPS fix (i.e. not enough satellite signal captured) Taranis telemetry screen show "*" in all data except those GPS related, which indicate data is received.

When GPS fix, GPS related fields get "*"s, but others are gone, and taranis reported sensor lost after some period of time. Telemetries other than GPS related data occasionally receive updates, therefore taranis keep shouting "sensor lost"

lo4wai avatar May 11 '18 13:05 lo4wai

Reproduced on the bench. Working on a fix.

fiam avatar May 12 '18 22:05 fiam

@lo4wai seems like not sending a sensor every 3 cycles workarounds the problem. Tested with 4, 5 and 6 too, but anything > 3 still causes some sensor lost alarms on my radio when using an XSR.

fiam avatar May 12 '18 22:05 fiam

@fiam glad to see your work around, I will try to build it when I have time. I have read the code before but can't figure out why the GPS_FIX state will trigger the problem. In fact the problem also occurs occasionally even without GPS_FIX, but with a much lower frequency.

With your fix, I wonder if the problem is related to the baud rate, since FPort is running with 115200 but smart port is 57600.

lo4wai avatar May 14 '18 17:05 lo4wai

Tried the work around and it works! Thanks for the fix.

lo4wai avatar May 17 '18 17:05 lo4wai

I have also the sensor lost massage with GPS fix, must i wait for INAV 2.0 or is there an update earlier?

kev018 avatar May 17 '18 17:05 kev018

My hunch is that the telemetry bandwidth from the RX to the TX doesn’t have a data rate big enough to support sending one sensor packet every 9ms. Before 2.0, the GPS related sensors where only sent once the fix was acquired, so the RX could cope with that because there were some pauses in the FC->RX stream (the slot for the GPS data was reserved but not used). Once a GPS fix was acquired, we started sending a sensor on almost every 9ms cycle and the buffer in the RC eventually got full, causing some of the sensors to be discarded by the RX.

fiam avatar May 17 '18 18:05 fiam

Forgot to mention that using Smarport would send a sensor to the RX from the FC every 22ms, that’s why we didn’t have this problem until we started supporting FPort.

fiam avatar May 17 '18 18:05 fiam

i'm trying to make my own build with this fix in it. I'm github/code rookie.

is this the process? git clone https://github.com/iNavFlight/inav/ cd inav

go to local directory where it downloaded (devtools/inav) navigate to telemetry (devtools\inav\src\main\telemetry) open smartport.c add in the lines of code with a text editor save

back to bash

make TARGET=MATEKF405

i did all that, flashed my new hex and still have sensor lost. Do i need to be in a different dir before i do the make?

thank you for the help, it's been a long week of trying to figure this stuff out.

P-I-Engineer avatar May 18 '18 04:05 P-I-Engineer

i use

git cherry-pick 3625f05 to get the code after cd to inav directory

then build as usual with docker

lo4wai avatar May 18 '18 08:05 lo4wai

I think i got it working, thank you very much.

i did lose gps telemetry for a moment here and there, but i need to test more.

P-I-Engineer avatar May 18 '18 15:05 P-I-Engineer

@P-I-Engineer I don't have any of those receivers. Try editing smartport.c and changing SMARTPORT_REST_PERIOD from 3 to 2.

fiam avatar May 18 '18 15:05 fiam

@lo4wai Which RX did you test with?

fiam avatar May 18 '18 15:05 fiam

i edited my comment before, think it wasn't working because of my lack of github skills.

i just tested with a X4r, i'll try with a r-xsr later this afternoon.

P-I-Engineer avatar May 18 '18 15:05 P-I-Engineer

@fiam I'm using R-XSR With SMARTPORT_REST_PERIOD set to 3, it still report sensor lost occasionally. With 2, no further lost

lo4wai avatar May 20 '18 15:05 lo4wai

@lo4wai Thanks for testing. I'll make a new PR that introduces this workaround only for FPort, since we're effectively reducing the bandwidth of the sensors by 33% I'd rather not add the extra delay for SmartPort too.

fiam avatar May 20 '18 16:05 fiam

i flew today for a 30 minutes, no sensor lost warnings

i'm using SMARTPORT_REST_PERIOD set to 2

P-I-Engineer avatar May 28 '18 04:05 P-I-Engineer

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

stale[bot] avatar Jul 27 '18 05:07 stale[bot]

Automatically closing as inactive.

stale[bot] avatar Aug 10 '18 06:08 stale[bot]