-->
Page 1 of 1

Setting Up Interrupts via GPIO pins on an ESP8266 Module

PostPosted: Tue May 12, 2015 8:39 pm
by Mlagma
First - I apologize if this has already been posted on this site or answered somewhere on Google. However, I haven't had much luck finding where that might be if it has been addressed.

In any case, this is the problem I'm trying to sort out. I ordered the standard ESP8266 ESP-1 module,Image, which has the following pinout: Image

These modules come preloaded with some standard firmware that accepts AT commands, which communicates through UART. It's fairly straightforward.

However, I've been running into some issues regarding documentation for these devices, particularly with respect to the GPIO pins. In fact, I have no idea what GPIO0 and GPIO2 does on this device. What I want to do is to configure it to generate interrupts whenever the UART RX buffer is full, and an interrupt when the UART TX buffer is empty. I'd rather not waste cycles polling this device because it's rarely going to be used in my project.

That said, does anyone know how to configure the GPIO pins on this module, and what they're currently doing?

Any input is appreciated.

Re: Setting Up Interrupts via GPIO pins on an ESP8266 Module

PostPosted: Fri May 15, 2015 9:22 am
by eriksl
What is it exactly what you want, uart or gpio?

Re: Setting Up Interrupts via GPIO pins on an ESP8266 Module

PostPosted: Mon May 18, 2015 5:21 pm
by JustMeHere2
GOIP 0 is used to boot the chip in Flash or Run mode. Not sure with GIPO 2 does, but I've seen that this should be pulled up. I'd be a little leery of using the GPIO for anything of your own.

If you want an interrupt, program your device's UART RX interrupt.

If I understand you correctly, I don't think the RX buffer works like you think it will. It's RX pin is going to send data when it has it. At least I haven't come across anything about flow control. In the latest version of the AT commands doc, there is mention of RTS and CTS, for the UART settings. I suspect they are going to be on other GPIO pins which are unavailable on ESP-01. Who knows? The poor documentation is an issue with this device.

My recommendation with this device is very short data packets over TCP. I'd even avoid the HTTP overhead. Roll your own protocol. For example: Send 3 bytes for the temperature and a terminator. Leave it that simple. No need to wrap XML like tags around the data.

Hope I know what I'm talking about here.

Re: Setting Up Interrupts via GPIO pins on an ESP8266 Module

PostPosted: Tue May 19, 2015 7:35 am
by eriksl
If you look at the source of a transparent bridge (either from beckdac or from me), you can see how to use the UART, including the FiFo's and interrupts. It's all completely undocumented and copied from examples.