Go Down

Topic: Elecrow ESPduino UNO+ESP8266 Wifi Board (Read 268 times) previous topic - next topic

Orbitax

I've bought an espduino from Elecrow. Does anyone have some experience with this board?
There is no real clear tutorial or documentation on how to use this board as an espduino. For school i need to use this board for an IoT project and we need to send data to a webhost through the MQTT protocol. What settings do i need to use in the Arduino IDE and which library do i need for the esp to connect with the wifi and communicate over MQTT?
Also there are 6 pins on the board were i can choose to use HWSerial or SWSerial, which should i use for my application?

Juraj

#1
Dec 09, 2018, 12:04 pm Last Edit: Dec 09, 2018, 12:05 pm by Juraj
It is an Uno with esp8266 attached to Serial or SoftwareSerial pins

https://www.elecrow.com/wiki/index.php?title=Elecrow_ESPduino_UNO%2BESP8266_Wifi_Board

pert

What settings do i need to use in the Arduino IDE
Tools > Board > Arduino/Genuino Uno

which library do i need for the esp to connect with the wifi and communicate over MQTT?
I recommend this library:
https://github.com/bportaluri/WiFiEsp
You also need an MQTT library that can be passed a Client object. There are probably several options but this is the popular one that I'm a bit familiar with:
https://github.com/knolleary/pubsubclient

Also there are 6 pins on the board were i can choose to use HWSerial or SWSerial, which should i use for my application?
That is a tricky question. If you use HWSerial, that will connect the ESP8266 to pins 0 and 1 of the primary ATmega328P microcontroller. This microcontroller has only that one hardware serial port, which is usually used for uploading to the Uno and for communication with Serial Monitor on your computer. So if you use HWSerial it will interfere with uploading to the Uno. You can get around that by disconnecting the ESP8266 long enough for the upload and then connecting it up again. A more serious problem is that any debug Serial output in your code will interfere with communications with the ESP8266. So you can't get any output from your board until you get the ESP8266 working well enough to start sending it over WiFi. For this reason, you might consider using SWSerial along with the SoftwareSerial library to create a serial port for the ESP8266 on different pins. Leaving pins 0 and 1 free for communication with your computer. The problem with this is that the AT firmware of the ESP8266 communicates at 115200 baud by default but SoftwareSerial will not work reliably at that high a speed. So you need to use the appropriate AT command to set the AT firmware to communicate at 9600 baud. There are instructions for that at the link provided by Juraj.

If you do chose to stick with using the hardware serial port on your Uno for the ESP8266, you should know that the WiFiEsp library has a problem for that usage because the author leaves debug output turned on by default, which is printed to Serial and interferes with communications with the ESP8266. You will need to turn off this debug output before you can use the library with this hardware configuration, as shown here:
https://github.com/bportaluri/WiFiEsp/pull/46/files

Go Up