Frsky D4R-II 8 channels receiver with telemetry part 3: testing
I still have a set of DR4II with invert circuit and pixhawk, I pair it up with my jumper T18, and start some testing.
D port is set at serial 2 with 9600 and 3 for serial protocol.
OpenTX has decoded these sensors:
Tmp2 =93, means 9 sat in view, 3D fix, temp1 should be flight mode
https://github.com/moschotto/OpenTX_GPS_Telemetry
does what it should do.
Inav lua deocde, gps correctly, and Hdg, but the RSSI bar seems not correct, and it talks alot, I will setup pixhawk fully and try again.
after setup pixhawk, the flight mode does match inav setting.
the rssi is related to my elevator stick
but the battery voltage and fuel is the same as mission planner
Here is the flight mode for inav: https://github.com/iNavFlight/inav/blob/master/docs/INAV_Modes.pdf
-- Modes: t=text / f=flags for text / w=wave file
local modes = { | |
{ t = "! TELEM !", f = 3 }, | |
{ t = "HORIZON", f = 0, w = "hrznmd" }, | |
{ t = " ANGLE", f = 0, w = "anglmd" }, | |
{ t = " ACRO", f = 0, w = "acromd" }, | |
{ t = " NOT OK ", f = 3 }, | |
{ t = " READY", f = 0, w = "ready" }, | |
{ t = "POS HOLD", f = 0, w = "poshld" }, | |
{ t = "WAYPONT", f = 0, w = "waypt" }, | |
{ t = " MANUAL", f = 0, w = "manmd" }, | |
{ t = " RTH ", f = 3, w = "rtl" }, | |
{ t = "! FAIL !", f = 3, w = "fson" }, | |
{ t = "! THROT !", f = 3 }, | |
{ t = " CRUISE", f = 0, w = "cruzmd" } | |
} |
mode_id = getTelemetryId("Tmp1"),
https://github.com/iNavFlight/OpenTX-Telemetry-Widget/blob/master/src/SCRIPTS/TELEMETRY/iNav.lua
data.mode = getValue(data.mode_id)
https://doc.open-tx.org/opentx-lua-reference-guide/part_iii_-_opentx_lua_api_reference/general_functions/getvalue
where is data.mode processed?
line 211
- Tmp1: Flight mode, sent as an integer: 18 - Manual, 23 - Altitude, 22 - Position, 27 - Mission, 26 - Hold, 28 - Return, 19 - Acro, 24 0 Offboard, 20 - Stabilized, 21 - Rattitude, 25 - Takeoff, 29 - Land, 30 - Follow Me.
- Tmp2: GPS information. Right-most digit is GPS fix type (0 = none, 2 = 2D, 3 = 3D). Other digits are number of satellites.
from http://shipow.github.io/cleanflight-web/docs/telemetry.html
Tmp1 : actual flight mode, sent as 4 digits. Number is sent as (1)1234. Please ignore the leading 1, it is just there to ensure the number as always 5 digits (the 1 + 4 digits of actual data) the numbers are aditives (for example, if first digit after the leading 1 is 6, it means GPS Home and Headfree are both active) :
- 1 is GPS Hold, 2 is GPS Home, 4 is Headfree
- 1 is mag enabled, 2 is baro enabled, 4 is sonar enabled
- 1 is angle, 2 is horizon, 4 is passthrough
- 1 is ok to arm, 2 is arming is prevented, 4 is armed
For arduplane flight modes:
Mode | Roll | Pitch | Throttle | GPS | Need TX | Summary |
---|---|---|---|---|---|---|
MANUAL | - | - | - | Y | Manual control surface movement, passthrough | |
FBWA | s | s | - | Y | Roll and pitch follow stick input, up to set limits | |
FBWB | s | A | SPD | Y | Y | like FBWA, but with automatic height and speed control |
CRUISE | A | A | SPD | Y | Y | like FBWB, but with ground course tracking and terrain following |
STABILIZE | + | + | - | Y | Wing-leveling on stick release | |
AUTOTUNE | s | s | - | Y | like FBWA, but learns attitude tuning while flying | |
TRAINING | + | + | - | Y | Manual control up to roll and pitch limits | |
ACRO | + | + | - | Y | rate controlled mode with no attitude limits | |
Q(Copter Modes) | s | s | A | Y | Y | Varies depending on mode. See quadplane documentation |
AUTO | A | A | A | Y | Follows Mission | |
LOITER | A | A | A | Y | Circles point where mode switched | |
CIRCLE | A | A | A | Gently turns aircraft | ||
GUIDED | A | A | A | Y | Circles user defined point from GCS | |
Return To Launch (RTL) | A | A | A | Y | Returns to and circles home or rally point | |
LAND (AUTO) | A | A | A | Y | Final part of automatic mission for touchdown | |
THERMAL | A | A | A | Y | Mode entered to search for thermal lift by SOARING feature or manually if lift is encountered. |
Symbol | Definition |
---|---|
- | Full manual control of flight surfaces |
+ | Manual control with stabilized limits or assistance |
s | Stabilized control with limits |
A | Automatic control |
SPD | Controls speed |
1. modify inav script on the flight mode and RSSI stuff(some times it's correct, some times not)
2. take examples from the fly sky rx demo or gps lua and modify to what i need.
Now, to find out what is my Dport send out when change flight mode with arduplane.
it's clearly not 4 digits.
0:Manual 1:CIRCLE 2:STABILIZE 3:TRAINING 4:ACRO 5:FBWA 6:FBWB 7:CRUISE 8:AUTOTUNE 10:Auto 11:RTL 12:Loiter 13:TAKEOFF 14:AVOID_ADSB 15:Guided 17:QSTABILIZE 18:QHOVER 19:QLOITER 20:QLAND 21:QRTL 22:QAUTOTUNE 23:QACRO 24:THERMAL 25:Loiter to QLand |
checking with my openTX and mission planner, in openTX RTL and auto are decoded the same as 11....this is not going to work....
留言
張貼留言