I'll preface by saying that I'm not a C++ developer.  There are multiple references to APM2/2.5 support for UART2 on the forum.  Most references don't seem to come to conclusion.  I think we have quite a bit of flexibility on how to utilize the HW assets (great stuff).  In my case I wanted to utilize custom TM and an external data recorder in addition to and OSD.

Previously I had followed the Wiki instructions on routing serial3 to the board edge connector.  This also works, but doesn't allow the OSD and tailored stream to be used at the same time.  On my last flight I disabled the GCS writes and used this method to collect TM.  Worked great. 

On the flight before that one I tailored log.pde to write custom data to flash.  Again, worked great.

Utilizing UART2/Serial2 is also easy.  I did not change the jumper.  The mods for arduplane were this simple:

Arduplane.pde

FastSerialPort1(Serial1);       // GPS port
FastSerialPort2(Serial2);       // Aux TM port; LDG

System.pde

  gcs3.init(&Serial3);

#endif
  Serial2.begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, SERIAL_BUFSIZE); // LDG

Log.pde (note this is just test code, but you get the idea)

    DataFlash.WriteLong(log_Ground_Course);    

    DataFlash.WriteByte(END_BYTE);

    Serial2.printf_P(PSTR("GPS "));  Serial2.printf_P(PSTR(" ")); 

    Serial2.print(millis()/1000., DEC);

    Serial2.printf_P(PSTR("\n"));

My board edge TM port came alive and started sending data at the Serial3 rate.  Hope this post is useful to someone.

Regards,

Larry D. Grater

Views: 2690

Reply to This

Replies to This Discussion

If it were me I would just start editing mavlink_send_text(chan,severity,str) or any of those methods and see what happens haha. One of those hundreds of listed mavlink functions would probably (maybe?!) send back data to hilch etc?

Anyway, my main concern with doing this is the available throughput if you piggybacked on the telemetry data, which I'm still not sure about. For our lab's work I needed to do something similar (send data back from an onbaord microcontroller) and I didn't want to disrupt the telemetry data so I added one of these: http://www.8devices.com/product/3/carambola to send the data back via wifi. Although, now looking back over the source I see that you can set the telemetry data rate yourself so maybe it can work depending on what your sending back.

You would think someone has done this somewhere...

Yes, first I need to learn a bit about Mavlink and that's made me aware of Qgroundcontrol now which sounds as though it might be better suited to receiving custom telemetry ... not sure yet.  Lots to investigate.

 

One thing I want to avoid is adding another radio to the plane.  I've already got four rf devices: R/C rx, GPS rx, Video tx and modem tx/rx. 

 

Speaking of throughput - I was going to put a scope on the tx output of APM and see what the duty cycle looks like.  I assume it's fairly low.  Of course, this won't show what the APM processor throughput margin is.  But I was thinking another way to add extra telem would be to insert a device between APM and the modem.  It could then pass the APM tx data through and add its own messages.  The ground side would need another device between the modem rx and ground station so it could decode and display the extra messages.  But I don't want to go this route if I can modify APM code.

 

Dan

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service