Gents, I've found a solution for who's having problems with the xBee being corrupted when starting Ardupilot.

Everytime I had to pull of the blue wire to not damage my xBee, but now I found a solution.

I've added a delay command right before the serial initialization serial.begin() in the setup() session of ardupilot.

Looks like that:

void setup() {
#if GPS_PROTOCOL == 0
delay(3000);
Serial.begin(FIFTY_SEVEN_K_BAUD);
#endif
#if GPS_PROTOCOL == 1
delay(3000);
Serial.begin(FIFTY_SEVEN_K_BAUD);
#endif
#if GPS_PROTOCOL == 2
delay(3000);
Serial.begin(THIRTY_EIGHT_K_BAUD);
#endif
#if GPS_PROTOCOL == 3
delay(3000);
Serial.begin(THIRTY_EIGHT_K_BAUD);
#endif
#if GPS_PROTOCOL == 5
delay(3000);
Serial.begin(THIRTY_EIGHT_K_BAUD);
#endif

init_ardupilot();
}

That causes a 3 seconds delay during the initialization, allowing the modem to startup before sending the serial init.

Cheers,
Leonardo

Views: 486

Reply to This

Replies to This Discussion

Chris and All,

I just installed a simple solution to this problem, which negates having to remember to disconnect the xbee every time I power up the AP. I bought a simple SPTD roller switch at Radio shack, wired it to the comm line between the AP Tx, and the xbee Rx. The switch will be located in the access panel where I provide power to the plane and AP. Whenever I remove the hatch the circuit is open, when I button up this hatch, the circuit is closed.The hatch will always be off when starting up the AP, and will remain off until the IMU achieves GPS lock and calibrates. Therefore I will never again have to "brick" an xbee!


Hope this helps anyone who has experienced this frustrating problem! Perhaps soon we will eliminate the problem at it's source, until then........


Keep flying!

Nathaniel

Reply to Discussion

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service