Serial communication on Arduino Uno I have a Raspberry Pi 3 connected to the serial of my Arduino Uno (pins 0 and 1), but I also have another device connected to two other serial pins on the Arduino (pins 10 and 11, using the SoftwareSerial library).

What I want to do is send a string from the RPI, then the Arduino gets it and resends that information through the other serial port to my device.

Until now the Arduino can receive the information from the RPI, but I'm not sure how to send that same string through the other serial port, the one going to the device.

Here is the code I'm using:

#include &lt;SoftwareSerial.h&gt;

String b = "0";
SoftwareSerial portOne(2, 3); //RX= pin 2  TX= pin 3

void setup() {
  Serial.begin(9600, SERIAL_8N1); 
  portOne.begin(9600);
}

void loop() {
  if (Serial.available() &gt; 0) {
    b = Serial.readString();
    Serial.println("Data from RPI:");
  }
  portOne.listen();
  while(portOne.available() &gt; 0){
      Serial.println("Data from port one:");
      Serial.println(b);
    }
  }


I just get the data coming from the RPI, but nothing from portOne.

Any thoughts?
Your code is not reading the SoftwareSerial. b is only populated when the Pi sent data. The loop below sends what it reads from the SoftwareSerial, after that is prints a new line println() (only because that's what your code is doing)

The listen() method of SoftwareSerial is only required if you have more than one SoftwareSerial connection.

#include &lt;SoftwareSerial.h&gt;

String b = "0";
SoftwareSerial portOne(2, 3); //RX= pin 2  TX= pin 3

void setup() {
  Serial.begin(9600, SERIAL_8N1); 
  portOne.begin(9600);
} 

void loop() {
  if (Serial.available() &gt; 0) {
    b = Serial.readString();
    Serial.println("Data from RPI:");
  }

 //not required with only one software serial connection
 //portOne.listen();

  if (portOne.available() &gt; 0)
  {
   while(portOne.available() &gt; 0){
      byte byteRead = portOne.read();
      Serial.write(byteRead);
    }
    Serial.println();
   }
  }