Diaoul / arduino-ESP8266

An Arduino library to manage the ESP8266.
MIT License
68 stars 46 forks source link

how to do a HTTP GET ? #23

Closed soundreactor closed 9 years ago

soundreactor commented 9 years ago

hi

this might be a stupid question. but i am trying to GET the content from a local server and use it in my arduino code. the page will give me a variable. no html or nothing.

so how do i use the send ?

this is what i have.

// ' Serial.print("setWifiMode: "); Serial.println(getStatus(wifi.setMode(ESP8266_WIFI_BOTH)));

Serial.print("joinAP: ");
Serial.println(getStatus(wifi.joinAP("interpol_surveillance_van", "mypassword")));

Serial.print("connect: ");
Serial.println(getStatus(wifi.connect(ESP8266_PROTOCOL_TCP, IPAddress(192,168,1,7), 13568)));

Serial.print("send: ");
Serial.println(getStatus(wifi.send("GET /update/?key=dallameat&field1=22")));'
Jinugc commented 9 years ago

Same issue for me while using the connect function Serial.print("connect: "); Serial.println(getStatus(wifi.connect(ESP8266_PROTOCOL_TCP, IPAddress(192,168,1,10), 4444)));

connect: TIMEOUT

Diaoul commented 9 years ago

Use a higher timeout with setTimeout and use latest AT firmware. (0.20 or higher)