Current Progress on ESP8266 data logging

By: Alex Grejuc

After learning to interface with the ESP through the Arduino and hosting the basic web server, I started working on actually using the ESP to get data from the Arduino and log it on an online internet of things platform.

I started out by looking into a few different IOT platforms: Adafruit IO, IFTTT, and Xively. Of the three, Adafruit seemed like the best option because it was free and had tutorials for integrating a custom Adafruit ESP breakout board.

I started out working from an Adafruit tutorial. to simply learn how to connect to the Adafruit server and receive a response. However, this tutorial was intended for the Adafruit custom board and uploaded the code directly to the ESP8266 with an Adafruit library. I spent time “translating” their code into AT-commands by determining what they were doing, finding an AT command for it, learning how it works, and then sending it over.

Connecting to a network and starting a TCP connection with the Adafruit server was easy to do, however, the HTTP GET request has provided plenty of trouble.

Initially, after sending the request the ESP replied with “Send OK” but did not receive or print the response to the Arduino serial monitor. After trying many things, I thought there might be an issue with the Adafruit server I was attempting to get data from.

I then decided to try sending a GET request to a different server in case that was indeed the issue, so I set up an IFTTT applet. It would send my phone a text message when a request was sent in, based it off of a tutorial someone made for interacting with IFTTT using the ESP. This seemed like a good approach because I could see if the GET request worked without even reading any response in with the ESP, in case that was the issue.

This also did not work, so Dr. Udell and I came to the conclusion that the Oregon State wireless network might prevent the ESP from receiving the response somehow. This turned out to be true: after connecting to two different networks on campus (an OSU robotics one and a personal cellphone hot spot), the ESP got a response from the server.

Unfortunately, the response is a “Bad Request Error 400” response that I have been troubleshooting since. It seems to be a common issue based on forums, but no clear solutions have been found. I hope to provide a more robust update with code, links, and information once I can successfully get the request to work.