Skip to content

Initial vtx support (IRC Tramp) #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ Here are more details about [how to setup](/docs/setup.md).
| QMC5883 | Yes | Yes | Yes |
| AK8963 | Yes | Yes | Yes |

## Supported VTX devices

| Device | ESP8266 | ESP32 | RP2040 |
|------------------:|--------:|------:|-------:|
| [TBS SmartAudio](/docs/vtx_table_tbs_smartaudio.json) | Yes | Yes | Yes |
| [IRC Tramp](/docs/vtx_table_irc_tramp.json) | Yes | Yes | Yes |

## Issues
You can report issues using Github [tracker](https://github.com/rtlopez/esp-fc/issues)
You can also join to our [Discord Channel](https://discord.gg/jhyPPM5UEH)
Expand Down
105 changes: 105 additions & 0 deletions docs/vtx_table_irc_tramp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"description": "ESPFC VTX Config file for IRC Tramp",
"version": "1.0",
"vtx_table": {
"bands_list": [
{
"name": "BOSCAM_A",
"letter": "A",
"is_factory_band": false,
"frequencies": [
5865,
5845,
5825,
5805,
5785,
5765,
5745,
0
]
},
{
"name": "BOSCAM_B",
"letter": "B",
"is_factory_band": false,
"frequencies": [
5733,
5752,
5771,
5790,
5809,
5828,
5847,
5866
]
},
{
"name": "FATSHARK",
"letter": "F",
"is_factory_band": false,
"frequencies": [
5740,
5760,
5780,
5800,
5820,
5840,
5860,
0
]
},
{
"name": "RACEBAND",
"letter": "R",
"is_factory_band": false,
"frequencies": [
0,
0,
5732,
5769,
5806,
5843,
0,
0
]
},
{
"name": "IMD6",
"letter": "I",
"is_factory_band": false,
"frequencies": [
5732,
5765,
5828,
5840,
5866,
5740,
0,
0
]
}
],
"powerlevels_list": [
{
"value": 25,
"label": "25 "
},
{
"value": 100,
"label": "100 "
},
{
"value": 200,
"label": "200 "
},
{
"value": 400,
"label": "400 "
},
{
"value": 600,
"label": "600 "
}
]
}
}
104 changes: 104 additions & 0 deletions docs/vtx_table_tbs_smartaudio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"description": "ESPFC VTX Config file for SmartAudio 2.0",
"version": "1.0",
"vtx_table": {
"bands_list": [
{
"name": "BOSCAM_A",
"letter": "A",
"is_factory_band": true,
"frequencies": [
5865,
5845,
5825,
5805,
5785,
5765,
5745,
0
]
},
{
"name": "BOSCAM_B",
"letter": "B",
"is_factory_band": true,
"frequencies": [
5733,
5752,
5771,
5790,
5809,
5828,
5847,
5866
]
},
{
"name": "UNKNOWN",
"letter": "U",
"is_factory_band": true,
"frequencies": [
0,
0,
0,
0,
0,
0,
0,
0
]
},
{
"name": "FATSHARK",
"letter": "F",
"is_factory_band": true,
"frequencies": [
5740,
5760,
5780,
5800,
5820,
5840,
5860,
0
]
},
{
"name": "RACEBAND",
"letter": "R",
"is_factory_band": true,
"frequencies": [
0,
0,
5732,
5769,
5806,
5843,
0,
0
]
},
{
"name": "IMD6",
"letter": "I",
"is_factory_band": false,
"frequencies": [
5732,
5765,
5828,
5840,
5866,
5740,
0,
0
]
}
],
"powerlevels_list": [
{
"value": 0,
"label": "25 "
}
]
}
}
21 changes: 10 additions & 11 deletions lib/Espfc/src/Connect/MspProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,29 +1403,29 @@ void MspProcessor::processCommand(MspMessage& m, MspResponse& r, Device::SerialD
r.writeU8(0); // ready
r.writeU8(0); // low power disarm
} else {
r.writeU8(3 /* SMARTAUDIO */); // vtx type unknown
r.writeU8(_model.config.vtx.band); // band
r.writeU8(_model.config.vtx.channel); // channel
r.writeU8(_model.config.vtx.power); // power
r.writeU8(0); // status (looks like 1 means pit mode :shrug:)
r.writeU8(_model.state.vtx.protocol); // vtx type
r.writeU8(_model.config.vtx.band); // band
r.writeU8(_model.config.vtx.channel); // channel
r.writeU8(_model.config.vtx.power); // power
r.writeU8(0); // status (1 indicates pit mode)
r.writeU16(0); // freq
r.writeU8(1); // ready
r.writeU8(_model.config.vtx.lowPowerDisarm); // low power disarm
r.writeU8(_model.config.vtx.lowPowerDisarm); // low power disarm
}
// 1.42
// API version 1.42
r.writeU16(0); // pit mode freq
r.writeU8(0); // vtx table available (no)
r.writeU8(0); // vtx table bands
r.writeU8(0); // vtx table channels
r.writeU8(0); // vtx power levels
break;

case MSP_SET_VTX_CONFIG:
{
uint16_t freq = m.readU16();
if (freq <= VTXCOMMON_MSP_BANDCHAN_CHKVAL) { // Value is band and channel
//const uint8_t newBand = (freq / 8) + 1;
//const uint8_t newChannel = (freq % 8) + 1;
// const uint8_t newBand = (freq / 8) + 1;
// const uint8_t newChannel = (freq % 8) + 1;
}

if (m.remain() >= 2) {
Expand Down Expand Up @@ -1453,7 +1453,6 @@ void MspProcessor::processCommand(MspMessage& m, MspResponse& r, Device::SerialD
}
break;


case MSP_SET_ARMING_DISABLED:
{
const uint8_t cmd = m.readU8();
Expand Down
104 changes: 0 additions & 104 deletions lib/Espfc/src/Connect/Vtx.cpp

This file was deleted.

Loading