Wio Terminal using (PI pins) TXD/RXD and RS-232 Level Converter?

I’m attempting to use a Nulsom NS-RS232 serial level converter with the Wio Terminal pins TXD(8) and RXD(10).
For a test, I am just trying to get a simple serial message transmitted out.
I have confirmed that the Arduino blink example works. So my environment is OK.
I have confirmed my PC serial port works. I can send and receive communications there.
Q1. Should I be using 3v or 5v supply with NS-RS232? Both are ok.
Q2. Wio Terminal says it uses the “40 pin Raspberry pi compatible GPIO”.
BUT Does it use RPi signal levels (3.3v) or Arduino signal levels (5v)?
Q3. Are Wio Terminal pins physically or functionally mapped to RPi pins? In other words, are Arduino Sketch I/O pins automatically translated to Raspberry Pi I/O pins by pin number, or by function?
For example, in the Arduino SoftwareSerialExample sketch, normally RX is p9 and TX is p10.
But on RPi, TXD is pin 8 and RXD is pin 10.
HOWEVER on the Arduino, RX is labeled as I/O pin 0 and TX is I/O pin 1!

In my Wio Terminal sketch, I have…
SoftwareSerial mySerial(10, 8); // RX, TX
which are the RPi pins.

HELP!
What voltage should I use for my RS232 VCC 3 or 5? (I think 5.)
and
Which pins should I use? (I think 10 and 8)
But this doesn’t work.
Is there a better test sketch?

Solved my own problem after much digging, and pain!
Serial1 is the pre-defined pin port.
Here’s my working code…

#include <pins_arduino.h>
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library

TFT_eSPI tft = TFT_eSPI(); // Invoke custom library

// PIN_SERIAL1_RX
// PIN_SERIAL1_TX

#define CW90 0
#define CW180 1
#define CW270 2
#define CW270 3

#define INPUT_GROUNDED LOW
#define INPUT_FLOATING HIGH

int counter = 0;
bool clearScreen = false;
bool waitForEndOfMessage = false;
bool forceInitialTurnOff = true; // force an initial turn-off
bool beltStateOn = true; // force an initial turn-off
String BELT_OFF_MSG = “<007B0>”;
String BELT_ON_MSG = “<007B1>”;

void setup()
{
pinMode(WIO_KEY_A, INPUT_PULLUP);
pinMode(WIO_KEY_B, INPUT_PULLUP);
pinMode(WIO_KEY_C, INPUT_PULLUP);

pinMode(D0, INPUT_PULLUP);

// Open serial communications and wait for port to open:
// set the data rate for the Serial1 port
Serial1.begin(115200); // Tx ok, Rx ok

tft.init();
tft.setRotation(CW270);
clearTFTDisplay();
tft.println(“Bell and Howell, LLC”);
tft.println(“DIO<=>DP01 Interface”);
tft.println(“115200, N, 8, 1”);
turnBeltOff();
}

void loop() // run over and over//
{

if (clearScreen || (digitalRead(WIO_KEY_C) == LOW)) {
clearScreen = false;
clearTFTDisplay();
tft.println(“Serial Port OK”);
tft.println(“115200,N,8,1”);
delay(500);
} // if (clearScreen || (digitalRead(WIO_KEY_C) == LOW))

// read the digital input signals
switch(digitalRead(D0)) {
case INPUT_GROUNDED: { // active low logic
turnBeltOn();
break;
} // case INPUT_GROUNDED
case INPUT_FLOATING: { // goes HIGH due to internal pullup
turnBeltOff();
break;
} // case INPUT_FLOATING
} // switch(digitalRead(D0))

checkForResponse();

} // void loop()

void clearTFTDisplay()
{
tft.fillScreen(0x0);
tft.setCursor(0, 0, 2);
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.setTextFont(4);
}

void sendData(String text)
{
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.println("Sending " + text);
Serial1.write(text.c_str());
}

void turnBeltOff()
{
if(beltStateOn || forceInitialTurnOff) {
clearTFTDisplay();
tft.println(“Turning Belt OFF”);
sendData(BELT_OFF_MSG);
beltStateOn = false;
forceInitialTurnOff = false;
} // if(beltStateOn) {
} // void turnBeltOff()

void turnBeltOn()
{
if(!beltStateOn) {
clearTFTDisplay();
tft.println(“Turning Belt ON”);
sendData(BELT_ON_MSG);
beltStateOn = true;
} // if(!beltStateOn) {
} // void turnBeltOn()

void checkForResponse()
{
if (Serial1.available() > 0) {
if(!waitForEndOfMessage) {
tft.println("");
waitForEndOfMessage = true;
}
char c = Serial1.read();
tft.setTextColor(TFT_RED, TFT_BLACK);
tft.print©;
if (c == ‘>’) {
tft.println("");
waitForEndOfMessage = false;
} // if(c==’>’)
} // if(Serial1.available()>0)

if(!waitForEndOfMessage) {
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.print(".");
delay(200);
} // if(!waitForEndOfMessage)
}

Hi @David_Schofield
Q1: From the user manual you provided, you can use 3.3v or 5V to supply with NS-RS232. Both are ok.
Q2: It can use RPI signal levels(5V) to power it up.
Q3: The Wio terminal pins are the same as the RPI pins, the software serial can be defined by yourself, all of the digital pins can be sued as software serial.

Awesome! Thanks!
Are we able to make contributions to the core documentation?
I’d love to help update the examples, based on my real-world experience.

@David_Schofield Our examples are all collected here. PR is very welcome.