nepeee/TinyHawkFlyskyRx

No telemetry

Opened this issue · 19 comments

Hi there.

One of the people that flashed your custom firmware and I must say I'm impressed by your work. Is just awesome.
I would only dare to ask if possible to add a minimal telemetry so that the TX is also aware of the RX.

As it is now, the TX kinda knows about binding, but after that it acts like there is no RX it is talking to. On my Turnigy i10 remote, the RX icon is with a red mark, like there is no RX.

Is it possible to make the TX knows about RX?

In some custom RX firmwares, like Fli10/Fli10+, the RX is doing a little trick, right after connecting with the TX it is sending for a short time (like half a second), a fake low RSSI signal, so the TX will buzz shortly, so you know both are paired right away.

Just curious, when doing the pairing, how is the TX knowing the RX was paired in code? I looked through the code and didn't find that place. When I put my TX in pairing mode, after the pairing is done, the TX menu for pairing is closing automatically.

Yes i think it's passible, the main problem with the telemetry is the low tx power(range) of the cc25xx. Is the Fli10 fw open source ? I will check the telemetry maybe in the next week.

No, is not open source. Actually I'm not aware of any AFHDS 2A receiver with open source.

Sorry i forgot to answer the pairing question. The binding is handled in the main.c line 176-238. The TX sends pairing packets at a fixed channel(13) wheres the first byte of the payload is 0xBB or 0xBC, byte 2-6 is the TX id, 12-28 is the channel hop table(16 channel number starting from 2400MHz, 500KHz channel spacing). The RX modifies this packet by putting its RX id to byte 7-10 and fills out the remaining bytes with 0xFF (12-38). The RX transmits the modified packet and the whole process is repeated until byte 10 of the received packet is 0x02 indicating that the TX is received the modified packet.

Have you tried to change the RF standard to ADHDS-2A 1-way as its shown in the manual under the section 9.2 RF Std? Also can you do a range test for me to confirm the rx distance?

Sorry for delay, real life issues hit me the whole week.

I'll do more testing and report back.

Thanks for detailed description on the source code for binding. I will study this a bit.

What you mean with "manual under the section 9.2 RF Std". Can you link me with that document/manual?

I had a colleague test the Turnigy i10 power, and the results came back disappointing. A lot of fail-safes... Seems all remotes we own have some issues with the transmitting power.

So RX distance is very low, we can barely move from one room to the other without getting a fail-safe. Even with the TX-RX basically close one to the other the signal strength reported by the OSD is under 85%. But the problem is not with your code I assume. Just mentioning the whole stuff below.

The i10 was able to output less than 20mW of power in peak mode on both antennas. According to EU legislation/HobbyKing specs sheets it should keep under 100mW, but is a huge difference between 20mW and 100mW as they advertise as being the max.

Testing was done with ImmersionRC RF Meter2.

My colleague also tested the Flysky RX x6b, and that tiny fella was able to "scream" at least at 35mW of power with spikes of over 50mW from time to time. Well over the TX power.

50574158_10156055053617644_4235572751609364480_o

I tried with AFHDS 1A and the remote actually hide the RX icon. Also as a side effect, I was able to close the TX without the usual warning, "first shut down the RX".

I think most receivers on AFHDS2A are actually doing some form of telemetry like a continuous ping, and most even sends back the RSSI signal (not to mention others which sends back sensors, voltages, and so on).

The manual:
https://www.horizonhobby.com/pdf/FSY004-Manual.pdf

I don't think that you can measure tx power accurately without a direct connection. Some folks that used these type of power meters (or the directly connected to transmitter types) reported that they are off by 0-50%. Compare your measurements with others that taken with the same power meter.

I have an i6x TX and i can't see any difference between the TinyHawkFlysky and the fs-i6b, fs-ia6, fs-a8s receivers that i own except that the rx voltage and the rssi is not reported back. No errors no warnings, just works. The fail-safes can be a problem also on the rx code side, i only tested it with the i6x, maybe some rf register parameters/timings are on the edge in tolerance. Have you tested the range with the rx that comes with the tx ?

I planned to add a packet loss counter percentage like the rssi on another unused rx channel, i think it can be more accurate than the rssi report. Currently the 100% rssi level is the absolute maximum that the rx chip can report back, with my tx the maximum that i get with it is also about 80-90%.

I've tested the range inhouse with other receivers, and yes, those are a little bit better, like I can get through 2-3 rooms until I get the failsafe. So maybe you are right, the failsafe maybe acts too early on the tinyhawk.

Is it possible to send back the RSSI and voltage (is the voltage for the radio 5V or is 1S VBAT)?
Do you need sample source code for that? I don't know any source code for AFHDS2A receivers, but there are repositories for other transmitters like Devo who do full telemetry from what receivers sends back to them.

I asked somebody to provide me with a i6 remote and I have a friends who also has a turnigy evolution. I can't get another i10 for comparing, but for some reason I believe the measurements were trustworthy, because the x6b receiver also proved to emit at a better power.

It is possible to send back the rssi but the cc2510 transceiver chip only has a maximum of 1dBm(1.25mW) tx power so the range is very limited, maybe 10 meter with direct visibility. The real voltage telemetry is only possible with hardware modding, but a fake value can be used.

For me to create the telemetry functions without an example rx source code, the only options is to sniff the packets (with a custom test code) with the tinyhawk as i done with the normal rc and binding packets.

If it is any help, instead of sniffing packets you could as well check the source code from deviationtx.

https://github.com/DeviationTX/deviation/blob/master/src/protocol/flysky_afhds2a_a7105.c

Thanks, there is the pocket format in line 300, also some binding code that i can check.
The format is: AA | TXID | RXID | sensor id | sensor # | value 16 bit big endian | sensor id ......

I will make some test code tomorrow(I'm in GMT+2 time zone) and create a new branch for this that you can test with the i10.

I added the telemetry transmit code(only dummy data right now) to the RX and it looks like there is not enough time to send telemetry data between the channel hops. We have 3.875ms between the rc packets, the rx code takes 0.964ms(packet decoding ibus communication etc), the channel hopping takes 0.243ms, the tx code takes 1.82ms(about 1.3ms to wait the chip to complete the tx, the remaining is the sw hamming and crc). With the telemetry code in place the rx completely losses the sync, and only 1 of the 16 channels is received. If i replace the transmit code with a maximum of 1.4ms delay the rx keeps the sync with the channel hops.

I don't know why the tx takes so long, with 500k baud the total tx time should be about 0.200-0.300ms.

Fixed the TX so now it outputs like 200mW using a booster.
However, tinyhawk receiver goes into failsafe mode just as easy as before. I also tested with other quads I have and signal strength on those stays solid when I move from room to room.

Regarding the TX, I think I remember some chips had in specs some ways to set fast switching between rx and tx mode. Maybe is something similar with this chip.

I checked my calculations and it looks like the 1.3ms is OK based on the transmit rate.
I will check the rx register configurations to try to fix the range issue this is right now the highest prior for me.

So, you confirm the range is an issue also on your side? I thought there was something wrong with my transmitter.

There is also a bug report related with the range here in OpenSky repo:
fishpepper/OpenSky#20

I don't know what is the original frsky range but i tested it outdoors and i get 80-100m range. I modified some rf parameters and added a continues tx-rx frequency compensation to improve the range. I almost finished with the testing, i upload this version tomorrow to the experimental branch.

The new version is in the experimental branch, i hope it will improve the range for you.