I have 2 boards, a nodemcu and an arduino mega that I want to exchange packets of data between them. For this I'm using Serial3 on Arduino Mega and Serial on NodeMCU (GPIO13 and GPIO15).
I initialize Serial3 with 9600 baud and then do the same for Serial on the nodemcu. After that I try to send a byte (0x55) every 5 seconds (it's easier to debug a single byte instead of a frame) to the mega but it only receives garbage. Constant garbage, but still garbage. It always received 0x38 0x35 0xD and 0xA in one send.
I have checked my connections and I can see on an oscilloscope that 0x55 is getting to the nodemcu, well, it seems to be 0x55, but even so, I can see that only 1 byte gets to the mega and not four.
Is there a problem with nodemcu's (ESP8266) serial communication? It might be a programming problem.
Has anyone succeeded in exchanging frames between an ESP8266 and an arduino?
PS: I also tried using the SPI for communication, setting the arduino to slave, but still no luck. It received the wrong byte, maybe it's due to the format settings.