2

I need to connect some sensors wireless using an ESP8266 which transfers data over my home Wi-Fi network from sensor to Raspberry Pi. Now, I was told on the Raspberry Pi Stack Exchange that when using the ESP8266, there would be no need of physically connecting the sensor to the Pi using wires. But how to do that wireless? What is the code in Python?

closed as too broad by Bence Kaulics, Thisaru Guruge, Sean Houlihane, mico, Ghanima Jul 5 '18 at 20:55

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

4

A powerful and simple communication protocol is MQTT.

MQTT is a protocol that is suitable for communication between low power devices like ESP8266 and Raspberry Pi. It is lightweight and simple to implement.

MQTT is a broker/Client system and there are libraries to ESP8266/Arduino as well as Python.

For the ESP8266/Arduino part, there are several instructive videos on Youtube by Andreas Spiess among others.

References

MQTT: https://en.wikipedia.org/wiki/MQTT

Andreas Spiess: https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ

1

Step 1: Install nodeJs on Pi. Refer :https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp
Step 2: Create REST Api by using angular 2-4 with database . Refer: https://www.sitepoint.com/angular-rxjs-create-api-service-rest-backend/ Step 3: configure WI-FI module and trigger the rest services through it. Elaboration: Rest Api is triggered through wifi module through which data of sensor was sent to the database through which you will able to do actuation.

NOTE: In python scenario the creation and triggering of REST Api is through python.

  • 2
    Hi Eknath, please use the edit functionality to merge your two answers. Afterwards you can delete one of them. – Helmar Jul 4 '18 at 8:28
  • 1
    Using angular for this project looks like an overkill. Simple express should be enough. For python, Flask framework is suitable. – atayenel Jul 4 '18 at 19:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.