Chat freely about anything...

User avatar
By toffie
#5763 Well sure, it is http://www.swemod.com/esp.php?value1=1
The value of variable value1 can be changed to any numeric value, feel free to test and see if you get a "TACK" which means, Thank you.

Well I'm hoping that I'm sending some wrong data, cause otherwise I don't know what the problem might be.

My complete sequence is the following;
Code: Select allAT
AT+CWJAP="Networkname","password"
AT+CIFSR
AT+CIPSTART="TCP","www.swemod.com",80
AT+CIPSEND=66
GET /esp.php?value1=3\r\n HTTP/1.1\r\nHost: www.swemod.com\r\n\r\n


I've also tried the following;
Code: Select allAT
AT+CWJAP="Networkname","password"
AT+CIFSR
AT+CIPMUX=1
AT+CIPSTART=0,"TCP","www.swemod.com",80
AT+CIPSEND=0,66
GET /esp.php?value1=3\r\n HTTP/1.1\r\nHost: www.swemod.com\r\n\r\n


Same "error" with both of them.

However, if I change that to Thingspeak, I get the following... HOLD ON HERE.. you made me think of something.. I'm not sending it in the same format as I'm trying to send it to my server.. Hey lets redo that!

And I did..
Code: Select allAT+CIPSTART="TCP","api.thingspeak.com",80
AT+CIPSEND=91
GET /update?key=xxxxxxxxxxxxxxxxx&field1=55\r\n HTTP/1.1\r\nHost: api.thingspeak.com\r\n\r\n


Woah.. that's the same formatting as when I'm sending it to my server.. just with another variable (key).. but that doesn't matter.. now I get the following result even though I think some of it fell off in the beginning..
Code: Select allwrong syntax


SEND OK

uest
Server: nginx/1.7.5
MT
Content-Type: text/html
Content-Length: 172
: close

<html>

<body bgcolor="white">
/center>
<hr><center>nginx/1.7.5</center>
</body>


OK

OK
Unlink


It didn't update my Thingspeak channel, but wow.. I got something BACK!?! This is amazing.. :D



So where to go from here? First off I guess maybe you could test my server above? This one;
Code: Select allhttp://www.swemod.com/esp.php?value1=1


And then, what am I doing wrong in the Thingspeak code?

Also another question, is the AT+CIPSEND=XX value supposed to be exact the length that I'm sending, or can it be larger?

Thanks for opening up my eyes villTech! :)



Edit..
Also if I try the following to my server, I get blocked.. again.. :P
Code: Select allAT+CIPSTART="TCP","www.swemod.com",80
AT+CIPSEND=88
GET /esp.php?key=xxxxxxxxxxxxxxxxxxx&field1=55\r\n HTTP/1.1\r\nHost: www.swemod.com\r\n\r\n


I just get "wrong syntax, ERROR", then I get blocked from my server for a while.. as usual :)

Just to test it, I also moved the esp.php script into the folder /esp and changed the filename to index.php to try this;
Code: Select allAT+CIPSTART="TCP","swemod.com",80
AT+CIPSEND=59
GET /esp?value1=77\r\n HTTP/1.1\r\nHost: swemod.com\r\n\r\n

It looks more like the Thingspeak example with /esp?value1=77 but still no change.. it locks up my connection to the server..

The script can now also be accessed through the following address as well;
Code: Select allhttp://www.swemod.com/esp?value1=1
User avatar
By kenn
#5768 I found that I needed to use a better request header, with a known user-agent, before many servers would give me the expected page.

Here's the request header I've been using in a python test program:

Code: Select allGET [[path]] HTTP/1.1
Host: [[domain]]
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Pragma: no-cache
Cache-Control: no-cache
User avatar
By villTech
#5771 here is my test with your server:
Image

First try, with an incorrect request with correct request length, your server replied "404 Not Found"
Second try, correct request and correct request length, your server replied "TACK"

other than correct request, request length is also important.