Hi,
i have a problem when i try to communicate with an esp8266 true the RX/TX pins on my raspberry pi 4
here is my flow:
[{"id":"eb5487b1.abca58","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"1e06d3a3.a6a2ec","type":"debug","z":"eb5487b1.abca58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1050,"y":420,"wires":[]},{"id":"ad2f5d2e.86ba5","type":"serial in","z":"eb5487b1.abca58","name":"","serial":"fd5d78cd.1a5618","x":820,"y":420,"wires":[["1e06d3a3.a6a2ec"]]},{"id":"8e9f907b.ddef","type":"serial out","z":"eb5487b1.abca58","name":"","serial":"fd5d78cd.1a5618","x":1040,"y":520,"wires":[]},{"id":"6ad27693.5a81f8","type":"inject","z":"eb5487b1.abca58","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"TEST","payloadType":"str","x":830,"y":500,"wires":[["8e9f907b.ddef"]]},{"id":"e9dad7f7.564d08","type":"inject","z":"eb5487b1.abca58","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"qweqw","payloadType":"str","x":830,"y":540,"wires":[["8e9f907b.ddef"]]},{"id":"fd5d78cd.1a5618","type":"serial-port","serialport":"/dev/ttyS0","serialbaud":"74880","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"\\n","responsetimeout":"10000"}]
and my esp8266 code:
String command;
void setup() {
Serial.begin(74880);
}
void loop() {
if (Serial.available())
{
command = Serial.readStringUntil('\n');
if (command.equals("TEST")) {
Serial.println("qwe");
} else {
Serial.println("123");
}
}
}
what i get is ether complete gibberish or nothing at all
can someone point me to what i'm doing wrong ?