Hello, i want to make a project were 2 ESP8266 collect data (temperature, humidity) from 2 DHT22, and to make a web server were i can see the temperature and the humidity from 2 different rooms. How can i do this and what should i need! I am new to arduino. Thanks in advance.
It is a bit complicated. You will have a hard time doing that. I suggest you to use any other communication like 2 bluetooth modules.
Connect the 2 bluetooth modules to each ESP8266 and code one ESP8266 that it sends the temperature to the second ESP8266. Then that ESP8266 will make a webpage and add the 2 values to the webpage. Sending the value from one ESP8266 to another is very hard for coding.
..Arnav
Why use Bluetooth?
The devices already have radio - use ESP-Now
TheMemberFormerlyKnownAsAWOL:
Why use Bluetooth?
The devices already have radio - use ESP-Now
But how are you going to communicate the both boards? It is very complicated code. Anyone can do it if they had more knowledge of it.
ArnavPawarAA:
But how are you going to communicate the both boards? It is very complicated code. Anyone can do it if they had more knowledge of it.
Did you follow the link? :o
ArnavPawarAA:
Sending the value from one ESP8266 to another is very hard for coding...Arnav
well that depends on how define the word 'hard'
esp8266 as master can talk to up to 8 other esp's (slaves) ( i have done this )
communication can be over UDP or TCP, i used TCP
all 8 slaves sending data to one master over GET request, master then issues replies
a link posted by AWOL could be OP's starting point
With ESP now it is much easier than with UDP or TCP/IP.
if somebody is completely new to programming he/she has a leranring-curve to climb up anyway. totally regardless of what the chosen solution to exchange data is.
The code for ESP32 differs a lot from ESP8266. The TO wrote he wants to use ESP8266 so any code-example should link to ESP8266. Adapting code from ESP32 to ESp8266 is a hassle even for experienced users. I strongly recommend using code that is written for the same hardeware that you want to use.
Most example talk about "master" and "slave" This is completely nonsens. There is no "master" or "slave"
If the mac-adresses of the receivers is used you can do two way communication.
For receiving it is important to avoid the command delay().
while a delay() is executed you can't receive ESP-NOW-messages. You must use the programming-technique based on the command millis()
So Daniel,
what is your knowledge about programming in general. It is important for the users that should help you to know your knowledge-level. The explanations must be matching your knowledge-level. You can start from "I know nothing" You will need some time to learn the basics of programming.
best regards Stefan
I did some projects with Arduino, but I am new with the ESP8266 module, if you can suggest me maybe another method, i need to make a web server were the temperature from 2 different rooms will be displayed.
Hello, i want to make a project were 2 ESP8266 collect data (temperature, humidity) from 2 DHT22, and to make a web server were i can see the temperature and the humidity from 2 different rooms.
a)
if you want to have the "webserver" on the ESP just follow this IDE Example:
ESP8266Webserver | HelloServer
b)
if you want that your ESP pushes data to another webserver (either as GET or as POST) follow this example
ESP8266HTTPClient | BasicHttpclient
c)
if you want to have one ESP as webserver, begin with a)
let the second ESP do b) and the target to push the data to is the IP of a).
"I did some projects with arduino" is not much information about your knowledge-level about programming.
You could have done "some Arduino-projects" by copy and paste ask for some adaptions in the forum and that's all"
Or it could have been writing code yourself including creating your own library with classes complex datastructures and overloaded functions.
So what was it? just blinking some LEDs or
measuring temperatures using I2C, displaying these temperatures on a display connected by SPI, and controlling multiple
fans and heaters through a pretty complex statemachine.
@noiasca: You quoted examples about HTTP-webserver and clients. Can you provide a well documented example
that shows not only the principle of a webserver itself but shows the principles to how to modify it to show different data
and how all the "gets", "posts" musst be adpated for differenet needs?
I have looked into several examples with webserves but I found it a big hassle to wade through that jungle of html-code
that http carrys a long with it. And a tutorial about the basics how http-requests and answer work in general.
Compared to that ESP-NOW is pretty easy and straight forward.
define datastructure you want to send
determine MAC-adresses,
add ESPs to peer-group
register two "allways stay the same" callbackfunctions
send messages
done
If the data should be shown on a website of course you need the webserver-functionality.
best regards Stefan
Stefan,
I don't want to confuse the thread owner.
So the first step he needs to do is to clearify what he wants: A, B or C.
When the requirement is clear for me, I can procede and might give more input.
OT: If YOU need a well documented example, open your own topic in the German forum. I assume I have a link to a respective page, unfortunatly in German only.
I think that what people are saying is that there about a half-dozen different ways to accomplish what you describe. Your description isn't exactly clear what you want to do. Whichever process you ultimately make work, start small. Try running example codes on the ESP board- start with examples in ESP8266WebServer