[PATCH] Increase number of AUX channels

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: [PATCH] Increase number of AUX channels

Post by Alexinparis »

Tommie wrote:
Alexinparis wrote:For each item, you just have to select the right number of 8bit var needed and order bits in this order (n AUX, m states): AUX1.1 AUX1.2 ... AUX1.m AUX2.1 ... AUX2.m ... AUXn.m.
With the message AUX_COUNT, the aware GUIs will know what to interpret, and the unaware GUIs won't see the difference.

Actually, they will. I thought about such a layout, but it fails once have a different number of states:

Code: Select all

[AUX.STATE]
4*3 states:
[0.0] [0.1] [0.2] [1.0] [1.1] [1.2] [2.0] [2.1]...

4*4 states:
[0.0] [0.1] [0.2] [0.3] [1.0] [1.1] [1.2] [1.3]...

Without knowing the proper number of state and channels, the unaware GUI has no chance to notice the misalignment. The existing code resorts to ignoring requests of unaware GUIs if they cannot be fullfilled (channels != 4, states != 3); if both type of GUIs use the same request, the firmware cannot distinguish the two and can just hope for the best.


I consider an unaware GUI must be used only with the 4x3 states, no other combination.
The aware GUIs must rely on the MSP_AUX_COUNT first to know how to interpret the message.

This way, every GUI are happy with MSP_BOX messages.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Increase number of AUX channels

Post by Tommie »

Alexinparis wrote:I consider an unaware GUI must be used only with the 4x3 states, no other combination.

This does work. This is what the compatibility code ensures. But the copter has to distinguish aware and unaware clients from each other - e.g. by different request codes (MSP_BOX vs. MSP_AUX). Blindly delivering the data on MSP_BOX will cause mayhem if an unaware clients connects to a copter not using a 4*3 setup.

fiendie
Posts: 151
Joined: Fri Apr 20, 2012 4:22 pm

Re: [PATCH] Increase number of AUX channels

Post by fiendie »

copterrichie wrote:Why not offer an er9x patch for the WiiCopter? Many people have these transmitters and have upgraded to er9x.

I'm working on something for the 9x. But it could take a while.
The codebase of open9x (where most of the development happens nowadays) is almost twice as big as MultiWii's.

First order of business would be to incorporate tommie's binary protocol into the firmware of the 9x. After that your only limit is the flash size.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [PATCH] Increase number of AUX channels

Post by copterrichie »

fiendie wrote:
copterrichie wrote:Why not offer an er9x patch for the WiiCopter? Many people have these transmitters and have upgraded to er9x.

I'm working on something for the 9x. But it could take a while.
The codebase of open9x (where most of the development happens nowadays) is almost twice as big as MultiWii's.

First order of business would be to incorporate tommie's binary protocol into the firmware of the 9x. After that your only limit is the flash size.


That sounds interesting, do you have a link? I would like to follow the progress of your and the 9x developments.

fiendie
Posts: 151
Joined: Fri Apr 20, 2012 4:22 pm

Re: [PATCH] Increase number of AUX channels

Post by fiendie »

copterrichie wrote:That sounds interesting, do you have a link? I would like to follow the progress of your and the 9x developments.

Your one-stop shop for 9x developments is the 9xforums website: http://9xforums.com/forum/viewforum.php ... fbf0d1b73b

As soon I have a little more to show for I will put it on my Github page and let you know ;)

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [PATCH] Increase number of AUX channels

Post by copterrichie »

Awesome and Thank you.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Increase number of AUX channels

Post by Tommie »

Since my patch regarding boxitems (viewtopic.php?f=8&t=2107 using an enum instead of #defines) has been applied (although somewhat changed: http://code.google.com/p/multiwii/source/detail?r=1003), I had to rebase this patchset; it has already been done, please check: https://github.com/wertarbyte/multiwii- ... x_channels

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

Re: [PATCH] Increase number of AUX channels

Post by cGiesen »

Hello Tommie

Tommie wrote:Since my patch regarding boxitems (viewtopic.php?f=8&t=2107 using an enum instead of #defines) has been applied (although somewhat changed: http://code.google.com/p/multiwii/source/detail?r=1003), I had to rebase this patchset; it has already been done, please check: https://github.com/wertarbyte/multiwii- ... x_channels


whats the base of this patch?
I try to implement it to 2.1 but I think the row numbers and the code are different?!?!?!

I want to us 8 AUX because my TX (MX-20) has 12 Channels and I want to test some more switches!

cu
Carsten

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Increase number of AUX channels

Post by Tommie »

cGiesen wrote:Hello Tommie

Tommie wrote:Since my patch regarding boxitems (viewtopic.php?f=8&t=2107 using an enum instead of #defines) has been applied (although somewhat changed: http://code.google.com/p/multiwii/source/detail?r=1003), I had to rebase this patchset; it has already been done, please check: https://github.com/wertarbyte/multiwii- ... x_channels


whats the base of this patch?
I try to implement it to 2.1 but I think the row numbers and the code are different?!?!?!

You should be able to apply the patch to the latest CVS upstream (_shared).
If you want to take the easy road, simply check out the git repository with all changes applied; or you can download the branch with the aux_channel patches applied as ZIP here: https://github.com/wertarbyte/multiwii- ... x_channels
If you have any further questions, feel free to visit us at the IRC channel #multiwii at Freenode.

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

Re: [PATCH] Increase number of AUX channels

Post by cGiesen »

OK, I use your code now. But I didn't see any changes in the GUI.
Or ist the GUI not ready for your patch.

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

Re: [PATCH] Increase number of AUX channels

Post by cGiesen »

One question to the cracks.

I see the variables for holdign the RX information are hard coded, say no array.

Is it ok th use an array to hold the RX values for AUX 1 to X?

Or is it better to say 8 AUX could be really enaugh, lets add the 4 variables AUX5, AUX6, AUX7 and AUX8

Other question:
Where can I find the code where the SUM Signal is readed?
I have an idea, but the code is really strang to read....

Thanks
Carsten

Danal
Posts: 137
Joined: Tue Oct 18, 2011 5:15 pm

Re: [PATCH] Increase number of AUX channels

Post by Danal »

I will be bumping Spektrum Satellite support from 7 channels to 12, very shortly.

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

Re: [PATCH] Increase number of AUX channels

Post by cGiesen »

Good Luck,

I run in problems.
When I use more than 8 channels, the RX results are not stable.
And the HEAD-Line (?) become trouble as whell.

Here is my code. Perhaps some one see my error:

Code: Select all

// Read PPM SUM RX Data
#if defined(SERIAL_SUM_PPM)
  void rxInt() {
    uint16_t now,diff;
    static uint16_t last = 0;
    static uint8_t chan = 0;
 
    now = micros();
    diff = now - last;
    last = now;
    if(diff>3000) chan = 0;
    else {
      #if defined(AUX_CHANNELS)
        if(900<diff && diff<2200 && chan<(AUX_CHANNELS+4)) {   //Only if the signal is between these values it is valid, otherwise the failsafe counter should move up
      #else
        if(900<diff && diff<2200 && chan<8) {   //Only if the signal is between these values it is valid, otherwise the failsafe counter should move up
      #endif
        rcValue[chan] = diff;
        #if defined(FAILSAFE)
          if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0;   // clear FailSafe counter - added by MIS  //incompatible to quadroppm
        #endif
      }
    chan++;
  }

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

Re: [PATCH] Increase number of AUX channels

Post by cGiesen »

Hello,

I'm ready. The Patch is working now.

https://github.com/cGiesen

My work based on Tommies starting.
I only build the enhancmend of the channels. The number of boxes is still tommies job ;)

cu
Carsten

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Increase number of AUX channels

Post by Tommie »

Hm, somehow a lot of stuff got included into your patch, not just the AUX channel improvements. Would you mind joining #multiwii so we can straighten it out a little bit?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Increase number of AUX channels

Post by Tommie »

I tried to replicate the changes you added to my patchset here; I condensed them a little bit, can you check whether all changes are actually included?

https://github.com/wertarbyte/multiwii- ... x_channels

New stuff: https://github.com/wertarbyte/multiwii- ... a490fd47d8

Post Reply