New Multiwii Serial Protocol

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: New Multiwii Serial Protocol

Post by Hamburger »

PatrikE wrote:If you adjust the MSP length you need more intelligence on the reciever side.

isn't that the reason for sending the headSerialReply(18);?
The gui expects a preset length and will go nuts if there's missing data.
The easiest way is to send fixed values for unused values.

sure
A alternative is to use a MSP_INIT at the connection who informs the gui what to expect.
In same manner as the checkBoxes.

that information is already being sent at beginning of MSP response via headSerialReply(xx), so nothing needs to be invented here.

It is something that was left undefined when setting up the NewMSProtocol - has an MSP a predefined length every gui can trust ( then headSerialReply() is superfluous; - or is the length determined at runtime depending on available sensors etc. and thus some trailing values could be omitted and the headSerialReply() be adapted on the fly.

Another undefined behaviour is whether all predefined MSPs must be implemented in an MWC or can MWC reply safely saying 'unknown MSP'? Probably only for some MSPs; which?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: New Multiwii Serial Protocol

Post by PatrikE »

Must start with to say The serial communication is nothing i fully understand.
that information is already being sent at beginning of MSP response via headSerialReply(xx), so nothing needs to be invented here.

Tru..
But headSerialReply(xx) only contains the size of the package.
No information about the content.

ex.
headSerialReply(7)
serialize16() XX_Data
serialize32() II_Data
serialize8() YY_Data

If you have a adaptive MSP and and YY_Data is removed from the Package and adjust headSerialReply(7) to 6.
Then it works.

But if you remove II_Data and adjust size to 5 it will not work.
Because the gui oly kow the size but not what to expect and read wrong data from the Package..
The gui need to know what data who's removed.

Another way is to make more MSP's with less data in!
And use 'unknown MSP'. Mwii will only answer on valid calls.
But it will result in a serial.ino that's bigger than miultiwii.ino.

Best would be a smarter headSerialReply that send more info.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: New Multiwii Serial Protocol

Post by Hamburger »

You avoidmany such problems if you only allow to remove data from the end backwards but not from the middle.

agama
Posts: 5
Joined: Fri Feb 22, 2013 3:23 pm
Contact:

Re: New Multiwii Serial Protocol

Post by agama »

Back to the question of the common specification of the protocol.
I start this work. Don't know how it's useful.
If I wrong, correct me.

MSP specification (draft)

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Odp: New Multiwii Serial Protocol

Post by ezio »

agama wrote:Back to the question of the common specification of the protocol.
I start this work. Don't know how it's useful.
If I wrong, correct me.

MSP specification (draft)

Nicely done.
Thanks
Bart

agama
Posts: 5
Joined: Fri Feb 22, 2013 3:23 pm
Contact:

Re: New Multiwii Serial Protocol

Post by agama »


User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: New Multiwii Serial Protocol

Post by Crashpilot1000 »

I think it would be very nice to have a command to start each motor from the gui for maintenance reasons. Imagine a problem with an octocopter with every ESC contact soldered. If you want to do dynamic balancing or find a defective bearing it would be very nice to access every motor with a slider from the gui. One slider would do it with a box to select the motornumber. That's just an idea.
Cheers Rob

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: New Multiwii Serial Protocol

Post by ezio »

Crashpilot1000 wrote:I think it would be very nice to have a command to start each motor from the gui for maintenance reasons. Imagine a problem with an octocopter with every ESC contact soldered. If you want to do dynamic balancing or find a defective bearing it would be very nice to access every motor with a slider from the gui. One slider would do it with a box to select the motornumber. That's just an idea.
Cheers Rob



+1

or possibility to control only one motor from the radio

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: New Multiwii Serial Protocol

Post by ezio »

agama wrote:Next one version

MSP specification (draft)



you know, this is great!
we should have a documentation like this for everything.

Bart

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: New Multiwii Serial Protocol

Post by PatrikE »

or possibility to control only one motor from the radio


It was done in V1.7 for dynamical balancing motors from Gui.
By Jibeer.

Lots of changes have been made in the project since.
But baby it can be updated to support all new boards.

Ps
Read Info.txt
Attachments
DynEq.rar
(31.2 KiB) Downloaded 369 times

Andresc4
Posts: 2
Joined: Fri Mar 29, 2013 9:52 pm

Re: New Multiwii Serial Protocol

Post by Andresc4 »

Hello guys, im kind of newbie on arduino, and i have a few question about the protocol
can anybody show me an example of how to request data from a arduino sketch via rs232 to get the roll/pitch/yaw of the sensors ?
because on the command list i saw the raw data, but i would like to get the data that is isued to draw and move the aircraft 3d model
im tring to do a vr.headset, im usising vvvv but i can handle the rs232 protocol without any problem
viewtopic.php?f=23&t=3321&p=33946#p33946

i just made that post and im really lost here, i dont have much arduino skills at the moment, any help will be appreciated

For example, i have the hardware ready, and the sketch uploaded
i can run the multiwii conf and it works just fine

i woluld like to know how i can get that data from the arduino IDE serial monitor,,, i need to make a connection of 115200 baud, and after that, how i compose the string to request the roll/pitch/yaw angles ?

AmperCZ
Posts: 1
Joined: Sat Apr 20, 2013 2:33 pm

Re: New Multiwii Serial Protocol

Post by AmperCZ »

Maybe I am wrong but after couple of tests on implementation of this - http://armazila.com/MultiwiiSerialProtocol(draft)v02.pdf

I found :

- In 2.1 source code (and also on first page of this thread) is header $M , in doc is M$
- samples are using calculation method where initial crc is 255 so in case of zero lenght is crc calculated as (255 ^ MessageType), but my 2.1 xcopter accept 0^MessageType

I checked it also against https://code.google.com/p/multiwii/sour ... ino?r=1187 and there is also $M and zero based crc.


Bug in PDF ?

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Odp: New Multiwii Serial Protocol

Post by ezio »

Maybe someone could implement a possibility to control gimbal pitch and roll via MSP protocol? I have some crazy ideas :-)

Bart

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: New Multiwii Serial Protocol

Post by Alexinparis »

AmperCZ wrote:Maybe I am wrong but after couple of tests on implementation of this - http://armazila.com/MultiwiiSerialProtocol(draft)v02.pdf

I found :

- In 2.1 source code (and also on first page of this thread) is header $M , in doc is M$
- samples are using calculation method where initial crc is 255 so in case of zero lenght is crc calculated as (255 ^ MessageType), but my 2.1 xcopter accept 0^MessageType

I checked it also against https://code.google.com/p/multiwii/sour ... ino?r=1187 and there is also $M and zero based crc.


Bug in PDF ?


there are apparently some errors in this pdf. (inversion M and $)
initial crc is 0

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Odp: New Multiwii Serial Protocol

Post by Alexinparis »

ezio wrote:Maybe someone could implement a possibility to control gimbal pitch and roll via MSP protocol? I have some crazy ideas :-)

Bart


gimbal can be controlled via AUX channel
so this is normally possible via RCSERIAL and MSP_SET_RAW_RC message, but in this case you have to control the whole 8 channels, not really ideal.
you could maybe adapt MSP_SET_RAW_RC to not update a specific channel is the sent value is 0 for this channel.

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Odp: New Multiwii Serial Protocol

Post by ezio »

Alexinparis wrote:
ezio wrote:Maybe someone could implement a possibility to control gimbal pitch and roll via MSP protocol? I have some crazy ideas :-)

Bart


gimbal can be controlled via AUX channel
so this is normally possible via RCSERIAL and MSP_SET_RAW_RC message, but in this case you have to control the whole 8 channels, not really ideal.
you could maybe adapt MSP_SET_RAW_RC to not update a specific channel is the sent value is 0 for this channel.


Yes I know that I can use RCSERIAL. I tried it but it is no very good. Maybe it will be possible to make MSP command only for control a camera ? Which can overwrite controls from the radio?
My knowledge about multiwii code is minimal so I don't want to mess with it.
Thanks
Bart

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: New Multiwii Serial Protocol

Post by PatrikE »

I would like to add some more flags in MSP_STATUS:

For the Gui to know what functions is enabled in FC.
I have temporarily added some flags to the current struct.

Code: Select all

st.sensor   = ACC|BARO<<1|MAG<<2|GPS<<3|SONAR<<4|DYNBAL<<5|RC_SERIAL<<6|FLAPRNS<<7|FLAP<<8;// Added some extra flags for Gui


A new struct st.functions
Containing information for Gui What to show or not.
Motors Tab should only be visible if DYNBAL is enabled.

Ex info in settings tab about.
Failsafe.
GYRO_SMOOTHING.
SERVO_TILT
SERVO_MIX_TILT

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: New Multiwii Serial Protocol

Post by ezio »

Hi
When you change a protocol stuff could you add some comments to code in Serial.h and MultWiiConf, please ?

I don't want to spend hours trying to find out what something like this means:

Code: Select all

 // MSP_SET_MISC
      payload = new ArrayList<Character>();
     .
     .
      for( i=0;i<4;i++) {int q= (int)(confINF[i].value()); payload.add(char (q % 256) ); payload.add(char (q / 256)  ); }
      int nn= round(confINF[6].value()*10); payload.add(char (nn - ((nn>>8)<<8) )); payload.add(char (nn>>8));     
  ...
      sendRequestMSP(requestMSP(MSP_EEPROM_WRITE));


Perfect for me will be comment like this
//minthrottle int16
//maxthrottle int16
//lifetime int32
etc


Bart

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Odp: New Multiwii Serial Protocol

Post by Alexinparis »

ezio wrote:
Alexinparis wrote:
ezio wrote:Maybe someone could implement a possibility to control gimbal pitch and roll via MSP protocol? I have some crazy ideas :-)

Bart


gimbal can be controlled via AUX channel
so this is normally possible via RCSERIAL and MSP_SET_RAW_RC message, but in this case you have to control the whole 8 channels, not really ideal.
you could maybe adapt MSP_SET_RAW_RC to not update a specific channel is the sent value is 0 for this channel.


Yes I know that I can use RCSERIAL. I tried it but it is no very good. Maybe it will be possible to make MSP command only for control a camera ? Which can overwrite controls from the radio?
My knowledge about multiwii code is minimal so I don't want to mess with it.
Thanks
Bart


It's now possible to control only relevant channels via MSP_SET_RAW_RC.
just set the other to 0 and the rc values for thoses chans will be used from the legacy RX receiver.
example: you want to control gimbal with AUX3 & AUX4, just send 0 / 0 / 0 / 0 / 0 / 0 / AUX3 / AUX4 values via MSP_SET_RAW_RC

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: New Multiwii Serial Protocol

Post by Alexinparis »

PatrikE wrote:I would like to add some more flags in MSP_STATUS:

For the Gui to know what functions is enabled in FC.
I have temporarily added some flags to the current struct.

Code: Select all

st.sensor   = ACC|BARO<<1|MAG<<2|GPS<<3|SONAR<<4|DYNBAL<<5|RC_SERIAL<<6|FLAPRNS<<7|FLAP<<8;// Added some extra flags for Gui


A new struct st.functions
Containing information for Gui What to show or not.
Motors Tab should only be visible if DYNBAL is enabled.

Ex info in settings tab about.
Failsafe.
GYRO_SMOOTHING.
SERVO_TILT
SERVO_MIX_TILT


could you list all the functions you have in mind ?

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Odp: New Multiwii Serial Protocol

Post by ezio »

Alexinparis wrote:
ezio wrote:
Alexinparis wrote:[quote="ezio"]Maybe someone could implement a possibility to control gimbal pitch and roll via MSP protocol? I have some crazy ideas :-)

Bart


gimbal can be controlled via AUX channel
so this is normally possible via RCSERIAL and MSP_SET_RAW_RC message, but in this case you have to control the whole 8 channels, not really ideal.
you could maybe adapt MSP_SET_RAW_RC to not update a specific channel is the sent value is 0 for this channel.


Yes I know that I can use RCSERIAL. I tried it but it is no very good. Maybe it will be possible to make MSP command only for control a camera ? Which can overwrite controls from the radio?
My knowledge about multiwii code is minimal so I don't want to mess with it.
Thanks
Bart


It's now possible to control only relevant channels via MSP_SET_RAW_RC.
just set the other to 0 and the rc values for thoses chans will be used from the legacy RX receiver.
example: you want to control gimbal with AUX3 & AUX4, just send 0 / 0 / 0 / 0 / 0 / 0 / AUX3 / AUX4 values via MSP_SET_RAW_RC[/quote]
Great I will try it.
Is it safe to do it in flight?

cGiesen
Posts: 188
Joined: Wed Jul 18, 2012 7:53 am
Location: Bochum, Germany

Re: New Multiwii Serial Protocol

Post by cGiesen »

Hello,

I see in MSP_IDENT I got Version and MSP_Version
A good idea!
But why is MSP_Version = 0

I aspect perhaps 221 to see thats the new protocol because of the boxes!

Regards
Carsten

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Odp: New Multiwii Serial Protocol

Post by Alexinparis »

ezio wrote:
It's now possible to control only relevant channels via MSP_SET_RAW_RC.
just set the other to 0 and the rc values for thoses chans will be used from the legacy RX receiver.
example: you want to control gimbal with AUX3 & AUX4, just send 0 / 0 / 0 / 0 / 0 / 0 / AUX3 / AUX4 values via MSP_SET_RAW_RC

Great I will try it.
Is it safe to do it in flight?


yes, it should be safe in flight. It’s the purpose ;)
However, the channel value overriding via MSP only lasts around 0.5s.
After this delay, the conventional RC values are used.
So you must refresh MSP_SET_RAW_RC at a higher pace is you want a permanent overriding of specific channels.

cGiesen
Posts: 188
Joined: Wed Jul 18, 2012 7:53 am
Location: Bochum, Germany

Re: New Multiwii Serial Protocol

Post by cGiesen »

@ALEXINPARIS

Is it possible to get an answer please?

cGiesen wrote:Hello,

I see in MSP_IDENT I got Version and MSP_Version
A good idea!
But why is MSP_Version = 0

I aspect perhaps 221 to see thats the new protocol because of the boxes!

Regards
Carsten

agama
Posts: 5
Joined: Fri Feb 22, 2013 3:23 pm
Contact:

Re: New Multiwii Serial Protocol

Post by agama »

Alexinparis wrote:
AmperCZ wrote:Maybe I am wrong but after couple of tests on implementation of this - http://armazila.com/MultiwiiSerialProtocol(draft)v02.pdf

I found :

- In 2.1 source code (and also on first page of this thread) is header $M , in doc is M$
- samples are using calculation method where initial crc is 255 so in case of zero lenght is crc calculated as (255 ^ MessageType), but my 2.1 xcopter accept 0^MessageType

I checked it also against https://code.google.com/p/multiwii/sour ... ino?r=1187 and there is also $M and zero based crc.


Bug in PDF ?


there are apparently some errors in this pdf. (inversion M and $)
initial crc is 0



Thanks AmperCZ, Alexinparis for the comment. Nobody else has seen these errors!!!
It's my fault.
Corrected version: http://armazila.com/sites/default/files/content/download/MultiwiiSerialProtocol(draft)v04.pdf

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: New Multiwii Serial Protocol

Post by Alexinparis »

cGiesen wrote:@ALEXINPARIS

Is it possible to get an answer please?

cGiesen wrote:Hello,

I see in MSP_IDENT I got Version and MSP_Version
A good idea!
But why is MSP_Version = 0

I aspect perhaps 221 to see thats the new protocol because of the boxes!

Regards
Carsten


Hi,

MSP_VERSION has not been used for the moment.
We can update it for the next release if it helps to solve ambiguity.
About multiwii version, everything after 220 should be considered as dev and unstable

mehranpour
Posts: 2
Joined: Sat Feb 16, 2013 10:56 am

Re: New Multiwii Serial Protocol

Post by mehranpour »

I WANT TO impeliment new gui for multiwii with labview can any one say me an example of command to send to arduino?
i have sent :
$M< MSP_ATTITUDE

is it true?

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: New Multiwii Serial Protocol

Post by ezio »

it MultiWii.ino the comment ("// variometer in cm/s") is wrong:

Code: Select all

static struct {
  int16_t angle[2];
  int16_t heading;              // variometer in cm/s
} att;


Bart

Carsten F
Posts: 3
Joined: Thu Jun 13, 2013 7:41 am

Re: New Multiwii Serial Protocol

Post by Carsten F »

Hi Mehranpour,

if you are interested in board communication via LabVIEW, send me a private message. I am sure I have what you want :D

best greetings from Munich,

Carsten

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: New Multiwii Serial Protocol

Post by felixrising »

Hi,

Haydent has prepared a patch which includes a change to MSP, specifically MSP_ANALOG. The patch outputs Amps, not just the product of amps over time (pMeterSum). It would be good if two sets of battery measurement were available over MSP_ANALOG, namely vbat0,vamp0,vpsum0,rssi,vbat1,vmamp1. Or something like that. This would be good so that OSDs like the Rush OSD (minimosd) can consume and present this info to monitor both main and video battery stats without hardware hacks.

Cheers

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: New Multiwii Serial Protocol

Post by haydent »

thanks felix, hamburger gave me some things to check about my changes and directed me here, once that done ill post back here with the results

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: New Multiwii Serial Protocol

Post by Hamburger »

the extended MSP is in r1542

icedfusion
Posts: 12
Joined: Tue Jan 24, 2012 2:18 pm

Re: New Multiwii Serial Protocol

Post by icedfusion »

Hi,

I am trying to write a small win app for myself just to learn. However, I am really struggling to get communication with my board. I know it works as using mulitwiiconf/wingui work fine.

From looking at the protocol and what is happening in the multiwii conf things like reasonably simple.
All I want to get is the raw imu data - so I send the following message:

Code: Select all

ReqBuff[0] = (char)'$'; // 3 byte message header
      ReqBuff[1] = (char)'M';
      ReqBuff[2] = (char)'<';
      ReqBuff[3] = 102;  // 9DOF request


I would then expect to read the serial port and see the response?

As this did not work in my app, I opened up a serial program (Hercules) and tried to send the same data and see if I got a response - just to see if my program was at fault , but I still do not get anything.
I have read through alot of this thread but apart from post 1 there is not much to go on.

Is my simple request created correctly?
Any pointers greatly appreciated.

Cheers

ice.

icedfusion
Posts: 12
Joined: Tue Jan 24, 2012 2:18 pm

Re: New Multiwii Serial Protocol

Post by icedfusion »

Thanks to nicodh, I think i have found my issue.

ice.

dfruehwald
Posts: 26
Joined: Wed Feb 20, 2013 1:08 am

Re: New Multiwii Serial Protocol

Post by dfruehwald »

I was searching all day for this info and then just randomly stumbled on it tonight.

This is cool. I discovered Red Bear Lab makes an Arduino BT 4.0 interface that works with iOS Core Bluetooth without having to jump through the Apple MFI hoops. Kinda hoping either I or some other industrious iPad/iPhone hacker can make an iOS app like the Android one.

scanman
Posts: 74
Joined: Thu Jun 21, 2012 9:26 am
Location: Durban, South Africa
Contact:

Re: New Multiwii Serial Protocol

Post by scanman »

if you want to see whats going on with the msp the easiest thing is to download a serial port monitor program and run it on the serial port that multiwii gui is using to talk to the board you can then see exactly the commands coming and going it saves a lot of time you can also run it when your program is running and you can see the difference between what your program is sending and what multiwii gui is sending and you will often see you are sending crlf or some other character that the board doesnt understand then correct your code and and keep trying till you are sending the correct data most of these serial port monitor programs show you in hex ascii and decimal most of them are free for limited time which is enough to get you going just google serial port monitor program

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: New Multiwii Serial Protocol

Post by haydent »

Hamburger wrote:the extended MSP is in r1542


hope its not too late to squeeze this into 2.3, but here is a patch to add amperage display to the GUI

viewtopic.php?p=42892#p42892

toto99303
Posts: 1
Joined: Tue Dec 16, 2014 12:03 am

Re: New Multiwii Serial Protocol

Post by toto99303 »

Hi guys, I'm trying to write a small communication app with my multiwii board. But information on the protocol is very scattered allover the thread and internet...
Can someone provide me with a valid link to MultiwiiSerialProtocol(draft)v04.pdf document? Above links are invalid :/

Also is there any change in the protocol, because I'm sniffing between multiwii and the gui and I get this:

Written data 24 4d 3c 00 74 74
$M<.tt

Reply
24 4d 3e 4b 74 41 52 4d 3b 41 4e 47 4c 45 3b 48
$M>KtARM;ANGLE;H
4f 52 49 5a 4f 4e 3b 42 41 52 4f 3b 4d 41 47 3b
ORIZON;BARO;MAG;
48 45 41 44 46 52 45 45 3b 48 45 41 44 41 44 4a
HEADFREE;HEADADJ
3b 47 50 53 20 48 4f 4d 45 3b 47 50 53 20 48 4f
;GPS HOME;GPS HO
4c 44 3b 4d 49 53 53 49 4f 4e 3b 4c 41 4e 44 3b
LD;MISSION;LAND;
19 .


How could that request be valid? I'm sending the same request after that as a single command and can't receive anything...
Help is much appreciated.

panji
Posts: 1
Joined: Wed Feb 04, 2015 9:42 am

Re: New Multiwii Serial Protocol

Post by panji »

how to parse the sensor data multiwii ? in com serial arduino

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: New Multiwii Serial Protocol

Post by waltr »

There is basic info on the MSP in the multiwii wiki.
The command table is not up to date therefore you will need to study the source code to get all of the Valid commands and how they are used.

eyalhe
Posts: 2
Joined: Mon Mar 09, 2015 6:33 pm

Re: New Multiwii Serial Protocol

Post by eyalhe »

hey, will I be able to use a raspberry pi to control my FC threw serial protocol (using usb port)? and is there any better guide to all the functions as not everything is clear here, thanks! :)

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: New Multiwii Serial Protocol

Post by waltr »

Unfortunately the only other guide is the source code.

This would be a way to control the FC from an R-Pi. You will need to work out how to use the MSP.
A look at the multiwiconf.exe source code may help.

Luft
Posts: 1
Joined: Fri May 15, 2015 4:42 pm

Re: New Multiwii Serial Protocol

Post by Luft »

Hey everyone. I've used MSP_SET_RAW_RC to great effect in the past... but I'm running into some issues and was wondering if anyone could weigh in on this! I was under the impression that MultiWii keeps the last raw RC values you send it. MultiWii seems to act on every packet I send it, but only for a split second. For example, I will sent it an arm command, and it will arm but the throttle will be high. When I arm and fly it around via transmitter, then send it raw RC commands over serial (high thrust), it will act on the command and seem to "reset" to a different, lower thrust in a split second. I have not experienced this behavior and was wondering if anyone has any idea of what's going on.

Here is a sample arm packet that my code constructs:
Arm: 24 4D 3C 10 C8 DC 05 DC 05 DC 05 E8 03 D0 07 E8 03 E8 03 E8 03 D6
(1500, 1500, 1500, 1000, 2000, 1000, 1000, 1000) with MultiWii being configured to arm when AUX1 = HIGH (2000).

Why would MultiWii not be holding the previous RC values until specified otherwise? I've additionally disabled all failsafes.

Thanks all.

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: New Multiwii Serial Protocol

Post by waltr »

Is there another RC input that is being read and used?

You really need to look at the code. My guess is that it is still reading the RC channel input pins.

User avatar
jaysonragasa
Posts: 53
Joined: Wed Jan 28, 2015 6:40 am
Location: Philippines
Contact:

Re: New Multiwii Serial Protocol

Post by jaysonragasa »

Hi, I about this MSP_SET_RAW_RC. I am also using this with my Windows Phone application to control the multiwii flight with its virtual joystick.

watch here


I am using MultiWii 2.4 by the way.

I made this possible by suppressing all the values coming in from the Rx

Check my code here
https://github.com/Nullstr1ng/MultiWii/ ... Wii/RX.cpp
starting from line 475

The supress_data_from_rx is set using my new MSP called MSP_SUPRESS_DATA_FROM_RX
https://github.com/Nullstr1ng/MultiWii/ ... otocol.cpp line 189 and line 488

if I did not do this, it will have the same issue with @Luft posts
MultiWii seems to act on every packet I send it, but only for a split second

which is true and readRawRC will still dominate the control.

so now that the I was able to suppress the values from Rx,
I can use all 8 channels. that includes 4 AUX

pros:
I can control my quad smoothly using the virtual joystick

cons:
If I lost the BT signal, I will not be able to gain my control back even if using my Tx. I am currently updating my code to make a workaround.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: New Multiwii Serial Protocol

Post by Alexinparis »

Hi,

jaysonragasa wrote:
MultiWii seems to act on every packet I send it, but only for a split second

which is true and readRawRC will still dominate the control.


This is exactly what is expected.
MSP_SET_RAW_RC should be sent nearly the same way as a normal TX flow (20ms), in fact at a pace which is compatible with a full remote control.
1s is clearly not enough.

cons:
If I lost the BT signal, I will not be able to gain my control back even if using my Tx. I am currently updating my code to make a workaround.

That's why in the current implementation, if the MSP_SET_RAW_RC flow is lost more than a second then readRawRC replaces the valid TX signal.
Consider it as a failsafe to still be able to control the multi if UART system has a problem.
Imagine the situation where you loose the BT signal + full throttle + horizon mode

Dave
Posts: 4
Joined: Thu May 07, 2015 6:50 am

Re: New Multiwii Serial Protocol

Post by Dave »

Alexinparis wrote:
kos wrote:typo ?
Alexinparis wrote:
$M<[code][data][checksum]
1 octet '$'
1 octet 'M'
1 octet '<'
1 octet [code]
several octets [data]
1 octet [checksum]


messages are formated like this:
$M>[code][data][checksum]
1 octet '$'
1 octet 'M'
1 octet '>'
1 octet [code]
several octets [data]
1 octet [checksum]



'>' and '<' are human readable .. but the considering other char with a greater hamming distance could help make the error control efficient.

Hi,
No, it's not a typo error ;)

'<' means '<---' means 'multiwii <--- message' (request)
'>' means '--->' means 'multiwii ---> message' (reply)

what do you mean by "other char with a greater hamming distance" ?


I think that it is a typo error. Otherwise does not make sense.

@Alexinparis: can you please check and correct your first post in this thread with the right information?

pihlerm
Posts: 23
Joined: Tue Dec 09, 2014 6:40 pm

Re: New Multiwii Serial Protocol

Post by pihlerm »

Hi, I have a problem with Serial0 (needing reset whilw wingui is connecting).
http://www.multiwii.com/forum/viewtopic.php?f=17&t=6443
Thanks for any info.

cooked
Posts: 1
Joined: Sat May 23, 2015 9:50 pm

Re: New Multiwii Serial Protocol

Post by cooked »

I'm trying to write down few notes relate to MSP to use as a reference while developing a control app.
Please comment and share if you like

http://www.stefanocottafavi.com/msp-the-multiwii-serial-protocol/

cheers,
stef

User avatar
jaysonragasa
Posts: 53
Joined: Wed Jan 28, 2015 6:40 am
Location: Philippines
Contact:

Re: New Multiwii Serial Protocol

Post by jaysonragasa »

Alexinparis wrote:This is exactly what is expected.
MSP_SET_RAW_RC should be sent nearly the same way as a normal TX flow (20ms), in fact at a pace which is compatible with a full remote control.
1s is clearly not enough.


If I do not suppress the signal coming in from Rx, what will happen is whenever I send a values using my virtual joystick, the signal coming in from Rx dominates the response. That means, I have no control over my virtual joystick. That's the reason why I had to suppress it.

Imagine the situation where you loose the BT signal + full throttle + horizon mode


I had thought of that

Post Reply