I am working on a huge project that involves one plane collecting weather data and sending coordinates of located thermals to another plan that will receive the GPS coordinates and soar over the thermal to save energy. In order for this to happen I need to see how the computer uploads coordinates to the APM1 board so I can have a plain arduino board (Arduino Uno or Due) do the same. I am trying to do this with the 3DR radios since in the long run this will all be wireless. The arduino would be on board of the searching plane and have a 3DR radio connected to it and it would send the coordinates to the other plane. I have tried many things in reading the data from the receiver module like a serial port. I have an Arduino Uno R3 board with the software serial library reading from the Rx pin on the receiver module. I have tried every possible baud rate in the entire arduino library and every time it reads the data, it come out like gibberish. I have also soldered a small pin on the DRx pin in the middle of the board and have tried to read from that but I have still have had no luck. I have also noticed that when opening the terminal in the APM planner software, the terminal also looks like gibberish. I know that the 3DR radios operate at 57600 baud and it seems that that baud rate gives the most sensible data when reading through the serial port but it is still unreadable for me. I don't think the 3DR radios use NMEA 0183 protocol or anything like that. Are these radios encrypting their signal or is it something else? Should I try reading the data like SPI interface or a I2C interface?
My setup is both radios configured for each other one to the computer and the other to the APM1 board through the telemetry port. The APM is connected to the mission planner software through the radios and the arduino reads the data on the receiving end of the receiver module. The APM and the arduino are sharing the Rx pin on the module.
I don't think it's something wrong with my code but I have attached it anyways.
Don't use the SoftwareSerial for anything above 38400 baud, many devices even don't work with it above 9600 baud. The timing of the SoftwareSerial is not as exact as the hardware serial, which shows up much more at the higher baud rates. The hardware serial interface does some speed adaption which also makes it more reliable. SoftwareSerial is OK for reading some GPS data if the hardware serial is already used but is not complete drop in replacement for the hardware.
Thanks for the advice, I didn't know that. I tried reading the data with an Arduino Mega 2560 but I still get the same results. I also tried all of the possible baud rates offered by the Arduino IDE with this method.
According to the datasheet (page 10, figure 3), the pin that has to go to RX on the Arduino is DTX. In my reading of your description you have wired it the other way around, haven't you?
If I connect the Rx pin on the Arduino to the Rx pin on the receiver then I receive the data from the computer. If I wire up the Tx to the Arduino Rx then I get the data sent by the APM board. I want to have the data from the computer so I wired it up to the Rx pin on the receiver.
That's exactly the hardware I studied for my previous post. The receiver has a pin naming that doesn't conform to the usual logic. The pin named "TX" on the module has to be connected to the RX pin of the Arduino because there's the data that's received from the PC. The Arduino's TX pin must be connected to the pin named "RX" on the module because everything sent to that pin is then transmitted to the PC. You can see in the module's schema that the "TX" pin is connected to the "DTX" pin of the HM-TRP chip and that pin is an output which has the data received from the remote (PC) side.
Thanks for your reply, at least I know where to read the data from now. Unfortunately even when I read from that pin, I still get obscure characters in the serial port regardless of the baud rate. I know that the APM 1 board uses mavlink to communicate with the computer so is it possible I have to download separate libraries to implement into my code to decode these strings. I'm starting to think that mavlink is the problem that makes the data unreadable.