-->
Page 1 of 2

Help Getting The Arduino to Communicate to the ESP8266

PostPosted: Wed Nov 11, 2015 1:07 am
by FireRaven101
So, I got into arduino a few months ago. Recently I purchased the ESP8266 and a few sensors, my goal was to send the sensor info to a website (simple right?). I looked up SOOO many tutorials on it and did not really find anything useful, I dont want to flash my ESP8266 with any other software.

So now whats the problem? I can send the data to the site via the Arduino serial moniter but as soon as I try to do it via code it does not even seem to talk to the ESP module. Are there any tutorials out there that I may have missed that you could maybe link? Or if you have any idea what might be wrong it would be awesome if you could let me know.

Any help is greatly appreciated and if you need to know anything else to be able to maybe solve my issue let me know. :D

Re: Help Getting The Arduino to Communicate to the ESP8266

PostPosted: Wed Nov 11, 2015 5:41 pm
by eduperez
FireRaven101 wrote:I dont want to flash my ESP8266 with any other software.


Flashing the ESP is just as complex as flashing the Arduino: same language, same tools, same procedure... I would suggest reconsidering your decision.

Re: Help Getting The Arduino to Communicate to the ESP8266

PostPosted: Wed Nov 11, 2015 7:03 pm
by Barnabybear
FireRaven101 wrote:So, I got into arduino a few months ago.

Cool – bet that’s messed with your head.
FireRaven101 wrote:Recently I purchased the ESP8266 and a few sensors, my goal was to send the sensor info to a website (simple right?).

Not a problem: need more detail as to the method and problem.
FireRaven101 wrote:I looked up SOOO many tutorials.

A common problem – You’re not the first & won’t be the last. Things move so fast and the internet has a habit of throwing up the most popular searches even if they are out of date.
FireRaven101 wrote:I dont want to flash my ESP8266 with any other software.

An interesting statement: most of the Arduino sketches (with a little tweaking will run on the ESP) & it’s a form of coding that you are learning.
FireRaven101 wrote:So now whats the problem? I can send the data to the site via the Arduino serial moniter but as soon as I try to do it via code it does not even seem to talk to the ESP module. Are there any tutorials out there that I may have missed that you could maybe link? Or if you have any idea what might be wrong it would be awesome if you could let me know.

Need more detail.
FireRaven101 wrote:Any help is greatly appreciated and if you need to know anything else to be able to maybe solve my issue let me know. :D

You have come to a fantastically informed place (unlike some of the internet).
There are some amazingly informed people here who will spend hours to help others.
Answers may take a few hours to come through (up to 48).
Sometimes an answer may just be a link to another website – that’s not someone being ignorant, it’s here’s what you wanted to know.
Finally in answer to your problem, need more detail.
You are about to become involved in a world that will stimulate you brain and connect you with very informed (& friendly) people.

Re: Help Getting The Arduino to Communicate to the ESP8266

PostPosted: Mon Nov 16, 2015 9:17 pm
by FireRaven101
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?