Skip to content

Module Overview ESP8266

Florian edited this page Feb 27, 2019 · 27 revisions

Quick Overview: ESP8266 Modules

Usable Modules with ESP8266

The complete pinout can be found on this google sheet The compatible pins can be found here and the compatible parts here

Define the pins you want to use for your gateways into each 'config_XX.h`. Example so as to define the pin of your RF receiver and transmitter if you don't use the ones per defaults go to config_RF.h


Possible Module Combinations with ESP8266

These combinations are suggestions made from a work of @hannesdi and @1technophile you can of course change the pinout and combination according to your needs.

Setup 1 (Most Features in one Setup):

ESP8266 + IR + RF + BT + I2C


Setup 2 (Limited Modules cause the RFM69 uses more specific Pins)

ESP8266 + IR + RF + RFM69 + DHT

Software setup

  1. Install Arduino IDE
  2. From Arduino IDE board manager install ESP8266 version 2.4.2 (2.5.0 beta is not working yet)
  3. Download the code with all the files and put them on a folder named OpenMQTTGateway
  4. Copy OpenMQTTGateway/lib to "sketchbook folder"/libraries
  5. Open the file OpenMQTTGateway.ino

If you want to use wifi manager web portal change WifiManager_password into user_config.h by a password of your choice. If you don't want to use wifi manager portal just uncomment the line below: #define ESPWifiManualSetup true and go to section below

The default password for wifi manager is "your_password"

With wifi manager portal upload the code to your ESP8266, search for your device by wifi and connect to it,

  • Select your wifi
  • Set your wifi password
  • Set your MQTT Server IP
  • Set your MQTT Server username (not compulsory)
  • Set your MQTT Server password (not compulsory)

The ESP restart and connect to your network. Note that your credentials are saved into the ESP memory, if you want to redo the configuration with the web portal uncomment temporary SPIFFS.format(); from OpenMQTTGateway.ino

With manual setup define your MQTT server and network parameters into this section of the file User_config.h.

/*-------------DEFINE YOUR MQTT & NETWORK PARAMETERS BELOW----------------*/

//MQTT Parameters definition
#define mqtt_server "192.168.1.17"
#define mqtt_user "your_username" // not compulsory only if your broker needs authentication
#define mqtt_password "your_password" // not compulsory only if your broker needs authentication
// Update these with values suitable for your network.
#ifdef ESP8266 // for nodemcu, weemos and esp8266
#define wifi_ssid "wifi_name"
#define wifi_password "password"

The values below are optional if you want to use these parameters uncomment line 158 of OpenMQTTGateway.ino.

const byte ip[] = { 192, 168, 1, 99 }; // ip adress
const byte gateway[] = { 192, 168, 1, 1 }; //ip adress
const byte dns[] = { 192, 168, 1, 1 }; //ip adress
const byte subnet[] = { 255, 255, 255, 0 }; //ip adress

Upload the sketch OpenMQTTGateway.ino to your ESP8266 and open the serial monitor with a speed set to 115200. Launch or verify that your Mosquitto broker is up and running.

If the connection to Mosquitto is ok you should see on the serial monitor of the Arduino IDE connected & subscription OK.

On your broker you should see: home/OpenMQTTGateway/LWT Online home/OpenMQTTGateway/version

Clone this wiki locally
You can’t perform that action at this time.