Cannot arm 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
Post Reply
chung2552
Posts: 8
Joined: Mon Jun 30, 2014 9:49 am

Cannot arm via MSP

Post by chung2552 »

I'm trying to arm via MSP(Msp_Set_Raw_RC) on the ubuntu
at first, the data set which i gave to multiwii was $M< 0x10 0xc8 1500 1500 2000 1000 1000 1500 1500 1500 checksum. nothing happened.
next, I read data sets from multiwii while giving arming signal via rc controller. data set was like $M> 0x10 0xc8 1518 1503 2009 1007 1007 1500 1500 1500 checksum.
I copy this data set and gave it to multiwii. but nothing happened.
finally, I gave a data set and got a response from multiwii. response was $M>,0,200. this is right response but nothing happend...

so,does anybody know what would I fix? how can I arm via MSP? Please help me. I open my source code.

Code: Select all

   uint8_t cks=0;
   uint8_t dataTX2[22] ={0x24, 0x4d, 0x3c, 0x10, 0xc8, 0xee, 0x05, 0xdf, 0x05, 0xd9, 0x07, 0xef, 0x03, 0xef, 0x03, 0xdc, 0x05, 0xdc, 0x05, 0xdc, 0x05, cks};
   for(i=3; i<21; i++)
   {
      cks^= dataTX2[i];
   }
   dataTX2[21]=cks;
   printf("cks : %x\n", cks);
   printf("data : ");
   for(i=0; i<22; i++)
   {
      printf("%x ", dataTX2[i]);
   }
   printf("\n");

   length = sizeof(dataTX2)/sizeof(dataTX2[0]);

   for(i=0;i<100000;i++)
   {
   _rc.Write((char *)dataTX2, length);
   }
   printf("data send finished\n");

   uint8_t dataRX[44]={0,};
   int check;

   while(1)
   {
      for(i=0; i<5; i++) dataRX[i]=0;
      _rc.Read((char*)dataRX, 44);
      printf("%d \n", check);
      for(i=0; i<5; i++)
      {
         printf("%x ", dataRX[i]);
      }
      printf("\n");

      _rc.Write((char *)dataTX2, 22);
   }
   
Last edited by chung2552 on Fri Aug 22, 2014 8:08 am, edited 2 times in total.

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Cannot arm via MSP

Post by treym »

it work the same as with a regular tx , you must maintain the stick combo until the required delay is meet (-> start here https://code.google.com/p/multiwii/sour ... ii.cpp#844)

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

Post by ezio »

You have to send MSP_RC quite fast 5-10Hz. It has to be send in continuous way. Any gap between commands which is more then about 0.5s resets the MSP_RC mode. So to arm you have to send commands 10 times per second for a few seconds.

chung2552
Posts: 8
Joined: Mon Jun 30, 2014 9:49 am

Re: Cannot arm via MSP

Post by chung2552 »

to maintain the stick combo, I write "for(i=0; i<10000; i++)" into the source. for more than 2seconds, command is maintained. but frequency... how could I set a frequency to 5-10Hz?

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Cannot arm via MSP

Post by treym »


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

Re: Cannot arm via MSP

Post by ezio »

chung2552 wrote:to maintain the stick combo, I write "for(i=0; i<10000; i++)" into the source. for more than 2seconds, command is maintained. but frequency... how could I set a frequency to 5-10Hz?

Add 100ms delay to the loop

Post Reply