Cannot arm via MSP
Posted: Thu Aug 21, 2014 11:15 pm
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.
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);
}