PlayUAV / PlayuavOSD

A Graphical OSD for FPV
http://en.playuav.com
GNU General Public License v3.0
67 stars 60 forks source link

RSSI percentage not working with RC channel selection #24

Closed N-Z-N closed 8 years ago

N-Z-N commented 8 years ago

When selecting RSSI_TYPE other than 0, only Raw data is shown. The MIN and MAX values are not being calculated to display the percentage value.

Changing Raw_Enable to 1 and back to 0, does not change the RSSI value being displayed. So it is stuck in RAW mode.

PS.... This is a very useful feature for EZUHF, and others that use PPM direct to CH for RSSI. Apparently Arducopter won't be implementing this natively into Mavlink until v3.4. So I'm glad PlayUav has this feature passed through. But it just needs to be tweaked.

ghost commented 8 years ago

I have not tested this feature since I don't have a RC that can output RSSI. But from the codes, it should take effects. See line #540 ~ #589 in osdproc.c files. A guy from fpvlab has helped testing this feature and said it worked fine. If you set RSSI_TYPE to 8, it means you should connect the RSSI to channel 8 of FC.

N-Z-N commented 8 years ago

Just took a look at the code...and I think I found the problem. Line 570 never executes because the logic will always be false for raw values. 570 if ((rssiMax - rssiMin) > 0)

The reason is because of this: 567 if (rssiMax > 255) 568 rssiMax = 255

Example. Line 570 "if 255-1000 > 0" This would make it a negative value, therefore the rssi calc to percentage line never executes. Hence the raw value always being displayed, instead of the calced percentage.

Solution. Remove lines 567-568. or change max value to what normally the max raw value would be, around 2000, instead of 255.

ghost commented 8 years ago

Thanks. You are right. This issue has been fixed. Please use the CT to update the latest firmware. PS: firmware version number not changed.