V911S: new sub protocol E119

Model: Eachine E119
Protocol: V911S -> 46
Sub protocol: E119 -> 1
CH5: left button ???
CH6: right button ???
This commit is contained in:
Pascal Langer 2020-02-16 20:05:29 +01:00
parent 4a01e2d472
commit 693f9f58eb
7 changed files with 61 additions and 33 deletions

View File

@ -117,7 +117,7 @@ const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410";
const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_FX816[] = "\x03""P38";
const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 "; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ";
const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH"; const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH";
const char STR_SUBTYPE_V911S[] = "\x04""Std\0""E119"; const char STR_SUBTYPE_V911S[] = "\x05""V911S""E119\0";
const char STR_SUBTYPE_XK[] = "\x04""X450""X420"; const char STR_SUBTYPE_XK[] = "\x04""X450""X420";
const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch"; const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch";
@ -274,7 +274,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_E01X, STR_E01X, 3, STR_SUBTYPE_E01X, OPTION_OPTION }, {PROTO_E01X, STR_E01X, 3, STR_SUBTYPE_E01X, OPTION_OPTION },
#endif #endif
#if defined(V911S_NRF24L01_INO) #if defined(V911S_NRF24L01_INO)
{PROTO_V911S, STR_V911S, 1, STR_SUBTYPE_V911S, OPTION_RFTUNE }, {PROTO_V911S, STR_V911S, 2, STR_SUBTYPE_V911S, OPTION_RFTUNE },
#endif #endif
#if defined(GD00X_NRF24L01_INO) #if defined(GD00X_NRF24L01_INO)
{PROTO_GD00X, STR_GD00X, 2, STR_SUBTYPE_GD00X, OPTION_RFTUNE }, {PROTO_GD00X, STR_GD00X, 2, STR_SUBTYPE_GD00X, OPTION_RFTUNE },

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 67 #define VERSION_PATCH_LEVEL 68
//****************** //******************
// Protocols // Protocols
@ -879,9 +879,6 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
sub_protocol==XK sub_protocol==XK
X450 0 X450 0
X420 1 X420 1
sub_protocol==V911S
V911S_STD 0
V911S_E119 1
sub_protocol==FRSKY_R9 sub_protocol==FRSKY_R9
R9_915 0 R9_915 0
R9_868 1 R9_868 1

View File

@ -30,6 +30,8 @@
// flags going to packet[1] // flags going to packet[1]
#define V911S_FLAG_EXPERT 0x04 #define V911S_FLAG_EXPERT 0x04
#define E119_FLAG_1 0x08
#define E119_FLAG_2 0x40
// flags going to packet[2] // flags going to packet[2]
#define V911S_FLAG_CALIB 0x01 #define V911S_FLAG_CALIB 0x01
@ -56,10 +58,21 @@ static void __attribute__((unused)) V911S_send_packet(uint8_t bind)
} }
if(rf_ch_num&2) if(rf_ch_num&2)
channel=7-channel; channel=7-channel;
XN297L_Hopping(channel);
hopping_frequency_no++;
hopping_frequency_no&=7; // 8 RF channels
packet[ 0]=(rf_ch_num<<3)|channel; packet[ 0]=(rf_ch_num<<3)|channel;
memset(packet+1, 0x00, V911S_PACKET_SIZE - 1);
if(sub_protocol==V911S_STD)
{
packet[ 1]=V911S_FLAG_EXPERT; // short press on left button packet[ 1]=V911S_FLAG_EXPERT; // short press on left button
packet[ 2]=GET_FLAG(CH5_SW,V911S_FLAG_CALIB); // long press on right button packet[ 2]=GET_FLAG(CH5_SW,V911S_FLAG_CALIB); // long press on right button
memset(packet+3, 0x00, V911S_PACKET_SIZE - 3); }
else
packet[ 1]=GET_FLAG(CH5_SW,E119_FLAG_1) // short press on left button
|GET_FLAG(CH6_SW,E119_FLAG_2); // short press on right button
//packet[3..6]=trims TAER signed //packet[3..6]=trims TAER signed
uint16_t ch=convert_channel_16b_limit(THROTTLE ,0,0x7FF); uint16_t ch=convert_channel_16b_limit(THROTTLE ,0,0x7FF);
packet[ 7] = ch; packet[ 7] = ch;
@ -68,24 +81,30 @@ static void __attribute__((unused)) V911S_send_packet(uint8_t bind)
packet[ 8]|= ch<<3; packet[ 8]|= ch<<3;
packet[ 9] = ch>>5; packet[ 9] = ch>>5;
ch=convert_channel_16b_limit(ELEVATOR,0,0x7FF); ch=convert_channel_16b_limit(ELEVATOR,0,0x7FF);
if(sub_protocol==V911S_STD)
{
packet[10] = ch; packet[10] = ch;
packet[11] = ch>>8; packet[11] = ch>>8;
ch=convert_channel_16b_limit(RUDDER ,0x7FF,0); ch=convert_channel_16b_limit(RUDDER ,0x7FF,0);
packet[11]|= ch<<3; packet[11]|= ch<<3;
packet[12] = ch>>5; packet[12] = ch>>5;
} }
else
if (!bind)
{ {
XN297L_Hopping(channel); ch=0x7FF-ch;
hopping_frequency_no++; packet[ 9]|= ch<<6;
hopping_frequency_no&=7; // 8 RF channels packet[10] = ch>>2;
packet[11] = ch>>10;
ch=convert_channel_16b_limit(RUDDER ,0x7FF,0);
packet[11]|= ch<<1;
packet[12] = ch>>7;
}
} }
if(sub_protocol==V911S_STD) if(sub_protocol==V911S_STD)
XN297L_WritePayload(packet, V911S_PACKET_SIZE); XN297L_WritePayload(packet, V911S_PACKET_SIZE);
else else
XN297L_WriteEnhancedPayload(packet, V911S_PACKET_SIZE, bind); XN297L_WriteEnhancedPayload(packet, V911S_PACKET_SIZE, bind?0:1);
XN297L_SetPower(); // Set tx_power XN297L_SetPower(); // Set tx_power
XN297L_SetFreqOffset(); // Set frequency offset XN297L_SetFreqOffset(); // Set frequency offset

View File

@ -84,6 +84,10 @@ static boolean __attribute__((unused)) XN297Dump_process_packet(void)
// init crc // init crc
crc = 0xb5d2; crc = 0xb5d2;
/*debug("P: 71 0F 55 ");
for(uint8_t i=0; i<XN297DUMP_MAX_PACKET_LEN; i++)
debug("%02X ",packet[i]);
debugln("");*/
//Try normal payload //Try normal payload
// address // address
for (uint8_t i = 0; i < address_length; i++) for (uint8_t i = 0; i < address_length; i++)

View File

@ -233,7 +233,7 @@ static void __attribute__((unused)) XN297L_WriteEnhancedPayload(uint8_t* msg, ui
buf[last] ^= xn297_scramble[scramble_index++] & 0xc0; buf[last] ^= xn297_scramble[scramble_index++] & 0xc0;
// crc // crc
if (xn297_crc) //if (xn297_crc)
{ {
uint8_t offset = xn297_addr_len < 4 ? 1 : 0; uint8_t offset = xn297_addr_len < 4 ? 1 : 0;
uint16_t crc = 0xb5d2; uint16_t crc = 0xb5d2;
@ -249,11 +249,9 @@ static void __attribute__((unused)) XN297L_WriteEnhancedPayload(uint8_t* msg, ui
buf[last++] = ((crc >> 8) << 6) | ((crc & 0xff) >> 2); buf[last++] = ((crc >> 8) << 6) | ((crc & 0xff) >> 2);
buf[last++] = (crc & 0xff) << 6; buf[last++] = (crc & 0xff) << 6;
} }
NRF24L01_WritePayload(packet, last);
pid++; pid++;
if(pid>3) pid &= 3;
pid=0;
// stop TX/RX // stop TX/RX
CC2500_Strobe(CC2500_SIDLE); CC2500_Strobe(CC2500_SIDLE);
@ -262,7 +260,7 @@ static void __attribute__((unused)) XN297L_WriteEnhancedPayload(uint8_t* msg, ui
// packet length // packet length
CC2500_WriteReg(CC2500_3F_TXFIFO, last + 3); CC2500_WriteReg(CC2500_3F_TXFIFO, last + 3);
// xn297L preamble // xn297L preamble
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, (uint8_t*)"\x71\x0f\x55", 3); CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, (uint8_t*)"\x71\x0F\x55", 3);
// xn297 packet // xn297 packet
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buf, last); CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buf, last);
// transmit // transmit

View File

@ -139,6 +139,7 @@
//If you have 2 Multi modules which you want to share the same ID so you can use either to control the same RC model //If you have 2 Multi modules which you want to share the same ID so you can use either to control the same RC model
// then you can force the ID to a certain known value using the lines below. // then you can force the ID to a certain known value using the lines below.
//Default is commented, you should uncoment only for test purpose or if you know exactly what you are doing!!! //Default is commented, you should uncoment only for test purpose or if you know exactly what you are doing!!!
//The 8 numbers below can be anything between 0...9 and A..F
//#define FORCE_GLOBAL_ID 0x12345678 //#define FORCE_GLOBAL_ID 0x12345678
//Protocols using the CYRF6936 (DSM, Devo, Walkera...) are using the CYRF ID instead which should prevent duplicated IDs. //Protocols using the CYRF6936 (DSM, Devo, Walkera...) are using the CYRF ID instead which should prevent duplicated IDs.
@ -244,7 +245,7 @@
//Some models (X-Vert, Blade 230S...) require a special value to instant stop the motor(s). //Some models (X-Vert, Blade 230S...) require a special value to instant stop the motor(s).
// You can disable this feature by adding "//" on the line below. You have to specify which channel (14 by default) will be used to kill the throttle channel. // You can disable this feature by adding "//" on the line below. You have to specify which channel (14 by default) will be used to kill the throttle channel.
// If the channel 14 is above -50% the throttle is untouched but if it is between -50% and -100%, the throttle output will be forced between -100% and -150%. // If the channel 14 is above -50% the throttle is untouched but if it is between -50% and -100%, the throttle output will be forced between -100% and -150%.
// For example, a value of -80% applied on channel 15 will instantly kill the motors on the X-Vert. // For example, a value of -80% applied on channel 14 will instantly kill the motors on the X-Vert.
#define DSM_THROTTLE_KILL_CH 14 #define DSM_THROTTLE_KILL_CH 14
//AFHDS2A specific settings //AFHDS2A specific settings

View File

@ -123,7 +123,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[Traxxas](Protocols_Details.md#Traxxas---43)|43|RX6519||||||||CYRF6936| [Traxxas](Protocols_Details.md#Traxxas---43)|43|RX6519||||||||CYRF6936|
[V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|||||||NRF24L01| [V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|||||||NRF24L01|
[V761](Protocols_Details.md#V761---48)|48|V761||||||||NRF24L01|XN297 [V761](Protocols_Details.md#V761---48)|48|V761||||||||NRF24L01|XN297
[V911S](Protocols_Details.md#V911S---46)|46|V911S*||||||||NRF24L01|XN297 [V911S](Protocols_Details.md#V911S---46)|46|V911S*|E119*|||||||NRF24L01|XN297
[WFly](Protocols_Details.md#WFLY---40)|40|WFLY||||||||CYRF6936| [WFly](Protocols_Details.md#WFLY---40)|40|WFLY||||||||CYRF6936|
[WK2x01](Protocols_Details.md#WK2X01---30)|30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936| [WK2x01](Protocols_Details.md#WK2X01---30)|30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936|
[YD717](Protocols_Details.md#YD717---8)|8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01| [YD717](Protocols_Details.md#YD717---8)|8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01|
@ -1306,16 +1306,25 @@ CH1|CH2|CH3|CH4|CH5
Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off
## V911S - *46* ## V911S - *46*
Models: WLtoys V911S, XK A110
This protocol is known to be problematic because it's using the xn297L emulation with a transmission speed of 250kbps therefore it doesn't work very well with every modules, this is an hardware issue with the accuracy of the components. This protocol is known to be problematic because it's using the xn297L emulation with a transmission speed of 250kbps therefore it doesn't work very well with every modules, this is an hardware issue with the accuracy of the components.
If the model does not respond well to inputs or hard to bind, you can try to switch the emulation from the default NRF24L01 RF component to the CC2500 by using an option value (freq tuning) different from 0. Option in this case is used for fine frequency tuning like any CC2500 protocols so check the [Frequency Tuning page](/docs/Frequency_Tuning.md). If the model does not respond well to inputs or hard to bind, you can try to switch the emulation from the default NRF24L01 RF component to the CC2500 by using an option value (freq tuning) different from 0. Option in this case is used for fine frequency tuning like any CC2500 protocols so check the [Frequency Tuning page](/docs/Frequency_Tuning.md).
### Sub_protocol V911S - *0*
Models: WLtoys V911S, XK A110
CH1|CH2|CH3|CH4|CH5 CH1|CH2|CH3|CH4|CH5
---|---|---|---|--- ---|---|---|---|---
A|E|T|R|CALIB A|E|T|R|CALIB
### Sub_protocol E119 - *1*
Models: Eachine E119
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|L_BUT|R_BUT
## YD717 - *8* ## YD717 - *8*
Autobind protocol Autobind protocol