How do you send data through wire to another arduino board

Q&A forumHow do you send data through wire to another arduino board
Jack asked 2 years ago
So I’m trying to send data from and Rtksimple V3.0 to an Esp32 board by connecting them with wires. I’ve connected the Arduino RX pin to the Rtksimple TX and viceversa, I also connected the esp32 3V3 pin to the Rtksimple ioref and connected both GNDs. The Rtksimple has no additional configuration aside from the factory one, though looking at the config files in ublox u-center it suppossed to send to  the same messages it does through the usb, since the MSG (Messages) tab shows that all the messages that go out are checked to go through all the available ports: l2C, UART1, UART2, USB, SP1. I have connected the Rtksimple board to PC with usb and can read the data from there but when I connect it to the Esp32 with wires nothing happens. The Esp32 is programmed to

Serial.write(digitalRead(RX));

but nothing happens. So, how does one connects an Rtksimple V3.0 board to another Arduino board, in this case an esp32 and sends data to it? Is it enough to connect the rx,tx,ioref and gnd? Am I missing something?

clive1
replied 2 years ago

Would this just send the bit state of the pin? How would that work?
Serial.write(digitalRead(RX));

Sending a data byte (one), would look like this
uint8_t byte = 0xB5;
Serial.write(byte);

int i;
uint8_t bytes[] = { 0xB5, 0x62, 0x0A, 0x04, 0x00, 0x00, 0x0E, 0x34 }; // UBX-MON-VER query
for(i=0; i<sizeof(bytes); i++)
Serial.write(bytes[i]);

Jack
replied 2 years ago

The idea was to read whatever data comes through RX and print it in the screen.
But I see now that it is not that simple.
I guess the Esp32 has to be configured to read uart through a specific pin and then connect that pin to the SimpleRTK2B V3.0.
What I want to know is if It is possible to send coordinates or any other data from the SimpleRTK2B V3.0. to the Esp32 and how to do that at least in theory.

Jack
replied 2 years ago

Ok, I think I did manage to read UART in the Esp32 with:

#include

#define RXD2 16
#define TXD2 17

void setup() {

Serial.begin(9600);
Serial.println(“Aplication start”);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);

}

void loop() {

while(Serial2.available()){
Serial.println(Serial2.readString());
}
delay(200);
}

But now all I see is gibberish, unlike reading from the SimpleRTK2B V3.0. USB port where I do see NMEA statements.

Jack
replied 2 years ago

The include was:
#include
Don’t know why It didnt appear.

Jack
replied 2 years ago

It missed again. It was include Arduino.h, maybe it was because of the less than and more than signs.

clive1
replied 2 years ago

Check baud rate, ZED default is 38400 baud, some radio setting have that up to 115200.

Jack
replied 2 years ago

Solved it, it was the baud rate, as you said.

Want to learn more about GPS/RTK?

1. Our engineering team will contact you to solve any questions
2. We will keep you updated about promotions and new product releases
3.You will only hear from us when we have important news, we won’t spam your email