Arduino Wifi with slave ESP8266 module: Library recomendation

Hi,

I have recently finished a development using an ESP8266 module working as a main and unique microcontroller using the Arduino IDE. I have been impressed about the tzapu/WifiManager library, that allows a very easy implementation of a captive portal to setup the wifi access, or the ESP8266 Arduino core libraries and its integration between arduino and high level communication libraries with all kind of topics and services, such as mDNS, NTP, HTTP, etc.

Now I have another project using an Arduino Zero as a main microcontroller, and another ESP8266 module working as a UART Slave device (AT commands). I have realized that I have lost all the easy wifi functionality dealing with AT commands, and I am really missing them.

I have investigated in Github about ESP8266 libraries working as a slave, I mean, a library that integrates all the AT commands in an easy format, I have found only the following:

  • ekstrand/ESP8266wifi (181)
  • bportulari/WiFiESP (115)
  • Diaoul/arduino-ESP8266 (59)
  • ssokol/esp8266 (87)
  • itead/ITEADLibArduino_WeeESP8266 (355)
  • connecThings/ESP8266 (1)

And I don like their approach, sometimes I got complilation error, others they are using a software serial, or aimed to an specific hardware, etc.

Can anybody recommend me an Wifi ESP8266 library to be used inside my sketch in my Arduino Zero?

It is really amazing the lack of good general purpose libraries using the ESP8266 as a slave device, when this was the original purpose of this well known wifi module.

I personally use the ESP as a master. It handles all Wi-Fi related things and the overall logic. The (slave) Arduino just acts as a smart I/O expander: it just sends values over Serial when the state of some pins changes, and it changes outputs when the ESP sends a command over Serial. No fancy protocols or libraries required.

It all depends on the application: what do you want to do with it?

Pieter

Hi Pieter, thank you for your answer.

My IOT device has a modular approach, I am using an Arduino Zero Board as master, and then I have different communication slave modules: Wifi, Sigfox, Lorawan, NB-IOT(Future), etc. The ESP8266 is the wifi option.

Your idea seems really good, the standar Arduino as a smart I/O Expander and the logic and communication in the ESP8266, but it is not feasible for me unless I start my development from the very beginning.

I will be working sending the AT Commands directly to the wifi module, the development and features will be more limited than using the ESP8266 as a master device. It is somehow amazing that all the development around the ESP8266 has gone in the direction to make it a master Microcontroller, because this module is a perfect complement for the standar arduinos Modules.

I understand.
What kind of communication do you need? If you only need the WiFi connection to post data to a server, or to download weather information, for example, you don't need to handle everything on the Zero, and you can send only the relevant information over Serial.
If you need the Zero to have more control over the connection, that's a different story, and in that case I would opt for something like AT commands. However, I haven't tried any of the AT libraries yet, the few times I used AT, I wrote my own functions to print and read the right data to/from serial, so I can't recommend any libraries. But I'm sure others on this forum will help you with that.

Pieter