3689709649?profile=originalThis video shows me flying our homebrew "Hackflight Sim" quadcopter flight simulator using a Spektrum DX8 receiver without a cable. The DX8 is talking to a Lemon RX satellite receiver connected to Teensy 3.2 (32-bit Arduino-compatible microcontroller), which connects to my Linux computer over a USB cable, as shown in the image below. A simple Arduino sketch reads the DSM-encoded values from the RX over the Teensy's RX1 (UART input) pin, and converts them to serial messages encoded using Multiwii Serial Protocol (MSP). The simulator parses these messages, converting them into stick demands to fly the simulated MAV.

Consistent with the Hackflight approach of using and re-using inexpensive, open-source hardware and software as much as possible, this hack relies on hardware (Teensy 3.2 micrcontroller, Lemon RX satellite receiver) and software (MSP parser) that we are using onboard our MAVs as well.

3689709697?profile=original

Although it'd be great to get this cable-free hack working with a commercial flight simulator like Phoenix, there is already at least one such solution available commercially.  

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Ooops, sorry about the bad form, Simon.  I was testing the USB output from the MW to my android project.  I shoe horned the example.java into my project and that output is   "+59 +76  +1".  That tells me that byte[] I get is what the parser needs and the parser actually gets it. I probably have more trouble understanding the protocol and any example you cook up can only help me.      

  • @Harry: without seeing your code, I can't make sense of your output.  I'm working on a complete example, should have something for you to look at in a few days.

  • Simon, I have your parser in my project.  I have to learn how to use it.  I printed to system.out what I'm getting from the USB connected MW. 

    01-25 22:52:10.367 3258-3281/? I/System.out: [71] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [72] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [73] -67
    01-25 22:52:10.367 3258-3281/? I/System.out: [74] 36
    01-25 22:52:10.367 3258-3281/? I/System.out: [75] 77
    01-25 22:52:10.367 3258-3281/? I/System.out: [76] 62
    01-25 22:52:10.367 3258-3281/? I/System.out: [77] 16
    01-25 22:52:10.367 3258-3281/? I/System.out: [78] 104
    01-25 22:52:10.367 3258-3281/? I/System.out: [79] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [80] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [81] -67
    01-25 22:52:10.367 3258-3281/? I/System.out: [82] 3
    01-25 22:52:10.367 3258-3281/? I/System.out: [83] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [84] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [85] -67
    01-25 22:52:10.367 3258-3281/? I/System.out: [86] 3
    01-25 22:52:10.367 3258-3281/? I/System.out: [87] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [88] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [89] -67
    01-25 22:52:10.367 3258-3281/? I/System.out: [90] 3
    01-25 22:52:10.367 3258-3281/? I/System.out: [91] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [92] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [93] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [94] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [95] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [96] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [97] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [98] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [99] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [100] 0
    01-25 22:52:10.367 3258-3281/? I/System.out: [101] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [102] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [103] -67
    01-25 22:52:10.367 3258-3281/? I/System.out: [104] 36
    01-25 22:52:10.367 3258-3281/? I/System.out: [105] 77
    01-25 22:52:10.367 3258-3281/? I/System.out: [106] 62
    01-25 22:52:10.367 3258-3281/? I/System.out: [107] 16
    01-25 22:52:10.367 3258-3281/? I/System.out: [108] 106
    01-25 22:52:10.367 3258-3281/? I/System.out: [109] 1
    01-25 22:52:10.367 3258-3281/? I/System.out: [110] 6
    01-25 22:52:10.367 3258-3281/? I/System.out: [111] 70
    01-25 22:52:10.367 3258-3281/? I/System.out: [112] -17
    01-25 22:52:10.367 3258-3281/? I/System.out: [113] -65
    01-25 22:52:10.367 3258-3281/? I/System.out: [114] -67

    I guess I just need to follow the example.java to extract useful data like attitude?

  • OK, thanks Simon!  I read the readme on the tool and I see it will make a .jar of the parser.  That might be enough for me to just add the .jar as a library in android studio. 

  • @Harry: Thank you! It's also nice to meet a fellow hacker using MSP and Android.  My MSP parser-generator tool can be used to generate Java code, but is currently missing an Android example.  I will work on that this week and hope to have a blog post on it soon.  Stay tuned!

  • Wicked !  You sir, are clever! 

    I'm struggling with MSP.  I can get USB over android(even have some simple apps I built that work)and I have tested if I can Rx the serial coming from my Multiwii.  My current problem is I cant understand why my app wont "parse" the messages.  it just sits there and nothing happens.  My usb driver reads the serial as a byte[] and I convert that to String in my other apps.  With MSP, I get serial as byte after I wrap it like so:

    byte Message = Byte.parseByte(String.valueOf(SerialData));
    c = Message;

    That little c is a mystery to me. Some places its an int, others a byte[] and here a byte.

       

  • Have been using this wireless adapter with Phoenix for years and works very well

    https://hobbyking.com/en_us/wireless-9-in1-simulator-adapter.html

    Wireless 9 in1 Simulator Adapter
    Wireless 9 in1 Simulator Adapter
This reply was deleted.