Wio Terminal - Arduino Serial Communication

s it possible to connect Arduino Uno and Wio Terminal through Serial?

I connected the Rx pin, Tx pin, and ground following this tutorial: Serial Communication Between Two Arduino Boards - Iotguider

But when I upload the code string “hello” is sent by the arduino but not received by wio terminal?

Sending code:

char mystr[5] = "Hello"; //String data

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  Serial.write(mystr,5); //Write the serial data
  delay(1000);
}

Receiving Code:

char mystr[10]; //Initialized variable to store recieved data

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  Serial.readBytes(mystr,5); //Read the serial data and store in var
  Serial.println(mystr); //Print data on Serial Monitor
  delay(1000);
}

Do not forget for string terminator. String with 5 chars length needs 6 elements array for it

The code works when run between two arduino unos. The problem starts when an arduino uno is connected to wio terminal.

I’m not really sure if the string length is the problem as I just have “hello” not “hello\n”

It may works fine because you use this string not as string but as array of bytes with predefined length.

But when you initialize your variable with a string "Hello" - the compiler created array "Hello\0" with 6 elements and then copy it to your array mystr. But mystr array is only 5 chars long - so the sixth char will be placed to memory beyond the array. This can lead to overwriting the memory area with a completely different variable and unpredictable behavior.

What is Wio Terminal? Please provide a link.

Wio Terminal Documentation: https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/

raunaksinghinventor -
First the Wio Terminal is not a display. It is a computer (using an ATSAMD51chip) so just sending it "Hello" will not cause it to do anything. It must be running some program to detect input on the TX/RX pins of the input port and display on it's LCD. You can write the program in the IDE, load it to the Wio Terminal using the process provided by Seeed on their Get Started page. Once you have Wio Terminal programmed then communication is easy via serial port, Bluetooth or even via Wifi.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.