Arduino-RPi communication via alternative UARTs

Hi.
I’m trying to establish communication between an Arduino and an Raspberry Pi via GPIO serial, bidirectional reading and writing. Sorry, I'm not an expert.
The Rpi read correctly the data sent from the Arduino, nevertheless no data is received by the Arduino from the RPi's serial.write.
Here is the python code on the RPi:

#!/usr/bin/env python3
import time, serial, subprocess, signal, sys

ser = serial.Serial("/dev/ttyAMA5",9600)

time.sleep(1)

ser.write(b"Hello from Raspberry Pi!\n")
print("\nWaiting for Arduino commands")

while True:
    if ser.in_waiting > 0:
        line = ser.readline().decode('utf-8').rstrip()
        linelist = line.split(",")
        item0 = int(linelist[0])
        print(linelist)
        if (item0 == 1):
            test_string = "item 1 received"
            strBytes = test_string.encode('utf-8')
            ser.write(strBytes)
        elif (item0 == 2):
            ser.write(b"due\n")

And this is the relevant part of Arduino code:

#include "defs.h"
#include <SoftwareSerial.h>

// SoftwareSerial mySerial(RX, TX)
// Bluetooth module's TXD pin to Arduino 10, RXD pin to Arduino 11
SoftwareSerial BT(10, 11);
// RPi's (UART5) TXD GPIO12 to Arduino 8, RXD GPIO13 to Arduino 9
SoftwareSerial RPi(8, 9);

void setup() {
        Serial.begin(9600);
	RPi.begin(9600);
	BT.begin(9600);

	Serial.println("Hello from PTS's USB hardware serial");
	// RPi.println("Hello from Arduino");
}

void loop() {
	if (RPi.available() >0) DataFromRPi(); // data from RPi
	if (BT.available() >0) DataFromBT(); // data from BT
}
void DataFromRPi() {
String data = Serial.readStringUntil('\n');
Serial.print("You sent me: ");
Serial.println(data);
}
void DataFromBT() {
	getSerialBT(); // first value representing the 'caseN' integer
	caseN = serialdata;
	getSerialBT(); // second value
	data1 = serialdata;
	getSerialBT(); // third value
	data2 = serialdata;
	getSerialBT(); // fourth value
	data3 = serialdata;
Serial.print("Sent to RPi: ");
Serial.print(caseN); Serial.print(data1); Serial.print(data2); Serial.println(data3);

	switch(caseN) {
		case 0: {resetFunc(); delay(500); break;}
		case 1: { // string for RPi
			RPi.print(data1);
			RPi.print(",");
			RPi.print(data2);
			RPi.print(",");
			RPi.print(data3);
			RPi.println(","); break;
            }
		case 2: {
			// Serial.print(data1); Serial.print(" "); Serial.println(data2); break;
            }
		default: {
			BT.print(F("^Unused command! (case ")); 
			BT.print(caseN);
			BT.print(F(" in DataFromBT() switch call"));
		}
	}
}
long getSerialBT() {
	// https://forum.arduino.cc/t/how-do-i-handle-negative-numbers/477387/3
	serialdata = 0;
	while (inbyte != ',') {
		inbyte = BT.read();
		if (inbyte >= '0' && inbyte <= '9') {
			serialdata = (serialdata * 10) + (inbyte - '0');
		} else if (inbyte == '-') {
			dataSign = -1;
		}
	}
	serialdata = serialdata * dataSign;
	inbyte = 0;
	dataSign = 1;
	return serialdata;
}

Arduino and RPi are connected with wires using GPIO pins (12,13 on the RPi side) while Arduino is also connected via Bluetooth with an AppInventor app on my phone. Arduino actually receive commands from phone app and then send them to RPi via wired UART5. This is the relevant part of my RPi /boot/config.txt:

[all]
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=uart5

The Arduino board is USB wired to my laptop, where I write and upload code to the Arduino. The RPi is controlled via RealVNC for coding in Python.
This is the shell output where the Python program is executed:

root@RPi4> python /home/gigi/Documents/arduino_comm2.py

Waiting for Arduino commands

No messages on the Arduino IDE serial console from the RPi, only the message from Arduino code previously running:

Hello from PTS's USB hardware serial

When I send the command "1,1,0,0," from phone app, here is the output on Arduino console:

Sent to RPi: 1100

and here is the RPi shell output:

['1', '0', '0', '']

Again, no messages received by the Arduino from the RPi.
I swapped connecting wires on both Arduino and RPi but no success. Same results.
Any advice? Thanks

I moved your topic to an appropriate forum category @plgiorgi.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

What Arduino?

In particular, is it a 5V or a 3V Arduino.

Pretty sure RPi GPIOs are only 3V ...

As a rule, you can't use more than one SoftwareSerial instance at the time for receiving.
What is your Arduino board?
If you need to use more than one serial interface at the time, it is recommended to choose the board with multiple hardware serial ports, such as Arduino Mega, Nano Every or Pro micro

I have a Nano clone 5V Old bootloader, connected via level shifter to the RPi.
About the multiple SoftwareSerial, it seems possible to have two receiving ports (https://www.arduino.cc/en/Tutorial/LibraryExamples/TwoPortReceive)

Yes, it is possible to have two softwareSerial, but not to receive the both at the time. At any given time, you can only receive data on one port. In order to enable reception of one of the ports, it must be selected using the listen() method. as described in your link. But in your code you don't do anything like that.

The fact that you can only receive data on one port means that while you are reading the first port, data on other ports will be lost, making using more than one softwareserial in a program impractical.
As a conclusion, as I already wrote - if you need to work with several serial ports - choose the appropriate Arduino board

(edited, add a new sentence)

Thanks. Before searching for a cheap new Arduino board I'll try with this example for multiple softwareserial, using a procedure that wait for the second port until it has read all available data from the port one.