Skip to content

Module Overview Arduino

Florian edited this page Feb 27, 2019 · 9 revisions

Quick Overview: Arduino Modules

Possible Module Combinations with Arduino

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.

The complete pinout can be found on this google sheet 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

Arduino + IR + RF + BT + DHT

Software setup

  1. Download the code with all the files and put them on a folder named OpenMQTTGateway
  2. Copy OpenMQTTGateway/lib to "sketchbook folder"/libraries
  3. Open the file OpenMQTTGateway.ino

**IMPORTANT NOTE: On arduino UNO comment the following line ** #define IR_USE_TIMER2 line 137 and uncomment #define IR_USE_TIMER1 line 138 into the library IRremote/boarddefs.h so as to free pin D3 for RF_RECEIVER_PIN and assign IR Led emitter to D9

Define your mqtt server and network parameters into the USER PARAMETERS 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"

#else // for arduino + W5100

const byte mac[] = { 0xDE, 0xED, 0xAB, 0xFE, 0x23, 0x21 }; //W5100 ethernet shield mac adress

#endif

const byte ip[] = { 192, 168, 1, 99 }; //ethernet shield ip adress

The values below are optional if you want to use these parameters uncomment line 172 and comment line 171 of OpenMQTTGateway.ino 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 Arduino and open the serial monitor with a speed set to 115200.

Launch or verify that you mosquitto broker is up and running

If the connexion to mosquitto is ok you should see on the serial monitor of the arduino IDE "connected" & "subscription OK to home/commands/#"

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