Need help understanding how to communicate via MSP

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download

Need help understanding how to communicate via MSP

Postby Puddin » Sun Jun 11, 2017 4:20 pm

I am trying to write some software to work with MultiWii and for the past week I have been attempting to get any sort of response from the FC by sending MSP commands to no avail. I am using a Arduino mega as the FC and can get accurate data output from the MultiWii GUI so I know that it is working as far as that goes. However where I am stumbling is trying to send something to the Arduino myself to get any sort of response. I know I am on the csup of understanding how it works but I am obviously missing something.

I am writing the software in UE4 and have the UE4duino plugin that allows communication to the Arduino. I can load test scripts and communication to the arduino works fine via this method. However once I load MultiWii to the Arduino I am unable to get any sort of response no matter what I feed it. So I went back to the Arduino IDE and opened the serial monitor to see if I can get anything that way. One of the sites I have been using for reference is this one here: http://smokey.odj.me/post/108535162320/ ... -can-track

Now I understand how the MSP message needs to be formatted (<preamble>,<direction>,<size>,<command>,<crc>) but I cannot find a way to send it to the Arduino to get a response back from MultiWii. In that page it gives the binary command that needs to be sent to the Arduino as a test which is:
Code: Select all
00100100 01001101 00111110 00000000 01101101 01101101

However when I paste that into the serial monitor of the arduino IDE I get nothing back. The Rx light blinks but no Tx. I also wrote a script in UE4 to send the data one octet at a time to no avail. Plenty of Rx blinks but no Tx.

At this point I really needed to see the data coming to and from the Arduino so I fired up the GUI and recorded everything coming over the COM port. Here is a snippet of the data:
Code: Select all
[11/06/2017 07:55:05] - Open port COM3 (C:\ProgramData\Oracle\Java\javapath\javaw.exe)
 
[11/06/2017 07:55:06] Written data (COM3)
    24 4d 3c 00 64 64 24 4d 3c 00 74 74 24 4d 3c 00   $M<.dd$M<.tt$M<.
    6f 6f 24 4d 3c 00 70 70 24 4d 3c 00 73 73 24 4d   oo$M<.pp$M<.ss$M
    3c 00 71 71 24 4d 3c 00 72 72                     <.qq$M<.rr       
[11/06/2017 07:55:06] Read data (COM3)
    24 4d 3e 07 64 f0 0b 00 00 00 00 70 e8 24 4d 3e   $M>.dð.....pè$M>
    35 74 41 52 4d 3b 41 4e 47 4c 45 3b 48 4f 52 49   5tARM;ANGLE;HORI
    5a 4f 4e 3b 4d 41 47 3b 47 50 53 20 48 4f 4d 45   ZON;MAG;GPS HOME
    3b 47 50 53 20 48 4f 4c 44 3b 4d 49 53 53 49 4f   ;GPS HOLD;MISSIO
    4e 3b 4c 41 4e 44 3b 19 24 4d 3e 07 6f 5a 41 00   N;LAND;.$M>.oZA.
    00 00 32 00 41 24 4d 3e 1e 70 21 1e 17 21 1e 17   ..2.A$M>.p!..!..
    44 2d 00 40 19 18 0f 00 00 22 0e 35 19 21 53 5a   D-.@.....".5.!SZ
    0a 64 28 ff ff 00 00 00 27 24 4d 3e 08 73 03 05   .d(ÿÿ...'$M>.s..
    06 02 07 08 09 0a 75 24 4d 3e 10 71 00 00 00 00   ......u$M>.q....
    00 00 00 00 00 00 00 00 00 00 00 00 61 24 4d 3e   ............a$M>
    16 72 00 00 7e 04 3a 07 e8 03 00 00 00 00 00 00   .r..~.:.è.......
    00 00 28 00 00 00 00 00 e0                        ..(.....à       
[11/06/2017 07:55:06] Written data (COM3)
    24 4d 3c 00 65 65 24 4d 3c 00 66 66 24 4d 3c 00   $M<.ee$M<.ff$M<.
    67 67 24 4d 3c 00 68 68 24 4d 3c 00 69 69 24 4d   gg$M<.hh$M<.ii$M
    3c 00 fe fe 24 4d 3c 00 6c 6c 24 4d 3c 00 6d 6d   <.þþ$M<.ll$M<.mm
    24 4d 3c 00 6a 6a 24 4d 3c 00 6b 6b 24 4d 3c 00   $M<.jj$M<.kk$M<.
    6e 6e                                             nn               
[11/06/2017 07:55:06] Read data (COM3)
    24 4d 3e 0b 65 f4 0a 00 00 0d 00 00 00 00 00 00   $M>.eô..........
    9d 24 4d 3e 12 66 28 01 df 00 99 01 09 00 00 00   $M>.f(.ß.™.....
    00 00 e3 ff e4 ff ff ff 14 24 4d 3e 10 67 dc 05   ..ãÿäÿÿÿ.$M>.gÜ.
    dc 05 dc 05 dc 05 dc 05 dc 05 dc 05 e8 03 45 24   Ü.Ü.Ü.Ü.Ü.Ü.è.E$
    4d 3e 10 68 e8 03 e8 03 e8 03 e8 03 e8 03 e8 03   M>.hè.è.è.è.è.è.
    e8 03 e8 03 78 24 4d 3e 18 69 dc 05 dc 05 26 08   è.è.x$M>.iÜ.Ü.&.
    dc 05 dc 05 dc 05 dc 05 dc 05 dc 05 dc 05 dc 05   Ü.Ü.Ü.Ü.Ü.Ü.Ü.Ü.
    dc 05 86 24 4d 3e 08 fe 00 00 00 00 00 00 00 00   Ü.†$M>.þ........
    f6 24 4d 3e 06 6c 07 01 a9 ff 90 00 aa 24 4d 3e   ö$M>.l..©ÿ.ª$M>
    06 6d 00 00 00 00 00 00 6b 24 4d 3e 10 6a 00 00   .m......k$M>.j..
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 7a 24   ..............z$
    4d 3e 05 6b 00 00 00 00 00 6e 24 4d 3e 07 6e 00   M>.k.....n$M>.n.
    00 00 00 00 00 00 69                              ......i         
 


Now it is obvious that the data coming to and from is the MSP but it didn't really help in coming any closer to getting any sort of response when I try sending a command myself. Is there anyone at all that can hopefully clarify how I need to send this command to the Arduino so that I can get any sort of response at all? Is using the Arduino IDE serial monitor useless in attempting this? Once I can get this nailed down I will definitely be making a YouTube video explaining exactly how to implement MSP
Puddin
 
Posts: 1
Joined: Fri Jun 09, 2017 12:06 am

Return to Software development

Who is online

Users browsing this forum: No registered users and 2 guests