-1

I want to send and receive data simultaneously between my Arduino Uno and Nodemcu esp8266. I am sending sensor data from my arduino board to the nodemcu to be pushed to my database. At the same time I am fetching data from the database and sending to the arduino. The arduino should always be able to receive from the nodemcu while sending data to it periodically and the nodemcu should always be able to send to the arduino while receiving data periodically.

I tried to use the SoftwareSerial arduino library but realised it only worked for half-duplex communication.

Is there a way to achieve full duplex serial communication between arduino uno and nodemcu esp8266?

1 Answers1

0

If you are doing a direct cross connection UNO RX to Esp TX and Esp TX to UNO RX that should be a full duplex as far as I know (independent transmit and receive registers)

And you send data with Serial.print() and listen with Serial.read()

The only reason why you would need the SoftwareSerial is if you want to ‘observe’ through the serial monitor the chit-chat between the two as UNO afaik only has one serial (ESP can also use Serial1) otherwise it should be full duplex.

Only caveat is that if you need to reprogram you will have to disconnect them first to free up the Rx/TX pins, that’s all.

Just realised, I actually have one setup like that in my house but between two ESPs and I am pretty sure it’s full duplex (you are making me doubt my own sanity now! :-)

  • Yes I did the connection you speak of with Software Serial because I wanted to use the Serial monitor to observe the output. I noticed that if I made them send a receive at the same time the output was jibberish but when I used millis() to regulate the sending and receiving I got the desired output. – Dillys Annan Aug 04 '23 at 02:59
  • If you have to use millis() then it's not real full duplex. I think If you observe on the ESP (not UNO) you could use "Serial1" as ESPs can have two serials running at the same time. Try changing your code to use the ordinary Serial.print() & Serial.read() and on the ESP start the Serial1 and use that to output to the serial monitor. In theory it should still be full duplex. If you need to observe through the UNO then you are out of luck and you will have to use the SowftareSerial. You know what I mean by "Serial1" ? – ChipChop Gizmo Aug 04 '23 at 07:48