Giter Site home page Giter Site logo

esp8266-mqtt-sensor-sht30's Introduction

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

esp8266-mqtt-sensor-sht30's People

Contributors

xlogerais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esp8266-mqtt-sensor-sht30's Issues

Red lines when compiling

Hello,
i get these red lines when compiling the sketch:


/home/user/Downloads/arduino-1.8.2/libraries/WEMOS_SHT3x_Arduino_Library-master/src/WEMOS_SHT3X.cpp: In member function 'byte SHT3X::get()':
/home/user/Downloads/arduino-1.8.2/libraries/WEMOS_SHT3x_Arduino_Library-master/src/WEMOS_SHT3X.cpp:30:30: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
  Wire.requestFrom(_address, 6);
                              ^
In file included from /home/user/Downloads/arduino-1.8.2/libraries/WEMOS_SHT3x_Arduino_Library-master/src/WEMOS_SHT3X.h:12:0,
                 from /home/user/Downloads/arduino-1.8.2/libraries/WEMOS_SHT3x_Arduino_Library-master/src/WEMOS_SHT3X.cpp:1:
/home/user/.arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/Wire/Wire.h:67:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)
     uint8_t requestFrom(int, int);
             ^
/home/user/.arduino15/packages/esp8266/hardware/esp8266/2.0.0/libraries/Wire/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
     uint8_t requestFrom(uint8_t, uint8_t);
             ^
Archiving built core (caching) in: /tmp/arduino_cache_771018/core/core_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadTool_esptool,UploadSpeed_921600,FlashSize_4M3M_139c0cff8356e127e735d6bacb80cc19.a

followed by these white lines:

Sketch uses 331528 bytes (31%) of program storage space. Maximum is 1044464 bytes.
Global variables use 39890 bytes (48%) of dynamic memory, leaving 42030 bytes for local variables. Maximum is 81920 bytes.

Is it bad, is it good? What does it mean?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.