Skip to content

Arduino sketch for ESP8266 to report temperature/humidity from a SHT30 sensor to an MQTT server

Notifications You must be signed in to change notification settings

xlogerais/esp8266-mqtt-sensor-sht30

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is an Arduino Sketch for ESP8266 to report temperature/humidity from a SHT30 sensor to an MQTT server

Hardware

Configuration

Wifi

Because the sketch use WifiManager, during the first run you will be able to connect to a Wifi AP called "AutoConnectAP" to configure the ESP8266 to then connect to the Wifi of your choice.

  1. Compile and upload the code to the ESP8266 board and restart it
  2. Connect your PC/phone/tablet to the "AutoConnectAP" wifi using the password "password"
  3. Access the web configuration page at http://192.168.4.1 to connect the ESP8266 board to your personnal wifi and choose the MQTT server address:port

MQTT server and port

During the wifi configuration phase, you will be able to provide the MQTT server address and port on the web configuration page.

The params provided during the configuration phase will be stored in a file called config.json inside the SPIFFS partition of the ESP8266.

You can also choose to manually create and upload the configuration file config.json to the SPIFFS partition using the arduino IDE plugin esp8266fs (https://github.com/esp8266/arduino-esp8266fs-plugin).

OTA

This sketch use the arduino OTA library, so after the first sketch upload using serial, you should be able to see the device along with his ip address in the "Tools>Ports" menu of the arduino IDE.

If the device is correctly detected, you will be able to directly send updates using this new "port" without the need of a wired (serial) connection.

For this to work, your computer need to be connected to the same wifi network as the esp8266.

Libraries used

External links

About

Arduino sketch for ESP8266 to report temperature/humidity from a SHT30 sensor to an MQTT server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%