<p>Not only keyboard, but you can use a joystick as well. Both ArduPilot and Px4 based FCs support such use case. To do so - connect any standard joystick to your PC and install QGroundControll software. It will detect the presence of the joystick and will allow you to use it to control the drone. Take note that the control using RC will be disabled.</p>

<p>Basically, a drone can be flown using any control device (or software) if you can establish a data link between the PC and the drone. As for the data-link, you can use SiK radio or Wi-Fi based solutions.</p>

CC BY-SA 4.0
2020-06-02T14:13:58.057Z
2020-06-02T14:13:58.057Z
jpou
<p>OpenTX can be built from source for your receiver using various compile options which may be useful.</p>

<p>Enabling <code>USB_SERIAL</code> and <code>CLI</code> will allow connection to your pc using a serial connection, which you can use for bidirectional communication.</p>

<p>You will need to add code to the OpenTX firmware to accept commands from the pc, to control the radio. It may be simplest to utilize the trainer variables to control the outputs.</p>

<p>The changes required are:</p>

<p>in <code>cli.cpp</code>, connect the serial to the trainer variables:</p>

<pre><code>int cliSet(const char ** argv)
{
  if (!strcmp(argv[1], "trainer"))
  {
    int thr;
    int chan;
    if ( (toInt(argv, 2, &amp;chan) &gt; 0)
       &amp;&amp;(toInt(argv, 3, &amp;thr) &gt; 0))
    {
        ppmInput[chan] = thr;
        ppmInputValidityTimer = 240;//PPM_IN_VALID_TIMEOUT;
        serialPrint("!");
    }
  }
  ...cliSet continues
}
</code></pre>

<p>in <code>mixer.cpp</code>, enable all trainer channels by default:</p>

<pre><code>// comment out this check
//        &amp;&amp; isFunctionActive(FUNCTION_TRAINER_STICK1+ch)
</code></pre>

<p>in <code>trainer.cpp</code>, clear all trainer signals after timeout:</p>

<pre><code>void checkTrainerSignalWarning()
{
   ...
   else if (!ppmInputValidityTimer &amp;&amp; (ppmInputValidState == PPM_IN_IS_VALID))
   {
      ppmInputValidState = PPM_IN_INVALID;
      AUDIO_TRAINER_LOST();
      memset(ppmInput, 0, sizeof(ppmInput));   //clear all trainer inputs
   }
   ...
 }
</code></pre>

<p>You should then be able to use commands over serial such as:</p>

<pre><code>set trainer 1 500
</code></pre>

<p>to control channel 1 to a value of 500</p>

CC BY-SA 4.0
2020-06-02T01:21:55.360Z
2020-06-02T05:12:03.587Z
2020-06-02T05:12:03.587Z
mr_guy99493
<p>is a standard way to control a physical aircraft by connecting a frsky transmitter to a PC?</p>

<p>I do NOT want to use the transmitter to control a flight Sim etc.</p>

<p>I'd like to write autopilot software myself, and have it running on a PC. Id like to connect the PC to the transmitter, and have it send inputs to the aircraft, and also send telemetry back.</p>

<p>I'd rather not use an ardupilot.</p>

<p>Anyone have a link to details of someone doing this before?</p>

<p>Tldr: can I use a keyboard to control an aircraft with a frsky transmitter? </p>

<opentx>
Control opentx transmitter from pc?
mr_guy99493
# Control opentx transmitter from pc?

(Asked by: username_0 on 2020-06-02)

is a standard way to control a physical aircraft by connecting a frsky transmitter to a PC?

I do NOT want to use the transmitter to control a flight Sim etc.

I'd like to write autopilot software myself, and have it running on a PC. Id like to connect the PC to the transmitter, and have it send inputs to the aircraft, and also send telemetry back.

I'd rather not use an ardupilot.

Anyone have a link to details of someone doing this before?

Tldr: can I use a keyboard to control an aircraft with a frsky transmitter?

**Tags:** opentx


---

## 2 answers

### Answer by username_0 on 2020-06-02. Score: 6 | Accepted answer

OpenTX can be built from source for your receiver using various compile options which may be useful.

Enabling `USB_SERIAL` and `CLI` will allow connection to your pc using a serial connection, which you can use for bidirectional communication.

You will need to add code to the OpenTX firmware to accept commands from the pc, to control the radio. It may be simplest to utilize the trainer variables to control the outputs.

The changes required are:

in `cli.cpp`, connect the serial to the trainer variables:

```
int cliSet(const char ** argv)
{
  if (!strcmp(argv[1], "trainer"))
  {
    int thr;
    int chan;
    if ( (toInt(argv, 2, &chan) > 0)
       &&(toInt(argv, 3, &thr) > 0))
    {
        ppmInput[chan] = thr;
        ppmInputValidityTimer = 240;//PPM_IN_VALID_TIMEOUT;
        serialPrint("!");
    }
  }
  ...cliSet continues
}

```

in `mixer.cpp`, enable all trainer channels by default:

```
// comment out this check
//        && isFunctionActive(FUNCTION_TRAINER_STICK1+ch)

```

in `trainer.cpp`, clear all trainer signals after timeout:

```
void checkTrainerSignalWarning()
{
   ...
   else if (!ppmInputValidityTimer && (ppmInputValidState == PPM_IN_IS_VALID))
   {
      ppmInputValidState = PPM_IN_INVALID;
      AUDIO_TRAINER_LOST();
      memset(ppmInput, 0, sizeof(ppmInput));   //clear all trainer inputs
   }
   ...
 }

```

You should then be able to use commands over serial such as:

```
set trainer 1 500

```

to control channel 1 to a value of 500


---

### Answer by username_1 on 2020-06-02. Score: 1

Not only keyboard, but you can use a joystick as well. Both ArduPilot and Px4 based FCs support such use case. To do so - connect any standard joystick to your PC and install QGroundControll software. It will detect the presence of the joystick and will allow you to use it to control the drone. Take note that the control using RC will be disabled.

Basically, a drone can be flown using any control device (or software) if you can establish a data link between the PC and the drone. As for the data-link, you can use SiK radio or Wi-Fi based solutions.


---

