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
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
-
2Altough 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 commandslarzz11– larzz112016年02月17日 07:55:44 +00:00Commented 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– Butters2016年02月18日 00:17:01 +00:00Commented Feb 18, 2016 at 0:17