Compare commits

...

4 Commits

Author SHA1 Message Date
pascallanger
05027d3b95 Update Protocols_Details.md 2024-03-14 20:21:41 +01:00
pascallanger
4c0b46549f EazyRC multi IDs/RFs 2024-02-28 10:46:10 +01:00
pascallanger
188f8ff9ce Radiolink/RC4G: IDs and RFs 2024-02-26 17:20:08 +01:00
pascallanger
bee6e59582 Update EazyRC_nrf24l01.ino 2024-02-24 09:38:42 +01:00
3 changed files with 45 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ Multiprotocol is distributed in the hope that it will be useful,
#include "iface_xn297.h" #include "iface_xn297.h"
#define FORCE_EAZYRC_ORIGINAL_ID //#define FORCE_EAZYRC_ORIGINAL_ID
#define EAZYRC_PAYLOAD_SIZE 10 #define EAZYRC_PAYLOAD_SIZE 10
#define EAZYRC_RF_NUM_CHANNELS 4 #define EAZYRC_RF_NUM_CHANNELS 4
@@ -40,13 +40,13 @@ static void __attribute__((unused)) EAZYRC_send_packet()
// packet[0]=THR, packet[1]=ST, packet[2]=unk, packet[3]=unk, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8]) // packet[0]=THR, packet[1]=ST, packet[2]=unk, packet[3]=unk, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
//Bound : C=18 S=Y A= AA BB CC DD EE P(10)= 1A A0 01 41 AD 01 1E 00 79 41 //Bound : C=18 S=Y A= AA BB CC DD EE P(10)= 1A A0 01 41 AD 01 1E 00 79 41
// packet[0..2]=tx_addr, packet[3..5]=rx_addr, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8]) // packet[0..2]=tx_addr, packet[3..5]=rx_addr, packet[6]=first rf channel, packet[8]=unk, packet[9]=sum(packet[0..8])
// sent every 12 packets in normal mode // sent every 12 packets in normal mode, but is it really needed if the car loose power then you need to rebind...
//Packet period around 5ms with a large jitter //Packet period around 5ms with a large jitter
memset(&packet[3], 0x00, 7);
if(IS_BIND_IN_PROGRESS) if(IS_BIND_IN_PROGRESS)
{ {
memcpy(&packet,rx_tx_addr,3); memcpy(&packet,rx_tx_addr,3);
memset(&packet[3], 0x00, 7);
packet[6] = hopping_frequency[0]; packet[6] = hopping_frequency[0];
packet[8] = 0x78; //??? packet type? packet[8] = 0x78; //??? packet type?
} }
@@ -60,7 +60,6 @@ static void __attribute__((unused)) EAZYRC_send_packet()
packet[1] = convert_channel_8b(AILERON); packet[1] = convert_channel_8b(AILERON);
packet[2] = 0x1F; //??? additional channel? packet[2] = 0x1F; //??? additional channel?
packet[3] = 0x19; //??? additional channel? packet[3] = 0x19; //??? additional channel?
memset(&packet[4], 0x00, 6);
packet[6] = hopping_frequency[0]; packet[6] = hopping_frequency[0];
packet[8] = 0xAB; //??? packet type? packet[8] = 0xAB; //??? packet type?
} }
@@ -80,7 +79,7 @@ static void __attribute__((unused)) EAZYRC_send_packet()
static void __attribute__((unused)) EAZYRC_initialize_txid() static void __attribute__((unused)) EAZYRC_initialize_txid()
{ {
rx_tx_addr[1] = rx_tx_addr[3]; rx_tx_addr[1] = rx_tx_addr[3];
hopping_frequency[0] = (rx_tx_addr[3]%0x1F) + 0x1E; // Wild guess... hopping_frequency[0] = (rx_tx_addr[3]%20) + 0x1E; // Wild guess... First channel between 30 and 49so a full range of 30 to 79
#ifdef FORCE_EAZYRC_ORIGINAL_ID #ifdef FORCE_EAZYRC_ORIGINAL_ID
rx_tx_addr[0] = 0x1A; rx_tx_addr[0] = 0x1A;
rx_tx_addr[1] = 0xA0; rx_tx_addr[1] = 0xA0;

View File

@@ -22,7 +22,7 @@
//#define RLINK_DEBUG_TELEM //#define RLINK_DEBUG_TELEM
//#define RLINK_FORCE_ID //#define RLINK_FORCE_ID
#define RLINK_RC4G_FORCE_ID //#define RLINK_RC4G_FORCE_ID
#define RLINK_TX_PACKET_LEN 33 #define RLINK_TX_PACKET_LEN 33
#define RLINK_RX_PACKET_LEN 15 #define RLINK_RX_PACKET_LEN 15
@@ -120,11 +120,44 @@ static void __attribute__((unused)) RLINK_TXID_init()
if(sub_protocol!=RLINK_RC4G) if(sub_protocol!=RLINK_RC4G)
RLINK_hop(); RLINK_hop();
else else
{ {//RLINK_RC4G
// Find 2 unused channels // Find 2 unused channels
// first channel is a multiple of 3 between 00 and 5D // first channel is a multiple of 3 between 00 and 5D
// second channel is a multiple of 3 between 63 and BD // second channel is a multiple of 3 between 63 and BD
//TODO: find 2 unused channels CC2500_Strobe(CC2500_SIDLE);
CC2500_WriteReg(CC2500_17_MCSM1,0x3C);
CC2500_Strobe(CC2500_SFRX);
CC2500_SetTxRxMode(RX_EN);
CC2500_Strobe(CC2500_SRX);
delayMilliseconds(1); //wait for RX mode
uint16_t val;
uint8_t val_low = 0xFF;
hopping_frequency[0] = 0x00;
hopping_frequency[1] = 0x63;
for(uint8_t ch=0; ch<=0xBD; ch+=3)
{
if(ch==0x63)
val_low = 0xFF; //init for second block
if(ch==0x60)
continue; //skip channel
CC2500_WriteReg(CC2500_0A_CHANNR, ch); //switch channel
delayMicroseconds(370); //wait to read
val = 0;
for(uint8_t i=0;i<16;i++)
val += CC2500_ReadReg(CC2500_34_RSSI | CC2500_READ_BURST);
val >>= 4;
debug("C:%02X RSSI:%02X",ch,val);
if(val_low > val)
{
debug(" OK");
val_low = val;
hopping_frequency[ch<0x63?0:1]=ch; //save best channel
}
debugln("");
}
CC2500_WriteReg(CC2500_17_MCSM1,0x30);
CC2500_Strobe(CC2500_SIDLE);
CC2500_SetTxRxMode(TX_EN);
#ifdef RLINK_RC4G_FORCE_ID #ifdef RLINK_RC4G_FORCE_ID
hopping_frequency[0] = 0x03; hopping_frequency[0] = 0x03;
hopping_frequency[1] = 0x6F; hopping_frequency[1] = 0x6F;
@@ -293,7 +326,7 @@ static void __attribute__((unused)) RLINK_RC4G_send_packet()
#ifdef RLINK_DEBUG #ifdef RLINK_DEBUG
debug("P="); debug("P=");
for(uint8_t i=1;i<16;i++) for(uint8_t i=1;i<16;i++)
debug(" 0x%02X",packet[i]); debug(" 0x%02X",packet[i]);
debugln(""); debugln("");
#endif #endif
} }
@@ -311,6 +344,8 @@ uint16_t RLINK_callback()
#ifdef MULTI_SYNC #ifdef MULTI_SYNC
telemetry_set_input_sync(RLINK_RC4G_TIMING_PROTO); telemetry_set_input_sync(RLINK_RC4G_TIMING_PROTO);
#endif #endif
CC2500_SetPower();
CC2500_SetFreqOffset();
RLINK_RC4G_send_packet(); RLINK_RC4G_send_packet();
#else #else
SUB_PROTO_INVALID; SUB_PROTO_INVALID;

View File

@@ -1010,7 +1010,7 @@ CH1|CH2|CH3|CH4|CH5|FS_CH1|FS_CH2|FS_CH3|FS_CH4
FS=FailSafe FS=FailSafe
CH5 is driven by CH3 on the original TX, gyro sensibility? CH5 is driven by CH3 on the original TX, gyro sensitivity?
## Futaba - *21* ## Futaba - *21*
Also called SFHSS depending on radio version. Also called SFHSS depending on radio version.
@@ -1951,14 +1951,10 @@ A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
Model: JXD 509 is using Q282 with CH12=Start/Stop motors Model: JXD 509 is using Q282 with CH12=Start/Stop motors
## Realacc - *76* ## Realacc - *76*
Model: Realacc R11 Model: Realacc R11, Eachine E017
Untested protocol, let me know if it works.
Autobind protocol Autobind protocol
### Sub_protocol R11 - *0*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10 CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---|---|---|---|---- ---|---|---|---|---|---|---|---|---|----
A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK A|E|T|R|FLIP|LIGHT|CALIB|HLESS|RTH|UNK