Post topics, source code that relate to the Arduino Platform

User avatar
By tomb18
#88147 Hi,
I am using a WeMos UNO R3 board which has a ESP8266 module. I can upload sketches to both the Arduino or the ESP based on jumper settings. However, what I want to do is use my Arduino sketch which has several sensors attached, and send commands to the ESP so that it can send UDP packets.
So, the first thing I think I need to do is connect RX to TX and vice versa from the ESP to the Arduino using appropriate level converters. After this things get fuzzy for me...
I understand I can use AT commands to connect, and send packets and I have done so completely from the ESP however, this must come from the Arduino. So what do I do? How do I send the command to the ESP from a sketch in the ARduino? Is it something like SerialPrint(2) for the pins 0 and 1 on the arduino?
Or, is there a better way to do this? I'm kind of lost at the moment. I cannot use the ESP for all my sensors. It will not work.
Thanks, Tom
User avatar
By AcmeUK
#88150
the first thing I think I need to do is connect RX to TX and vice versa from the ESP to the Arduino

I think not!
The WeMos UNO R3 board is an ESP8266 functioning similar to that of NODEMCU, except that the hardware is built resembling Arduino UNO.
There is no Atmel processor onboard.
See here for more information:- https://www.instructables.com/id/Arduino-WeMos-D1-WiFi-UNO-ESP-8266-IoT-IDE-Compati/

Perhaps you mean your board is a UNO+WiFi R3 ATmega328P+ESP8266

Have a look here to see switch status and mode selection:- https://robotdyn.com/uno-wifi-r3-atmega328p-esp8266-32mb-flash-usb-ttl-ch340g-micro-usb.html
User avatar
By tomb18
#88165 Yes it is the UNO+WiFi R3 ATmega328P+ESP8266.
I have successfully connected directly to the ESP8266 and flashed a newer version of the firmware. Once that was done, I connected via a serial connection and tested the AT commands. These worked fine.
I now want to connect from a sketch in the arduino to the ESP so I can send UDP packets out. I must also have the serial connection to the arduino working. I can upload sketches no problem.
I know there are switches allowing MCU<>ESP but this is not what I need since then, there is no communications to the serial port.
So how is this done? Are there any libraries allowing communications from an Arduino to the ESP8266 device via software-serial? How would I do this? Does the ESP firmware know about this?
Thanks, Tom