-->
Page 1 of 1

Read txt from a server

PostPosted: Sat Mar 18, 2017 7:31 am
by Szaki Dani
Hi all!

I want make a simple project with ESP8266.
This project have two simple function:
1: I send temperature data 8float) to a local server. This function is working for me.
2: i want read a txt file. I.e.: 192.168.1.100/files/lamp.txt
This txt only contain an 0 or 1. If this 1, then I want to set a GPIO pin to HIGH.

But I not found working example to this. I try different code, but not working.
Somebody can help me?

Thank you!

Here is the code:
http://pastebin.com/Pe5x4C70

In this code some elements not used and commented.

Re: Read txt from a server

PostPosted: Sun Mar 19, 2017 6:47 pm
by gbafamily1
I suggest looking at the HTTPClient library for a simple HTTP GET example.

https://github.com/esp8266/Arduino/blob ... Client.ino

Re: Read txt from a server

PostPosted: Sat Mar 25, 2017 4:10 pm
by Szaki Dani
gbafamily1 wrote:I suggest looking at the HTTPClient library for a simple HTTP GET example.

https://github.com/esp8266/Arduino/blob ... Client.ino


Thank you!

I tried this. Working!
I merged with my code. Now I can send data to server and I can read the txt file.

Thank you again!