Chat freely about anything...

User avatar
By Joe Job
#46524 Hi guys I have a project built on the ATMEGA328P-PU (standalone) and my next stages are to get it connected to the net, does anyone the whereabouts of any good topics for C on how to communicate with the ESP8266 01 for connectivity?

As it stands at the moment I have the ATMEGA328P-PU sending a message via serial to an ESP8266 01 at 115200 which is listening for messages. The esp8266 receives messages from serial monitor but is not receiving the messages from the ATMEGA.
User avatar
By martinayotte
#46564 There 2 possible wiring scenarios : TX/TX with RX/RX, and TX/RX with RX/TX.
With one scenario, the ESP is talking directly with the USB-TTL of the Arduino board, therefore with Serial Monitor on your PC.
With the other, the ESP is talking with the ATMega328 of the Arduino, of course, the USB-TTL will still be there and you can listen in Serial Monitor what the ATMega328 is sending to ESP, but you won't able to see what ESP is sending to Arduino.

Unfortunately, you can NOT have both scenarios at the same time.

But for convenience, you can add an DPDT switch to allow you to switch between both scenarios.
User avatar
By Joe Job
#46567
martinayotte wrote:There 2 possible wiring scenarios : TX/TX with RX/RX, and TX/RX with RX/TX.
With one scenario, the ESP is talking directly with the USB-TTL of the Arduino board, therefore with Serial Monitor on your PC.
With the other, the ESP is talking with the ATMega328 of the Arduino, of course, the USB-TTL will still be there and you can listen in Serial Monitor what the ATMega328 is sending to ESP, but you won't able to see what ESP is sending to Arduino.

Unfortunately, you can NOT have both scenarios at the same time.

But for convenience, you can add an DPDT switch to allow you to switch between both scenarios.


Hi thanks for the reply. It doesn't matter if I am able to to see it, how the script on the ESP is set out is it is waiting for a message to be sent from the ATMEGA and when it receives it it forwards this message via MQTT to my platform. The set I currently have is RX -> TX TX -> RX but nothing gets sent to the broker which is how I mean by the ESP is not picking up any messages. On the ATMEGA I have a simple C script that sends a message via serial and on the ESP it is an Arduino script that listens for the message and forwards it which is already tested and working on another device, do you know any docs that I could read on and examples that would help please mate, have tried to get this working for a while and haven't found any docs that answer my specific situation. Just to add there is no Arduino board it is my own circuit and an ATMEGA 328P-PU