How to send data from ESP8266 to Raspberry Pi?

How to send data from ESP8266 to Raspberry Pi?

In this tutorial we create a WiFi MQTT communication system with all components to send data from an ESP8266 or ESP32 weather station to a Rasbperry Pi. In my last article I wrote a tutorial how to send data from an Arduino to a Raspberry Pi via the serial USB communication.

Can a Raspberry Pi send data via WiFi?

If we want to send data via WiFi we need a transportation protocol. The most popular transportation protocol I know is MQTT which stands for Message Queuing Telemetry Transport and is suitable for microcontrollers like ESP8266, ESP32 or Raspberry Pi that are able to use WiFi.

How to send data from Arduino to Raspberry Pi?

In my last article I wrote a tutorial how to send data from an Arduino to a Raspberry Pi via the serial USB communication. But the better solution to create a smart home is of course to send the data via WiFi communication. If we want to send data via WiFi we need a transportation protocol.

Can you run an ESP8266 as a webserver?

The ESP8266WebServer library allows you run an ESP8266 as a basic webserver and access point. This can process data received from a remote sensor over Wi-Fi without connecting the devices to a network or router. For this tutorial I’m using two NodeMCU boards from eBay but you can do this with any ESP8266 based board.

Can a Raspberry Pi run on WiFi?

We will connect a DHT11 sensor to an ESP8266 board, and access the data via WiFi. However, here, we are actually going to grab that data from a Raspberry Pi, and make the Pi display the data on a simple graphical interface. To do so, we will run a simple web server on the ESP8266 chip.

Can a Raspberry Pi be used as a hub?

The Raspberry Pi will then access this data via WiFi, and display it graphically. The nice thing is can you can apply this in several other projects, to make the Raspberry Pi the ‘hub’ of your home, with several ESP8266-based devices connected to it.