- Mon Nov 16, 2015 9:17 pm
#34250
Thank you for the reply! You asked for more info so here you go:
After a while I found another tutorial, this one actually worked! it was able to send data to a thingspeak server and to data.sparkfun.com. But when I tried with my server it did not work.
Here is everything I sent to get it to send to thingspeak:
-AT+CIPMUX=1
-AT+CIPSTART=4,"TCP","184.106.153.149",80
-AT+CIPSEND=4,(#)
-GET /update?key=NN2TJICI823NPLZW&field1=(value)
and that works perfect. Now as soon as i try to send it to my server which is server on openshift (openshift.redhat.com). So I do the following:
-AT+CIPMUX=1
-AT+CIPSTART=4,"TCP","https://greenhouse-moun10.rhcloud.com",80
-AT+CIPSEND=4,(#)
-GET /Server/Server?command=setData&key=i3hkd7k3&data=2|3|5|6|7|8|12|No Fire|No Gas
and it goes through and gives me a SEND OK message, then it hangs for like 10 seconds and then gives me this message:
Code: Select all+IPD,4,485:HTTP/1.1 400 Bad Request
Date: Tue, 17 Nov 2015 01:18:48 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 302
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at localhost Port 80</address>
</body></html>
4,CLOSED
So then i tried again but changed AT+CIPSTART=4,"TCP","https://greenhouse-moun10.rhcloud.com",80 to AT+CIPSTART=4,"TCP","https://greenhouse-moun10.rhcloud.com",443, now it gives me this message:
Code: Select all+IPD,4,527:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://localhost/"><b>https://localhost/</b></a></blockquote></p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at localhost Port 443</address>
</body></html>
4,CLOSED
What am I doing wrong?