Communication via UART port doesn't work

Hi,

I would like to communicate via the UART Port of the “Wio Terminal Battery Chassis”. But it doesn’t work.

I have 2 “Wio Terminals” and “Wio Terminal Battery Chassis”. So, I plug a Grove cable into the Grove interface “ITXD; RXD; 3V3; GND” of both and write sender and receiver scripts.

sender script

#include <TFT_eSPI.h>

TFT_eSPI tft; 
// Stock font and GFXFF reference handle
TFT_eSprite spr = TFT_eSprite(&tft);  // Sprite 

int zahl = 0;

void setup() {

  Serial.begin(115200); 
  
  // put your setup code here, to run once:
  tft.begin();
  tft.setRotation(1);
  spr.createSprite(tft.width(),tft.height()); 
}

void loop() {
  spr.fillSprite(TFT_BLACK);
  spr.setFreeFont(&FreeSansBoldOblique18pt7b); 
  spr.setTextColor(TFT_BLUE);

  zahl = zahl + 1;

  if (zahl > 42) zahl = 1;
  
  spr.drawNumber(zahl, 15, 15);

  Serial.write(zahl); 
  
  
  spr.pushSprite(0, 0);
  // delay(3000);
}

receiver script

  #include <TFT_eSPI.h>
    TFT_eSPI tft; 
    // Stock font and GFXFF reference handle
    TFT_eSprite spr = TFT_eSprite(&tft);  // Sprite 

    int receivedByte;


void setup() {

  Serial.begin(115200); 
  
  // put your setup code here, to run once:
  tft.begin();
  tft.setRotation(1);
  spr.createSprite(tft.width(),tft.height()); 

}

void loop() {
  spr.fillSprite(TFT_BLACK);
  spr.setFreeFont(&FreeSansBoldOblique18pt7b); 
  spr.setTextColor(TFT_BLUE);

  // Returns the first byte from the serial buffer
  if (Serial.available() > 0) {
   receivedByte = Serial.read();
   spr.drawNumber(receivedByte, 15, 15);
  } else {
    spr.drawString("No Signal", 15, 15);
  }
  
  spr.pushSprite(0, 0);
  // delay(3000); 
}

Thanks,
Kay

Have you tried connecting the TX of first Wio Terminal to the RX of the second, and RX of the first to TX of the second?

I have only Grove cable so I want to use the Grove interfaces.

Connecting RX to RX, and TX to TX, won’t work.

The transmitters (sender) need to be connected to the receivers.

1 Like

Hi @KayG

If you are using Grove cable, it would become RX to RX and TX to TX as @reivilo said. You may need. to use jumper wire to test out first