Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First things first, if there was an ESP8266 StackExchange, I would post this there.

I am setting up a web server that will programmaticly be controlled from an external Python script, and I am currently able to send this server data using this script, but I don't receive an HTTP response back when I do, so the external script crashes.

I have googled around and not found much on this, so the question is How do I, From the Arduino, using an ESP8266 send an HTML response code?

share|improve this question
up vote 4 down vote accepted

After countless Trial/error attempts, I was able to put together the proper sequence.

AT+CIPSEND=0,40  \\Set this for your current connection ID and payload length.
HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n  
AT+CIPCLOSE=0  \\Set this for your current connection ID

Send these commands with the arduino, and it should exit successfully. You can also flush out the HTTP line with any other information you would like to include, as defined in the rfc2616 (HTTP/1.1) standard

share|improve this answer
    
Altough this works fine, I recommend you to take a look at ditching your arduino and just using your esp8266. The ESP8266 is much more powerfull then the Arduino. Take a look at the Sming Framework for example. It gives you so much more to work with the driving it through AT commands – larzz11 Feb 17 at 7:55
    
@larzz11 While, yes the ESP is easier to work with natively, I only had access to the 8 pin version (Then REV number escapes me at the moment) and that didn't give me enough GPIO pins for the project at hand, and it didn't have enough processing time or memory. – Butters Feb 18 at 0:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.