1

I am trying to get my ESP8266 "hit" my website with some GET variables in the URL.

My connection to AP works fine, and when I ussye the AT commands as follow, I get the following responses:

AT+CIPSTART="TCP","www.mydom.com",80
    CONNECT
AT+CIPSEND=93
    OK
GET /mypage.php?var=arduino_test&var2=121 HTTP/1.0\r\nHost: www.mydom.com\r\n\r\n
    busy s...
    Recv 93 bytes
    SEND OK
    CLOSED

However, I do not get the actual "hit" on my webserver.

I have made a simple PHP page on the mypage.php that reads the two get variables and write them to a mysql DB - never get entries there, but when I manually hit the URL in a browser, I get entries made in the DB

1
  • PS - do not mind the value of the bytes - it is not "correct" since I removed my actual domain names here... Commented Nov 8, 2015 at 18:49

1 Answer 1

0

//reset

AT+RST

//not data mode

AT+CIPMODE=0

//setup multiple connections

AT+CIPMUX=1

//make webserver connection on port 80

AT+CIPSTART=0,"TCP","api.thingspeak.com",80

// after a connection is made set the number of bits your sending

AT+CIPSEND=0,110

//now you input your address and press enter

GET https://api.thingspeak.com/apps/thinghttp/send_request?api_key=E2HEG9W6BRXBY0YM HTTP/1.0

Sign up to request clarification or add additional context in comments.

3 Comments

This works directly from a terminal, but the issue I bump into is the moment you try to issue the AT commands via an Arduino sketch, and now have to deal with the \r\n and trying to correctly calculate the length of the string you want to send - things seem to go south...
Use "delay(100);" between your AT commands in your Arduino sketch, this will give the esp time to sync up with the Arduino.
Thx Jonoak, I should have posted my sketch perhaps - I do employ alot of delay() functions in the actual sketch, but I just don't seem to get this working.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.