1
$\begingroup$

I am trying to send some data over to my PC from the Arduipilot, I used a Normal USB connection to send over a recurring string like this:-

const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER;

void setup()
{
   hal.uartA->begin(38400);
}

void loop()
{
    hal.scheduler->delay(20);
    hal.console->println("Recd_String");
}
AP_HAL_MAIN();

I receive the string just fine when I open a serial monitor with baud of 38400 bits/sec. But, when I remove the USB port and plug in the 3DR radio module to the ardupilot and the PC, it gives me garbage. I know that the 3DR radios use MAVLink communication protocol, but I was wondering if it's possible to change this protocol and use a normal SPI so that I receive the data in the same format I receive when connected via USB.

If this is not possible, is there a way to convert this garbled data from the radio module to a useful string. It would be greatly appreciated if someone can help me with this.

$\endgroup$
  • 1
    $\begingroup$ I do similar things with the radio module. However I use Uart2 instead of UartA, because I cut the hardware mux. Do you use the 3DR radio config tool for debugging the radio output? Maybe something is wrong with the baud or sending rate on one of the ends. It is in 90% of the cases a wrong baud rate.. $\endgroup$ – dgrat Mar 25 '14 at 10:33
1
$\begingroup$

The 3DR radios by default use 57600 baud, be sure that it is set properly on both the sending and receiving side, this has been the source of many problems for me.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.