Commit Graph
2690 Commits
Author SHA1 Message Date
Raphael CoefficandRaphael Coeffic fd08975a03 FRSKYA: exact 300 kHz channel steps (#1223)
ACCESS gear hops on 2403.970 MHz + n x 300 kHz. CHANNR's 299.93 kHz
steps put the bind channel (239) 17.5 kHz low, too much on top of the
module's own offset for the narrow filter of the Archer receivers
(an Archer GR8 only registered and bound with a large tune).

The option now goes to FSCTRL0 with 3/64 steps (73.4 Hz) per channel.
Bench: the bind channel within 2 kHz of the register channel (was
-16.5 kHz), hops 0 to +5 kHz. T-Lite AIR: +32 bytes, still fits.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-25 14:52:04 +01:00
pascallanger bbca98d58d LBT Firmware includes FlySky2A 2026-11-25 08:43:13 +01:00
pascallanger 932567e790 Update TFHSS_cc2500.ino 2026-11-25 07:57:42 +01:00
pascallanger c605e49334 FUTABA/TFHSS: fix failsafe 2026-11-25 07:48:14 +01:00
Peter FeerickandClaude Opus 5.5 8120789e0c ci: update actions to Node 24 releases (#1222)
- actions/checkout v4 -> v7
- actions/upload-artifact (and /merge) v4 -> v7, fix stray slash in path
- actions/download-artifact v4 -> v8
- AButler/upload-release-assets v3.0 -> v4.0.0

Clears the Node.js 20 deprecation warnings. arduino/setup-arduino-cli@v2
already resolves to v2.1.0 (node24).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:22:04 +01:00
pascallanger cfa298bf87 FUTABA/T-FHSS channels mapping and naming 2026-11-24 23:17:50 +01:00
pascallanger 9c496d9526 Update TFHSS_cc2500.ino 2026-11-24 21:40:46 +01:00
pascallanger 68a38cd867 FUTABA/TFHSS_SR: Narrow band flags 2026-11-24 19:31:43 +01:00
Raphael CoefficandRaphael Coeffic 367277e0e6 Futaba TFH-SR: narrow-band servos not supported (#1221)
The receiver outputs narrow-band (760 us centre) pulses only on the
channels the transmitter flags as SR channels; the MULTI protocol has no
field for these flags, so all outputs stay in normal pulse mode (#507).

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-23 08:47:42 +01:00
Raphael CoefficandRaphael Coeffic 88d807870d T-FHSS Surface: RX off before the receiver listens again (#1220)
The reply was read just before the next TX packet, so the CC2500 sat in
RX on the next channel from 1.0 ms to 3.0 ms. The R334SBS turns its own
RX back on there ~2.6 ms after the TX packet; with the TX ~60 kHz off
(MT12, #507) the link then broke (3 % replies), fine with the RX phase
skipped or the frequency tuned.

The reply is now read, and the RX turned off, 2.75 ms after the TX
callback (TFHSS_RX_READ, ~170 us after the reply's end, ~200 us before
the receiver's RX). Also removes the ~80 us late TX packet after each
reply.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-22 20:23:22 +01:00
Raphael CoefficandRaphael Coeffic 0972f356aa T18 release: sfc and lbt files in their channel order (#1219)
After the air files the channel order was left at RETA: the sfc and lbt
"aetr" files were built as RETA, and opt_replace AETR TAER then found
nothing, so the "taer" files were RETA too. Back to AETR before each
set, as the 5-in-1 and T-Lite scripts do.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-22 09:30:18 +01:00
Raphael CoefficandRaphael Coeffic 4198c434b5 FrSkyA Lua: no table library (B&W radios) (#1218)
EdgeTX has the Lua table library on color radios only: table.remove()
in sendQueue() stopped the script on a TX12 MkII at its first run
(shown as "syntax error"). The queue is shifted by hand.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-21 22:27:53 +01:00
Raphael CoefficandRaphael Coeffic aa916c2852 FrSkyA and T-FHSS smaller: the 5-in-1 AIR builds fit again (#1217)
* FrSkyA: smaller (no memmove, one setup reply handler)

The 5-in-1 AIR firmwares (T18, T-Lite) were still too large after #1216.
- The S.Port data moved by one byte with a loop: memmove alone pulled
  200 bytes of libc in.
- Register and bind replies through one handler, the mode giving the
  frame type and the channel.
-312 bytes.

* Futaba: T-FHSS smaller in AIR builds, bind power via CC2500_SetPower()

- AIR builds: the Surface key layout, register table and telemetry rate
  limit left out (Surface and SR aren't there since #1216).
- The bind (link) at the normal power through CC2500_SetPower() with
  the bind flag cleared for the call, instead of a copy of it.
-200 bytes in AIR builds.

---------

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-21 16:59:10 +01:00
Raphael CoefficandRaphael Coeffic eea0a0f3c2 Futaba: T-FHSS Surface and SR left out of AIR builds (#1216)
The serial AIR firmware (MULTI_AIR) no longer fit the 128KB STM32 after
T-FHSS and FrSkyA: 476 bytes over. T-FHSS Surface and SR are surface
sub protocols (cars, boats), so AIR builds keep T-FHSS Air only, as DSM
drops DSMR and DSM2_SFC there: FUTABA_init() invalidates TFHSS and
TFHSS_SR, and their code isn't linked. -1060 bytes, AIR now 120224 of
120808.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-21 16:35:17 +01:00
Raphael CoefficandRaphael Coeffic 56c286c379 FrSkyA: 9 S.Port bytes per receiver reply (#1215)
An ACCESS receiver sends one S.Port frame per reply, without its CRC:
7E + 8 bytes, count 9. The count was cut to 8 like a D16 one, so every
frame lost its last byte and never reached the radio (sensors such as
a vario stale or missing; RSSI and RX voltage, from the reply header,
fine). Up to 9 bytes now; proces_sport_data() takes the 8 bytes after
7E and the frame to the radio gets its CRC as before.

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-21 16:31:25 +01:00
Raphael Coeffic 23c95da502 CYRF6936: CYRF_Reset() resets prev_power (DSM's and Devo's reset after a frozen TX: TX_CFG at their init table's power until the requested power changes) (#1205) 2026-11-21 16:11:00 +01:00
Raphael Coeffic b2507527d6 XN297 emu: CRC xorout for unscrambled enhanced mode (#1206)
XN297_WriteEnhancedPayload() and XN297_ReadEnhancedPayload() (outside
XN297Dump builds) started the CRC from 0xB5D2 without the final XOR when
scrambling is off, unlike the normal payloads and XN297Dump, which receives
unscrambled enhanced packets with the xorout. Now TX and RX start from
0xFFFF and end with ~crc ^ (xn297_lfsr >> 14) in all modes, as the normal
payloads do: xn297_lfsr is 0 when scrambling is off.

No protocol uses unscrambled enhanced mode so far; STM32 -48 bytes.
2026-11-21 16:10:14 +01:00
fc6814b705 FrSkyA: FrSky ACCESS on the CC2500 (#1214)
* FrSky X: S.Port frames to the receiver stored at payload[i-start-2]

FrSkyX_seq_sport() (SPORT_SEND) stored the outgoing bytes at
payload[i-start+2], i.e. payload[4] to payload[11] for the 8 bytes of
an LBT packet: up to 4 bytes past each frame's 8-byte payload (into the
next frame's count and payload, past the array for frame 3). The
retransmits sent payload[i] and payload[i-start+2], bytes from beyond
the frame. All three now use payload[i-start-2] (0 to 7).

* FrSkyA: FrSky ACCESS on the CC2500

New protocol 112, subtypes 16ch, 8ch (FCC) and EU16ch, EU8ch (only the
region flag differs: ACCESS uses the same channels, hops and timing in
both). Reversed from the ISRM and RX6R firmwares and captures of an X9
Lite with an RX6R; same CC2500 PHY as Mike's UNI ACCESS.

- register (channel 0) and bind (channel 239) in the same bind
- 16 or 8 channels every 7 ms, D16 channel packing, extended limits
- failsafe: one channel per frame in its slot, as the ISRM
- telemetry: RSSI / RxBatt and the S.Port stream as D16, S.Port packets
  from the radio sent to the receiver (SportQueue(), split out of the
  serial input for FrSkyX/X2/R9)
- receiver settings and hardware info (PXX2 messages 5 and 6) between
  the receiver and a Lua script, MULTI telemetry type 18 ("Pipe") and
  serial frames of 2 to 7 extra bytes
- not on the atmega328p nor in the 64KB CC2500 release (size)

Tested with an RX6R (ACCESS 2.1.8) and an Archer Plus SR10+ (1.0.10,
3.0.3): bind, channels, failsafe (S.Bus output), telemetry, receiver
settings and the SR10+ stabilizer settings over S.Port.

Needs FrSkyX_seq_sport() fixed (#1203): its resends overflowed and
froze the hopping at the first S.Port packet.

* Lua: FrSky ACCESS RX, receiver options for FrSkyA

The receiver options page of an ACCESS module for a receiver bound
with FrSkyA: name and versions, fast PWM, telemetry and 25mW,
S.Port/F.Port/F.Port2, S.Bus 24, PWM on CH5/CH6, the channel or port
mode of each output. Rows follow the capabilities the receiver
reports. Uses the Multi Lua pipe (multiBuffer "Pipe").

* FrSkyA Lua: receiver IDs 81 to 85

Names for the newer ACCESS receivers (SR6BL15A, SR6Lite, R6Lite,
RS-Lite, R2SIM), so an R6Lite shows by name instead of "ID 83".

---------

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: pascallanger <pascal_langer@yahoo.fr>
2026-11-21 16:07:16 +01:00
Raphael CoefficandRaphael Coeffic 2a13543cdc Futaba: T-FHSS Surface, SR and Air sub protocols (#1213)
* Futaba: T-FHSS Surface, SR and Air sub protocols

New sub protocols of Futaba (21) next to SFHSS, on the CC2500:

- TFHSS: T-FHSS Surface (R334SBS...). 384 kbps MSK, 3 ms frames,
  CH1-4 every frame and CH5-8 in turn, bind packets on channel 1,
  failsafe, telemetry.
- TFH-SR: T-FHSS SR, 1.2 ms frames, no telemetry.
- TF-Air: T-FHSS Air (R3008SB...). 128 kbps 2-FSK, 15 ms frames, 16
  channels, link with the receiver's ID, telemetry. No failsafe frames
  (the receiver's own).

From the R334SBS receiver and T18SZ transmitter firmware, checked
against captures of a 4PM Plus (Surface, SR) and a T6K (Air) shared on
issue #507.

Telemetry (FUTABA_FW_TELEMETRY): the link frame (A1 = receiver voltage,
RSSI = its link quality) and a new MULTI_TELEMETRY_FUTABA (0x13) frame
with the S.BUS2 sensor slots as the receiver sends them, for the radio
to decode (Multiprotocol.h).

Tested against a CC2652/CC2755 receiver of the packets, not on real
Futaba receivers yet. Size: +3.0 KB on the STM32 builds, Futaba alone
on the ATmega328p 14.9 KB.

* Futaba: T-FHSS on STM32 only

T-FHSS adds 3.9 KB on the ATmega328p, and the CC2500 release build
(all its CC2500 protocols) no longer fits. FUTABA_TFHSS (Validate.h)
enables the T-FHSS sub protocols on STM32 boards only; on the ATmega
Futaba is S-FHSS alone, as before (same build size as master).

* Futaba: no T-FHSS on the 64KB STM32

The CC2500 64KB release build was 1 KB over with T-FHSS (+3.1 KB).
FUTABA_TFHSS now needs a 128KB STM32 (not MCU_STM32F103C8, as the
surface protocols in Validate.h). All release recipes build: 64KB as
master (53200 bytes), 4-in-1 117940, T18 118856.

* Futaba: T-FHSS bind hops the list and waits for the reply

The R334SBS scans the 16-channel list in its link mode, answers a bind
packet on that channel (type 24 / 25, keyed as its telemetry) and only
stores the bind after packets with byte 1 bit 7. The 4PM Plus sets bit 7
once it has heard the reply and binds 9.1 s without one. So the bind
now hops the list at 3 ms per packet (channel 1 every 48 ms, as
captured), listens on the same channel, then sends 240 packets with
bit 7; 9.6 s at most.

* Futaba: T-FHSS binds at the normal power

The bind (Surface, SR) and the Air link now use the radio's power
setting (low / high, range), not CC2500_BIND_POWER. The R334SBS takes a
bind packet only above about -79 dBm (its RSSI check); at bind power
the packets were 41 dB below the servo frames. The 4PM Plus binds 33 dB
down from a higher level, the T6K links at full power. Checked on the
bench with a 4-in-1 answering as the receiver (Surface and Air).

* Futaba: T-FHSS Air picks slot channels as the T18SZ

Slots 0..5 and 8 carry their own channel or the alternate (ch11..16,
ch10), chosen as the T18SZ does: a channel moved = more than 3 us from
the value last sent, age = frames since sent. Own moved: the alternate
if it moved too and is 2 frames old, or is 64 old. Own still: the
alternate if it moved (unless own is 64 old), else the older one, own
on a tie. Was: the halves in turn, so moving sticks went out every
other frame.

* Futaba: T-FHSS bind reply on the next list channel

The R334SBS hops before it replies to a bind packet, as it does for its
telemetry: the module now listens on the next list channel after each
bind packet, not on the same one. A 4PM Plus bind followed over the
list: no reply on the bind packet's channel, and byte 7 of the bind
packet is the channel it is sent on (the receiver echoes it), not 01.
Bench (4-in-1 answering as the receiver): normal and SR link.

* Futaba: T-FHSS Surface keys with the receiver's ID

The last 4 key bytes of T-FHSS Surface are the receiver's own ID (its
serial number), not a number of the TX: the receiver keeps only the TX
ID from the bind. The module sent its own, so the R334SBS bound but
decoded no servo packet. The ID now comes from the receiver's bind
reply and is stored per RX number (TFHSS_EEPROM_OFFSET 1527, 4 bytes
per model, end 1783). Bench (4-in-1 answering as the receiver with its
own ID): bind, servo packets OK, again after a restart without bind.

* Futaba: T-FHSS Surface reads the reply before the next packet

The reply comes 1.9 ms after the TX packet's start, the read was 2.5 ms
after the callback: on the MPM v2 replies were taken up to 1.5 ms only.
Now the next frame's packet is built, the reply read, then the packet
sent.

* Futaba: S.BUS2 sensors Lua tool

S.BUS2 sensors don't tell their type on the bus: the radio shows each
slot with data (telemetry type 19) as a raw sensor. The tool turns a
slot into a typed sensor the radio decodes (SBS-01T/TE, RPM, voltage,
current), with an ESCape32 preset. Uses model.setSensor() and
model.deleteSensor() when the radio has them (EdgeTX/edgetx#8105),
else setTelemetryValue() with "Discover new sensors" on.

---------

Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2026-11-21 16:04:09 +01:00
Raphael Coeffic 54ad3d26fd SFHSS: failsafe values on the same scale as the channels (#1210)
The F/S words are 0x800 | a signed 10-bit offset from 1520 us in
1.25 us steps (bit 10 ignored), the same unit as the normal data, as
a T14SG sends them. 2571..3571 put the F/S positions at 1.25x the
live range, and past about +-102 % the offset wraps to the other end
of the travel. 2672..3472 matches the live 1020..2020 us.
2026-11-21 16:02:55 +01:00
Raphael Coeffic f41d954224 DSM: the missing ';' after debug("Clone ID=") (DEBUG_BIND builds) (#1204) 2026-11-21 16:02:10 +01:00
Raphael Coeffic 9baaede9f5 FrSky X: S.Port frames to the receiver stored at payload[i-start-2] (#1203)
FrSkyX_seq_sport() (SPORT_SEND) stored the outgoing bytes at
payload[i-start+2], i.e. payload[4] to payload[11] for the 8 bytes of
an LBT packet: up to 4 bytes past each frame's 8-byte payload (into the
next frame's count and payload, past the array for frame 3). The
retransmits sent payload[i] and payload[i-start+2], bytes from beyond
the frame. All three now use payload[i-start-2] (0 to 7).
2026-11-21 16:01:35 +01:00
Raphael Coeffic 3369b9e0a6 DSM: compute the DSMR hop table, drop the 22 IDs (-0.6 KB) (#1200)
* DSM: compute the DSMR hop table (-0.5 KB)

The DSMR hops come from the DSMX generator (inverted ID, same LCG, parity
of id[3], at most 8/7/8 channels per band), drawing over 0x4A channels
instead of 0x49 and shifting every channel up by 1: channels 4..77, bands
4-28/29-52/53-77, and the parity opposite to DSMX. This gives back the 23
channels of the 22 DSMR_ID_FREQ rows, in the same order, each row starting
at another hop (6, 13, 1, 22, ...): the captures did not begin at hop 0.
DSM packets carry no hop index, so the starting point should not matter.

Only the 22 IDs are kept. DSMX and DSM_RX hops are unchanged (2M IDs
compared with the previous code on the host).

* DSM: DSMR uses the CYRF manufacturer ID like DSMX (-152 B)

Now that the DSMR hops are computed from the ID, the 22 hard coded IDs
are not needed anymore: DSMR takes the CYRF manufacturer ID xor RX num
like the other DSM subprotocols, so radios no longer share the same 22
IDs. Models bound with the previous IDs have to be bound again. Clone
stays unavailable in DSMR, and the OrangeRX sop_col fix stays off.
2026-11-21 16:01:09 +01:00
Raphael Coeffic ca86cb0aa3 E010R5: wait for the end of the packet before hopping (#1197)
RF2500_SendPayload() returns once the CYRF6936 buffer is filled, while
the end of the packet is still being sent: changing the channel right
after it corrupted the last packet before each hop (1 in 6, measured).
Wait for TX_IRQ_STATUS TXC first (bounded loop): 100% of the packets
received right, same timing.
2026-11-21 16:00:44 +01:00
goebish 91199e146e Compute xn297 whitening instead of using an hardcoded array (#1201)
* Compute xn297 whitening instead of using an hardcoded array

* Add function to scramble byte for XN297 interface

* Refactor XN297 scrambling logic to use a global LFSR and improve byte generation

* Add technical specification and implementation details for XN297 whitening and CRC
2026-10-25 16:57:07 +01:00
Raphael Coeffic d3293afdab HoTT, XN297 emu: compute the hop and CRC xorout tables (-1.2 KB) (#1199)
* HoTT: compute the hop table from the hop value (-1 KB)

The 16 hop tables are generated from the 16 bit value sent in packet[0..1]:
the C library rand() LCG (low 16 bits: x = x * 0x4E6D + 0x3039) seeded with
it drives forward Fisher-Yates shuffles, first of the order of the 5 bands of
15 channels, then of the channels of each band, hop i being in the band at
position i%5. This gives back the 16 tables bit for bit, and for any seed a
75 channel permutation with the same band structure.

* XN297 emu: compute the CRC xorout instead of the 4 tables

The XN297 CRC is CRC-16/CCITT with init 0xFFFF and xorout 0xFFFF over the
unscrambled address, pcf and payload, sent scrambled. The emulation computes
it from 0xB5D2 over the bits as sent, so the xorout for a CRC over n bits is
CRC(init 0xFFFF^0xB5D2) of n scramble (or zero) bits, xor 0xFFFF, xor the 16
scramble bits at the CRC. The scramble bits come from the LFSR behind
xn297_scramble[] (1110001, then s[i] = s[i-7] ^ s[i-3]), which also covers
the last enhanced entries, past the end of that table. It is the generator
Goebish gave for the scramble sequence in a comment on
https://mcumix.blogspot.com/2016/07/reverse-engineering-24ghz-rf-chip-xn297.html
(seed 0x71, feedback bit 6 ^ bit 2, MSB first).

All the entries of the 4 tables are given back but two: entry 0 (3 byte
address, no payload) was a 0 placeholder, and scrambled entry 1 (3 byte
address, 1 byte payload) was 0x3448 where the formula gives 0xE348.
2026-10-23 12:02:20 +02:00
pascallanger ee984c403d Update DSM_cyrf6936.ino 2026-09-22 11:57:43 -04:00
pascallanger ced6bbc5c8 Update Protocols_Details.md 2026-09-22 11:57:31 -04:00
pascallanger f10fe7bbf0 AFHS2A: 14/17 channels
Switch based on RX number
2026-09-22 11:48:21 -04:00
Frankie Arzu 9691730be6 Fix to support DSM CH16 (#1179) 2026-09-22 16:20:06 +02:00
pascallanger 5353281ed7 Revert DSM timing change 2026-09-22 08:21:08 -04:00
pascallanger 1e65452d68 MoFly: arm on aerobatic flags
Aerobatic flags are sent only:
 - in 6G mode
 - must be released (-100%) before being used
2026-08-21 13:23:57 +02:00
pascallanger 53ecce8a7c XK: fix bind and normal 2026-08-20 20:11:32 +02:00
pascallanger c8d0638b21 Update XK_ccnrf.ino
Fix bind
2026-08-20 14:01:27 +02:00
pascallanger 55a8412cc8 MoFly telemetry try 1 2026-08-19 22:50:05 +02:00
pascallanger 7fadec2d4f Update Protocols_Details.md 2026-08-19 15:12:40 +02:00
pascallanger 0c20c17c7d SGF22/T28: Invert flag
Feature not advertised by the manufacturer
2026-08-19 14:48:42 +02:00
pascallanger d8c3013bf4 MoFly protocol 2026-08-19 12:57:37 +02:00
Haochen2022 b5e140bd23 Fix MoFly sub-protocol mode, rate and aux switch encoding (#1185) 2026-08-18 12:27:08 +02:00
pascallanger 90dcf034ba MoFly try 1 for Rate 2026-08-16 19:10:59 +02:00
pascallanger c223fb17b5 Add Protronik 2026-08-16 16:35:52 +02:00
pascallanger 03921d36b9 Update Validate.h 2026-08-16 16:17:49 +02:00
pascallanger 780b4d9bcb XK/MoFly: New sub protocol 2026-08-16 16:12:11 +02:00
pascallanger d6a969ee28 Update SGF22_nrf24l01.ino 2026-08-16 11:43:27 +02:00
pascallanger 9354abe5fd SGF22/T28: Add features 2026-08-16 11:30:22 +02:00
pascallanger 5984216fbd Update Protocols_Details.md 2026-08-14 14:27:51 +02:00
pascallanger 1fa5452c89 SGF22/T28 new protocol 2026-08-14 14:19:30 +02:00
MRC3742 0f8aceb79f Few updates
Thanks @MRC3742
2026-08-13 20:20:53 +02:00
pascallanger 3bf4ffa764 MT99X/PA18:new try 2026-08-12 11:10:59 +02:00
pascallanger d750e3b303 Update README.md
Fix code status
2026-08-05 01:13:09 +02:00