Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Dan Kiefer
#38683 Hello,

I created a simple webserver (AP mode) which allows me to switch an LED and to read temperature. It works fine when I connect to it from a browser.

Now I tried to connect to it from another ESP8266 using the WifiClient example. Here I am stuck. In the example, a sparkfun address is used as the host. If I replace the host address by the IP of my webserver (192.168.4.1), my WifiClient connects to the network, but the connection to the server fails (client.connect("192.168.4.1", 80) == false). My intention was to send the same string to the webserver that is also sent by the browser. Sorry if that sounds silly.

How can I 'customize the script to talk to other http servers' (as it is said in the WifiClient example)? Do I have to change the server part in order that it accepts such requests?

Thanks for any help!

Regards,
Dan
User avatar
By Yahya Khaled
#38776 Hi Dan, I'm working on a small project which is to control my aircon via wifi.
So far I succeeded communicating with the indoor unit via Infra red and I happen to have ESP8266 in my draw.

Can you please share your code - it saves me time :)

If I get lucky I will be able to remove the Arduino completely.

Many thanks in advance.
User avatar
By Dan Kiefer
#38797 Hello Khaled,

as you can see from my original post, I am anything but an expert in ESP8266. All I did was adapting an existing project to my own needs. Please find the Arduino sketch file attached. It's most likely you may be able to remove the Arduino in your project.

The original code was found at: https://blog.thesen.eu/http-1-1-webserver-fuer-esp8266-als-accesspoint/

My thanks goes to Stefan Thesen for his excellent work. For all that is wrong in my modified code, the fault is mine alone.

Regards,
Dan
You do not have the required permissions to view the files attached to this post.