Arduino Mega and simpleRTK2B

Q&A forumCategory: QuestionsArduino Mega and simpleRTK2B
vcorp asked 1 month ago

Goodmorning everyone. I have been trying for days to read gps data via arduino mega without success.
The configuration is as follows:
TX1 -> Pin15 (A)
RX1 -> Pin14 (A)
GND -> GND (A)
5vIn -> + 5V (A)
IOREF -> + 5v (A)
(A mean Arduino)
I have tried with both TinyGPS and TinyGPS++.
The board is equipped with the latest firmware available
and has the 1hz configuration found on your site.
(Using it in usb with u-center works).
Do I forget any other steps?
Thanks for your help.

Ardusimple Staff replied 1 month ago

Hi vcorp,
On TX1 you should see some data, at least unreadable data.
1. Can you read without any library any bytes on that interface?
2. Do you have the correct baudrate on your software?

3 Answers
vcorp answered 1 month ago
Thanks for the reply.

In u-center the baud rate is 4800 (same speed as the examples I used).

If I use this code to read from the serial where I connected the
rtk I don't see anything.

[CODE]
#include <SoftwareSerial.h>
SoftwareSerial swSerial(15, 14);
void setup()
{
Serial.begin(115200);
swSerial.begin(4800);
delay( 1000 );
Serial.println(“Test.”);
}
void loop()
{
swSerial.println(“Lettura serial 3 Arduino Mega”);
while(swSerial.available())
{
Serial.print(swSerial.read());
}
delay(100);
Serial.println(“Nuova lettura”);
}
[/CODE]
Dunno what i’m doing wrong.

Ardusimple Staff replied 1 month ago

Hi Vcorp,
Could it be that in u-center you are using USB interface? The baudrate is irrelevant when using USB.
Make sure you use the right baudrate: 38’400bps by default or 115’200bps if you use any of our configuration files http://www.ardusimple.com/configuration-files

vcorp answered 1 month ago

Reading better all the documentation of Arduino Mega I discovered an interesting thing. Basically I don’t have to use the SoftwareSerial library (like with arduino uno).
For Mega the 4 serials are mapped in this way:
Serial
Serial1
Serial2
Serial3

I noticed it because I did other tests also with the HC-06 Bluetooth module and I noticed that I was sending data but not receiving it.
At the moment I can finally read the GPS data (Serial3) plus the Bluetooth in / out data (Serial2) and the data from the QMC5883 Compass module.
I just have to interface with the PLCs that are on board the agricultural vehicle and finally start making it move autonomously.

Ardusimple Staff replied 1 month ago

thanks for sharing!

vcorp replied 1 month ago

Sharing is the power.

clive1 replied 1 month ago

Software Serial is definitely something to be avoided if possible.

The Arduino Mega, Due and the AdaFruit Grand Central, share the same foot-print and do offer a varying number of serial ports. All should be capable of driving a vehicle via way-point navigation.

vcorp answered 1 month ago

@clive1
Thanks for your reply.
Do you know some good starting point where to learn better how to move our vehicle?

clive1 replied 1 month ago

Perhaps look at ROS, ArduPilot, ArduMower, AgOpen, etc.

Starts by understanding position, orientation/direction of travel, where you’re trying to get too, and how you steer

vcorp replied 1 month ago

Thanks.