Skip to content
Paul Bock edited this page Jan 26, 2021 · 2 revisions

Arduino Setup

Board Setup

nodemcu setup

  1. Add the following URL to the Additional Board Managers URL in order to install the NodeMCU board
http://arduino.esp8266.com/stable/package_esp8266com_index.json
  1. Go to Tools => Board => Boards Manager, search for NodeMCU, and install the esp8266 library, at this point in time, the version we are using is 2.7.4
  2. Select the NodeMCU 1.0 (ESP-12E Module) board

Library Setup

NOTE If ANY libraries have external dependencies on other libraries and ask you if you would like to install those as well, make sure they are installed as well, otherwise you will have issues when you compile

library setup

  1. Install the Adafruit ESP8266 library (currently using v1.1.0 (I think? Need to double check this))
  2. Install the ArduinoMqttClient library (currently using v0.1.5)
  3. Install the DHT sensor library library (currently using v1.4.1)

Configure secrets.h

  • SECRET_SSID: The name of the network your device will connect to.
  • SECRET_PASS: The password of the network your device will connect to.
  • SECRET_MQTT_USER: The name of the MQTT user your device will connect as.
  • SECRET_MQTT_PASS: The password of the MQTT user your device will connect as.

Configure server_config.h

  • DEVICE_LOCATION: The location of the device, used for constructing MQTT topic, by default it is "".
  • DHT_PIN: The physical pin the DHT module is transmitting data to on the NodeMCU board, by default it is pin D5.
  • DHT_TYPE: The type of DHT module being used with the NodeMCU board, by default it is DHT11.
  • LOOP_DELAY: The number of time (in milliseconds) the loop will be delayed, by default it is 5000, or 5 seconds.
  • MQTT_BROKER: The address of the MQTT broker the device will publish to, by default it is "".
  • MQTT_PORT: The port number the MQTT broker is accepting connections, by default it is 1883.
  • WIFI_SETUP_DELAY: The number of time (in milliseconds) wifi setup must wait before attempting to connect again, by default it is 500 or 0.5 seconds
Clone this wiki locally