Jump to content


GCS and Aeroquad

gcs aeroquad

  • Please log in to reply
4 replies to this topic

#1 grantmd

grantmd

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationSan Carlos, CA
  • Country: flag of United States United States

Posted 21 December 2011 - 05:29 PM

The OpenPilot project looks amazing, and I wish I had found it when I was building my quad -- instead, I went with AeroQuad. It's a capable bit of software, and easier for me to hack on, but lacks something like GCS. But, since the UAVTalk protocol is open and documented, I thought I could do the work to make GCS talk to my Aeroquad.

I'm using the Arduino UAVTalk libs, but I can't even get far enough to parse the incoming bytes. I've fired up GCS and have it talking to my Arduino over an XBEE link while my Arduino echoes the bytes back to my computer over a cabled serial connection. From the UAVTalk wiki page, I expect to see a sequence of bytes starting with 0x3C. Instead, I'm seeing mostly sequences like "E01860" over and over again.


Is there a handshake protocol that begins before UAVTalk takes over? Or am I missing something more fundamental?


(I've attached a log of several seconds of what GCS sends out when I tell it to connect. The linebreaks were added by hand to try and identify patterns.)

Attached Files



#2 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 21 December 2011 - 06:58 PM

You should be seeing UAVTalk packets being sent, and the do start with a 2 byte start tag.  Off the top of my head, I don't know exactly what that is, but 0x3C sounds right.

What type of Arduino are you using, and how is it attached?  If you're using any of the SoftSerials, they're probably not going to work at 56K.  If you're using a Mega with 2 hardware serial ports, could you post the sketch that you're using to print the incoming data?  If you have 2 USB Xbee adapters, you could also eliminate the Arduino entirely and watch the bytestream on the second Xbee using X-CTU.

#3 grantmd

grantmd

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationSan Carlos, CA
  • Country: flag of United States United States

Posted 21 December 2011 - 09:00 PM

Arduino Mega 2560, with data going out over the XBee at 57600 to the Arduino on Serial3, and coming back over the usb cable at 115200 on Serial1.

It's a good idea to make a simple sketch just to test this -- right now it's all tied up in the Aeroquad code. I'll do that and post back.

#4 grantmd

grantmd

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationSan Carlos, CA
  • Country: flag of United States United States

Posted 22 December 2011 - 12:48 AM

Alright, the simplest possible test code:

void setup() {
  Serial.begin(57600); // To your computron
  Serial3.begin(57600); // To your xbee
}
void loop() {
  if (Serial3.available()) {
	Serial.print(Serial3.read(), HEX);
  }
}

Works fine. I get the expected 0x3C sequence. So.... sorry! Now to figure out why my other code is munging things on the way in.

#5 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 22 December 2011 - 01:51 AM

View Postgrantmd, on 22 December 2011 - 12:48 AM, said:

Works fine. I get the expected 0x3C sequence. So.... sorry! Now to figure out why my other code is munging things on the way in.

Glad to hear you go something sensible! :)