8

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?

1 Answer 1

7

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

2
  • 2
    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, 2016 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, 2016 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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