I am trying to build a smart home. I have some Esps to control the peripherals And I want to use the raspberry Pi as the hub/webserver The pi would host a website to allow the controls. I am not sure how to put it all together. The MCU lib can itself host html. Any suggestions.
Asked
Active
Viewed 68 times
-2
-
Questions that ask "where do I start?" are typically too broad and are not a good fit for this site. People have their own method for approaching the problem and because of this there cannot be a _correct_ answer. Give a good read over [Where to Start](https://softwareengineering.meta.stackexchange.com/questions/6366/where-to-start/6367#6367) and [edit] your post. – gre_gor Jan 24 '19 at 20:42
1 Answers
0
if raspbery pi and esp8266 run in LAN. Thats can communicate via TCP and UDP. UDP is boardcast protocol so it can be reach multiple esp8266 at the same time even if yo dont know ip address of esp8266s. But there is no response for security. TCP is unicast protocol. You have to know esp8266s ip address for using is. You can use UDP for take esp8266 ip address after then you can communate esp8266s via TCP.
if raspberry pi and esp8266 communicate via internet you can use MQTT.
i suggest you learn how create server by using raspberry pi (maybe apache or others) and develop scripts on raspberry pi for using TCP, UDP, MQTT. Also you should study to delevop program for esp8266s.

Barış İşbiliroğlu
- 119
- 3
-
I do know how to run servers on the raspberry with nodejs and Apache and stuff. the issue is that though I know the esp can post html scripts, I need to somehow connect the esp to the raspberry pi in the form of a database or something to keep track of sensor data. then O I can create application based on the data received from that sensor. Not sure how to connect both together yet. tried googling but couldn't find exactly what I need. – sakib11 Jan 26 '19 at 18:06
-
i have used esp8266 for communication server database. For this i used mqtt. I developed php script for listen mqtt topics and i send data from esp8266 to this topic. When data came this topic php script save this data to database. if you want use http there is [http module](https://nodemcu.readthedocs.io/en/master/en/modules/http/) on nodemcu. – Barış İşbiliroğlu Jan 26 '19 at 18:36