ardupilot uploading data in flight question

i,everyone, i was thinking about use the xbee module to upload the data into the ardupilot board during  flight, such as i can change the waypoint when the aircraft flying. but i use the ardupilot board, the serial port is used by the GPS. is there a way to solve the problem? you guys have any idea or not?

I suppose to build a digital output circuit which is remote control by the groundstation, connect the output pin to one of the digital pin on the ardupilot board. when the output is high, we disable the GPS, which means set the pin7 to LOW, then upload the data you want, if you want get back the GPS, just set the output to low.
so for the programming part we can do that:

Pinmode(n,INPUT);

void setGPSMux(void)
{
#if SHIELD_VERSION < 1 || GPS_PROTOCOL == 3 // GPS_PROTOCOL == 3 -> With IMU always go low.
digitalWrite(7, LOW); //Remove Before Fly Pull Up resistor
    #else
digitalWrite(7, HIGH); //Remove Before Fly Pull Up resistor
#endif
}


void setCommandMux(void)
{
#if SHIELD_VERSION < 1
digitalWrite(7, HIGH); //Remove Before Fly Pull Up resistor
    #else
digitalWrite(7, LOW); //Remove Before Fly Pull Up resistor
#endif
       Serial.available()>0;
       data= Serial.read();
  ....
.....
}
if(digitalRead(n) == HIGH)
{
setCommandMux();
}
else
{
setGPSmux();
}


I just want to know is it a possible way to do that, by the way, i'm not sure which of the digital pin can be used as the digital input pin. so what 's your opinion, can you give me some help or suggestions?

sorry for my bad english, hope you guys can understand what i mean.


regards
St

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    It has been done and no external circuitry is needed.  The basic approach uses the fact that there is time between receipt of gps messages.  After a gps message is received, the mux is switched and the board "listens" for messages from the GCS for a bit, before switching the mux back in anticipation of the next gps message.  The GCS messages must be short and must be rebroadcast several times to insure that one arrives while the drone is "listening" and is received.

  • Chester

    I am also interested. Any info on that ?

    greetings knut

  • Hi Chester,

     

    I'm curious to know if you tried your idea, and if you got results.

     

    greetings,
    JC

This reply was deleted.

Activity