OpenTx Groundstation ? Was porting OpenTx to Linux.

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
linuxguy
Posts: 2
Joined: Sat Jul 06, 2019 5:41 am
Country: -

OpenTx Groundstation ? Was porting OpenTx to Linux.

Post by linuxguy » Sat Jul 06, 2019 5:59 am

I'm working on a UAV project. We are building a custom ground station. We would like to eliminate the hand held transmitter from our system and replace it with a PC based transmitter, so that the UAV can be flown from the control console.

I'm thinking we could use various USB joysticks and flight controls as the human interface to OpenTX and use an external RF module (Crossfire, FrSky L9R or Jumper JP4in1) as the transmitter, communicating with it via a USB connected Arduino.

I understand that Linux is a very different OS than what OpenTx presently uses. Obviously a completely different hardware layer would need to be created. Obviously Linux is not a real time OS. There is no latency guarantee when running a desktop OS.

Thoughts ?
Last edited by linuxguy on Sat Jul 06, 2019 9:26 am, edited 1 time in total.


User avatar
Kilrah
Posts: 10272
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Porting OpenTx to Linux ?

Post by Kilrah » Sat Jul 06, 2019 8:08 am

It's already there, the OpenTX simulator in companion can take a joystick input, and the outputs are shown in a window... you could just grab onto that.
The simulators are .so with an interface so if you wanted to simplify all you'd need is make your own wrapper for them that provides the inputs and sends the outputs wherever you want them.
The multiprotocol module communicates via serial so you could route the output stream straight to a COM port, and same for telemetry. I had actually started doing that long ago but never finished. This needs a little work since the simu currently doesn't have the module output in the interface.
Crossfire is serial too. The XJT however uses a bastard signal that can't really be done without a hardware timer so for that you'd need an extra step for example with an arduino that takes serial and generates the signal.

linuxguy
Posts: 2
Joined: Sat Jul 06, 2019 5:41 am
Country: -

Re: Porting OpenTx to Linux ?

Post by linuxguy » Sat Jul 06, 2019 9:21 am

Thanks for the reply, Kilrah.

I found the simulator independently this evening and went through the source. It seems to be a great starting point for what I want to do. I haven't used Companion in a while. I knew there was a simulator in it and forgot about it. Now the simulator is a stand alone app ! Good work to the devs for this !

Would you like to share code from your multiprotocol start ?

"Since the simu doesn't have the module output in the interface ?" I'll look into this. I'm probably going to need to add a few extra things back into the project. I'll want the stand alone sim to save all the settings for everything, just like a stand alone transmitter. Reading through OpenTx 2.2 doc, I'm not sure it does that for everything. Not sure it should be called a sim anymore either... maybe I should fork it to a new app and leave the sim app alone ? Maybe call it OpenTX Desktop ? Or OpenTx Groundstation ?

What do you think the latency would be on a lightly loaded PC running Linux ? Joystick to PC via USB. Then the simu app process time. Then USB to Arduino. Then Arduino to multiprotocol module. It won't be quick. Hopefully not too slow. Gaming joysticks should be pretty low latency. I don't need to fly patterns or anything... just take offs and landings, basically.

I'll look in the openTX source for how to drive the multiprotocol module properly for XJT. Thanks for the heads up.

User avatar
Kilrah
Posts: 10272
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Porting OpenTx to Linux ?

Post by Kilrah » Sat Jul 06, 2019 9:35 am

linuxguy wrote:
Sat Jul 06, 2019 9:21 am
Would you like to share code from your multiprotocol start ?
I don't think I have it anymore, the whole reason I never finished it was that I happened to start it just before someone made a major refactoring of the simu so it basically had to be started over.
linuxguy wrote:
Sat Jul 06, 2019 9:21 am
I'll want the stand alone sim to save all the settings for everything, just like a stand alone transmitter.
It does already. Basically you pass the simu a file that is treated like the radio's memory, and a folder that is handled as the SD card. The eeprom file can be edited using companion just like if it was a radio, so you can even run the simu "headless", if you want to make changes you fire up companion, open the file, edit the settings you want, save, then reopen the simu.
linuxguy wrote:
Sat Jul 06, 2019 9:21 am
maybe I should fork it to a new app and leave the sim app alone ? Maybe call it OpenTX Desktop ? Or OpenTx Groundstation ?
Yeah I think a separate app (that could reuse code from companion e.g. for joystick and the standalone simulator app e.g. for file/SD folder selection) with the added I/O settings and handling would make sense. Could be part of the project along the other 2.
linuxguy wrote:
Sat Jul 06, 2019 9:21 am
What do you think the latency would be on a lightly loaded PC running Linux ? Joystick to PC via USB. Then the simu app process time. Then USB to Arduino. Then Arduino to multiprotocol module. It won't be quick.
Probably not a lot. As previously mentioned the arduino would only be needed for an FrSky XJT module, not for multiprotocol or crossfire.

User avatar
MikeB
9x Developer
Posts: 16609
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: OpenTx Groundstation ? Was porting OpenTx to Linux.

Post by MikeB » Sat Jul 06, 2019 10:31 am

As an alternative you could look at erskyTx and eepskye. This already supports sending the control channels out from the simulator over a serial port (SBUS format). erskyTx supports receiving this serial data as a trainer input. To get started you should be able just connect this up with a Tx and get transmitting from the simulator very quickly.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!


User avatar
jhsa
Posts: 19023
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenTx Groundstation ? Was porting OpenTx to Linux.

Post by jhsa » Sat Jul 06, 2019 11:55 am

MikeB wrote:
Sat Jul 06, 2019 10:31 am
As an alternative you could look at erskyTx and eepskye. This already supports sending the control channels out from the simulator over a serial port (SBUS format). erskyTx supports receiving this serial data as a trainer input. To get started you should be able just connect this up with a Tx and get transmitting from the simulator very quickly.

Mike
Mike, still receiving Joystick inputs on Eepskye would be great.. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW


Post Reply

Return to “openTx”