ESP8266 as peripheral
Posted:
Sat Oct 27, 2018 1:30 am
by bremenpl
Hello there,
I am new to the ESP8266 world and I am trying to gather as much info as I can before I start writing the driver firmware. In my application I was using Xbee module so far for connecting devices together remotely. The Xbee (and now maybe replaced ESP8266) is used just as a modem for the master MCU and thats how intend to use it. Looking at the ESP8266 datasheets I have seen that by default it utilizes AT commands, which is very convenient for me. I havent seen any commands allowing me to modify the GPIO states or use the PWM or SPI peripheral however.
My question is- If I intend to use the ESP8266 module as a modem peripheral for an external main MCU, will I miss any functionality in here? I have read about NodeMCU, but this approach seems like to much for such application to me. I would appreciate all help.
Re: ESP8266 as peripheral
Posted:
Mon Oct 29, 2018 7:33 am
by QuickFix
I'll try to keep things short and simple (so please excuse me if I'm a bit too fast around the bends):
- It is possible to control GPIO's using AT commands (see the AT+SYSGPIOxxx-commands in the manual) to a certain degree (although I don't have any experience with it myself).
- In my experience AT commands suck and are awkward to get working successfully in an MCU < -> modem configuration.
A lot of standard things can be done without too much problems, but when you want something different, you're ending in trying to find one work-around after the other.
Writing your own communication protocol that exactly fits your needs is often faster, easier and more flexible. - NodeMCU is just a development board around an ESP-12; you can flash any firmware you want into it (I'm using it with the ESP Arduino core myself)
In my opinion, since you've already got a working XBee setup, is that you write similar modem-like firmware for the ESP, so you simply exchange both modules to suit your needs.
Just to make things clear: you are aware that the ESP8266 (and ESP32) are actually MCU's themselves with added WiFi hardware (in other words: in a lot of projects you can let the ESP do all the work by itself and there's not need for an external MCU)?
Re: ESP8266 as peripheral
Posted:
Mon Oct 29, 2018 8:27 am
by bremenpl
Hello, thank you for answer.
I am aware that the ESP8266 module is actually a regular MCU with WIFI peripheral. I however dont intend to use it as standalone MCU at all, but rather threat it as a black box, that understands AT commands (like I do with Xbee, or any other modem-like device, like u-Blox GSM modems). Also writing any firmware for the ESP chip itself would be not efficient for me, since I have a working AT commands parser already implemented in my main MCU. I would only have to add the ESP chip specific AT commands to the code.
Because of what you have mentioned, I aksed about this- I noticed not many people use the AT commands on the internet and I was hoping to find out why. Since its an easy solution that should work out of the box without doing anything, that should be fine (in theory).
Thank you for the instruction set, I had the version 2.0, not 3.0. It did not contain the GPIO AT commands.
Re: ESP8266 as peripheral
Posted:
Mon Oct 29, 2018 11:48 am
by rudy
I noticed not many people use the AT commands on the internet and I was hoping to find out why. Since its an easy solution that should work out of the box without doing anything
I have used Arduino boards for a couple of years before I started with the ESP8266. For me it was easier to use the ESP8266 with the Arduino framework and have it as the main processor. There are lots of good examples for ESP8266 with Arduino. Adding existing libraries is a big plus.
Say I wanted to read a sensor, save the information to SD card, make the setup available through a web page. I can use existing libraries for the sensors, for the SD card, and then find examples of the web stuff. I'm guessing that it would be a lot harder (if possible) working with AT commands.