# D2X configuration

The D2X configuration file is available as `/nxpD2X/nxpD2X.conf`

#### Example config

```
[Main]
VideoFunction=TX
VideoInOut=0
TelemetryDevice=/dev/ttymxc3
Interface=wave-raw
Channel=CCH
PowerOutput=12
ChannelNumber=165
Radio=a
Filter=0x88B60
RXAnt=3
MACAddr=04:e5:48:02:09:10
MCS=MK2MCS_R12QAM16
Destination=04:e5:48:02:09:11
EtherType=0x88B6
TTYBaud=57600 
VideoStreamUDP=0
VideoUDP_IP=192.168.42.129
VideoUDP_Port=5000
TelemetryStreamUDP=0
TelemetryUDP_IP=192.168.42.129
TelemetryUDP_Port=14550
MavLinkPosition=0
AutoStartVideo=0
AutoStartTelemetry=1
```

## description

default values in **bold**

### VideoFunction <a href="#videofunction" id="videofunction"></a>

Defines if the board acts as video transmitter into the D2X network or as video receiver.\
The TX sends the video stream from HD camera connected to MIPI CSI port to RX point-2-point.\
The RX outputs recived video data on HDMI port.\
The communication partners are defined via the MAC [destination](#destination) addres.

| **TX** | Board acts as video transmitter |
| ------ | ------------------------------- |
| RX     | Board acts as video receiver    |

### VideoInOut

Defines the video source/output setting

| **0** | Std input/output of application                                                 |
| ----- | ------------------------------------------------------------------------------- |
| 1     | File fifo                                                                       |
| 2     | Uses ip adress and video port that is configured under [VideoUDP](#videoudp_ip) |

### TelemetryDevice <a href="#telemetrydevice" id="telemetrydevice"></a>

Defines the telemetry hardware port. Bidirectional serial.\
Baudrate used on this device is configured via [TTYBaud](#ttybaud).

| **/dev/ttymxc3** | UART4 - D2X board          |
| ---------------- | -------------------------- |
| /dev/ttyGS0      | USB-OTG port               |
| /dev/ttyAMA0     | serial port on RaspberryPi |

### Interface <a href="#interface" id="interface"></a>

| wave-raw |   |
| -------- | - |

### Channel <a href="#channel" id="channel"></a>

| CCH |   |
| --- | - |

### PowerOutput

RF output power in 1/2 dBm.

| 0  | 0 mW - minimum value                                          |
| -- | ------------------------------------------------------------- |
| 24 | 15.8 mW                                                       |
| 28 | 25 mW - maximum allowed EIRP on ISM band                      |
| 46 | 200mW - maximum transmitter output power of uBlox Vera module |

### ChannelNumber <a href="#channelnumber" id="channelnumber"></a>

Defines the frequency channel number.

| **165** | ISM band - see [Frequency usage](https://nxp.gitbook.io/d2x/miscellaneous/frequency-usage) for further details |
| ------- | -------------------------------------------------------------------------------------------------------------- |

### Radio <a href="#radio" id="radio"></a>

| a |   |
| - | - |

### Filter <a href="#filter" id="filter"></a>

| 0x88B60 |   |
| ------- | - |

### RXAnt <a href="#rxant" id="rxant"></a>

| 3 |   |
| - | - |

### MACAddr <a href="#macaddr" id="macaddr"></a>

Own MAC adress.

| 04:e5:48:02:09:10 | own MAC adress in HEX format |
| ----------------- | ---------------------------- |
| 04:e5:48:02:xx:xx | xx=01 to FF                  |

### MCS <a href="#mcs" id="mcs"></a>

Modulation type and related data rate

| MCS setting          | modulation type | data rate |
| -------------------- | --------------- | --------- |
| MKXMCS\_R12BPSK      | 1/2 BPSK        | 3Mb/s     |
| MKXMCS\_R34BPSK      | 3/4 BPSK        | 4.5Mb/s   |
| MKXMCS\_R12QPSK      | 1/2 QPSK        | 6Mb/s     |
| MKXMCS\_R34QPSK      | 3/4 QPSK        | 9Mb/s     |
| **MKXMCS\_R12QAM16** | 1/2 16QAM       | 12Mb/s    |
| MKXMCS\_R34QAM16     | 3/4 16QAM       | 18Mb/s    |
| MKXMCS\_R23QAM64     | 2/3 64QAM       | 24Mb/s    |
| MKXMCS\_R34QAM64     | 3/4 64QAM       | 27Mb/s    |

### Destination <a href="#destination" id="destination"></a>

[MAC adress](#macaddr) of the communication partner for all P2P connections.\
This is used for the video streaming as well as serial telemetry data.

| 04:e5:48:02:09:11 | MAC adress of communication partner in HEX format |
| ----------------- | ------------------------------------------------- |
| 04:e5:48:02:xx:xx | xx=01 to FF                                       |

### EtherType <a href="#ethertype" id="ethertype"></a>

| 0x88B6 |   |
| ------ | - |

### TTYBaud <a href="#ttybaud" id="ttybaud"></a>

Serial baud rate used on [telemetry hardware port](#telemetrydevice).

| 115200 | 115k2 baud |
| ------ | ---------- |
| 57600  | 57k6 baud  |
| 19200  | 19k2 baud  |

### VideoStreamUDP

{% hint style="info" %}
If [VideoInOut](#videoinout) = 2 then VideoStreamUDP needs to be set to 1 or 2.
{% endhint %}

| **0** | no UDP stream output                 |
| ----- | ------------------------------------ |
| 1     | UDP out only                         |
| 2     | UDP out **AND** output to std output |
|       |                                      |

### VideoUDP\_IP

| 192.168.42.129 |   |
| -------------- | - |

### VideoUDP\_Port

| 5000 |   |
| ---- | - |

### TelemetryStreamUDP

| **0** | no telemetry output to IP adress/port                                  |
| ----- | ---------------------------------------------------------------------- |
| 1     | sends/receives telemetry data to/from IP **only**                      |
| 2     | sends/receives telemetry data to/from telemetry device **AND** IP port |

### TelemetryUDP\_IP

| 192.168.42.129 |   |
| -------------- | - |

### TelemetryUDP\_Port

| 14550 |   |
| ----- | - |

### MavLinkPosition

| 0 | disable sending UTM\_GLOBAL\_POSITION broadcast via RF  |
| - | ------------------------------------------------------- |
| 1 | enable sending UTM\_GLOBAL\_POSITION broadcast via RF\* |

{% hint style="info" %}
\* Message is sent in byte format.
{% endhint %}

### AutoStartVideo

| **0** | disable sending video stream |
| ----- | ---------------------------- |
| 1     | enables sending video stream |

### AutoStartTelemetry

| **1** | enables telemetry stream  |
| ----- | ------------------------- |
| 0     | disables telemetry stream |
