I'm trying to connect an Arduino (with a 4.0 bluetooth module) and a Raspberry pi 4 (with bluetooth module included). I just want the Rasp to receive a string and never to send, so thats the arduino sketch:
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(2, 3);
void setup() {
bluetooth.begin(9600);
}
void loop() {
delay(500);
bluetooth.println("string");
}
Now, if I try connecting my smartphone with a bluetooth terminal it works fine but when i try doing the same on the Raspberry it doesn't receive any byte. Here's what i tried:
import serial
bluetoothSerial = serial.Serial("/dev/rfcomm0", baudrate=9600)
print(bluetoothSerial.readline())
bluetoothSerial.close()
Despite the two devices are paired and connected, after some seconds of receiving nothing it gives me an error saying that "The Host is down"
.