I have just received my APM2 today so I'm a new user.
I want the APM2 to send out the MAVLink messages to my XBee, which I believe is UART0 as per the usual setup procedure in the manual...no problems here.
HJowever, I ALSO want the same messages to be sent down one of the other UARTs (don't mind which), so an exact copy. As a secondary thing, it would also be nice if the APM2 was able to receive MAVLink messages from both ports but I don't know if this is possible?
So, how do I configure APM2 to send MAVLink down two UART ports?
...just as a raison d'être, I will be sending the second stream to an onboard computer doing high-level control so it needs to be able to decode the MAVLink, make some decisions, and update the APM2. The XBee will run on the APM2 as normal with the GCS.
Any luck on this issue ?
No mate not yet
I got a solution to this!!
Have you solved your problem?!
No buddy no solution? What's your idea.
Very simple. If you have the
Sorry about the last incomplete message!
So If you have APM2, then you can add this line to your APM_Config.h:
#define TELEMETRY_UART2 ENABLED
and connect your telemetry device (e.g. Xbee) to the separate UART2 port on the APM2 (you will find it in a raw of 12 pins on the board side).
That's it, and enjoy transmitting/receiving on both USB and Xbee!
I hope that helped!
Did it work with you?!
I tried your solution but it is not working. Have you any idea or do I need to add some code to the program
That will not work quite as expected.
If you see the ArduPlane/config.h there is the only place at all where TELEEMTRY_UART2 is read.
If enabled, USB_MUX_PIN will be set to -1 (and there are no other effects).
In system.pde you can see that this will kill the multiplexer UART0 port / USB.
A solution that I used is to find the hal.uartC->begin and gcs3.init lines in system.pde. These are oly compiled on the condition that USB_MUX_PIN<=0. That is not necessary. Delete #else above those 2 lins and put the #endif below where #else was. Now go and disable TELEMETRY_UART2 again so the mux will work again. Or better yet, delete all mention of TELEMETRY_UART2 and its setting the MUX port to number -1.
I have UART0, UART2 and USB serial working all of them!! UART2 runs at the SERIAL3_BAUD speed. The SERIAL3 (yes, three) name comes from APM1 days when the secondary UART was number three. UART0 goes to the UART0 port using SERIAL0_BAUD when USB is not plugged. It runs at 115200 and goes to USB when plugged in.
I am trying to do this but I have some questions.
Could Telemetry_UART2 be disabled by add this code to APM_config.h
#define TELEMETRY_UART2 DISABLED
I tried but its not working, maybe I did something wrong I just wanna know.Also If I can't with that code, do I need to delete all Telemetry_UART2 from all files. Finally, do the ports work as same port or seperate ports?