User Tools

Site Tools



is Flexible, Arduino-Mega/Arduino DUE/ESP8266 open-software and open-hardware SmartHome controller. RU HOME-site RU It may operate both:

  • On especially designed hardware board with 16 optocoupled digital inputs, 16 ESD protected digital/analog Inputs/outputs, 8 open-collector outputs (up to 0.5A/50V), DMX IN/OUT, MODBUS RTU and hardware 1-wire support circuit.
  • On plain Arduino MEGA 2560, Arduino DUE, ESP8266 and even on Controllino (Controllino and ESP8266 is not tested enough and in experimental stage yet)

Lighthub allows connecting together:

  • Contact sensors (switches, buttons etc)
  • 1-Wire temperature sensors (up to 20 on single bus)
  • Standard nonexpensive Relay board with TTL inputs, like this to control AC powered lamps, floor heaters, boilers etc
  • Modbus RTU devices (Currently, are deployed two types of Modbus devices: AC Dimmer and Ventilation set (Based on Vacon 10 controller)
  • Simple DMX wall sensor panel like this

List of non-expensive compatible components from AliExpress here alt text

Where is possible both, to configure local control/mapping between inputs and outputs (light, floor heating thermostats) and remote control from MQTT enabled software. At the moment, LightHub tested with following set of complementary free software:

  • Openhab or Openhab2 Smarthome software Openhab provides own native mobile app both, for IoS and Android, and even allow you to use Apple's HomeKit to say “Siri, turn on light in bedroom” but requires some server to be installed (Raspberry PI with Openhabian will good enough)
  • HomeRemote mobile client Home Remote mobile applicatios for IoS and Android requires just MQTT broker to be working. Any Cloud-based MQTT broker, like CloudMQTT will enough to serve average household, even with free account.
  • Node-Red Possibly, the best solution to deploy event-based authomation and scripting on top of MQTT/LightHub. The easy to use universal and visual tool to wire many different devices in single system. Having own Dashbord which allow control from web/mobile web, even without mobile apps (but excelent co-working with OpenHab and HomeRemote)

Scalability of Lighthub is virtually unlimited: Setup so many controllers you needed in most convenient places of your house - MQTT broker will allow controllers communicate each other and with Openhab/NodeRed/HomeRemote and propagate commands across network.

[Please refer to our Wiki for insructions.](

Finished portation of project to Arduino DUE and ESP8266 (ESP32 not tested).

Compiled image has been added to compiled/ folder. Flash your Mega 2560

avrdude  -v -V -patmega2560 -cwiring -b115200 -D -Uflash:w:firmware.hex:i

or flash your DUE (need to correct path and port, of course)

/Users/<user>/Library/Arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac -i -d --port=cu.usbmodem1451 -U false -e -w -v -b firmware.bin -R

Note: binary images usually not up-to-date with recent code. The preferred way, to compile and upload firmware to your controller.


(quite big number of libs required. Use git clone to have your local copy in your Arduino libs folder) Please check updates for all dependences.

For patched libraries, appropriate GitHub repo URL provided:

The normal path to find this file in platformio is: .platformio/packages/framework-arduinosam/variants/arduinoduex

Platformio command line build instructions

First of all install platformio framework. Good tutorial for fast start in RUSSIAN.

In linux\OSX you can open terminal, navigate to your programming directory, then

 git clone
 cd lighthub
now prepare project files for your IDE
pio init --ide [atom|clion|codeblocks|eclipse|emacs|netbeans|qtcreator|sublimetext|vim|visualstudio|vscode]

Set custom build flags. first make your own copy of template


then edit, change or comment unnecessary sections and source it


build and upload firmware for due|megaatmega2560|esp8266 board

pio run -e due|megaatmega2560|esp8266 -t upload

Clean pio libraries folder. Try it if you have compilation problem:

rm -Rf .piolibdeps

open COM-port monitor with specified baud rate

platformio device monitor -b 115200

Custom build flags

  • MYCONFIGSERVER= address of external JSON-config * WATCHDOGTICKERDISABLE disable wdt feature * USE1WPIN=49 use direct connection to 1W devices on 49 pin, no I2C bridge DS2482-100 * SDCARDINSERTED enable sd-card support and fix lan starting * SERIALBAUD=115200 set baud rate for console on Serial0 * Wiz5500 Use Wiznet 5500 library instead Wiznet 5100 * DISABLEFREERAMPRINT disable printing free Ram in bytes * CUSTOMFIRMWAREMAC=de:ad:be:ef:fe:00 set firmware macaddress * DMXDISABLE disable DMX support * MODBUSDISABLE disable Modbus support
  • OWIREDISABLE disable OneWire support * ARTNET_ENABLE Enable Artnet protocol support * CONTROLLINO Change Modbus port, direction pins and Wiznet SS pins to be working on Controllino # Default compilation behavior: * Config server: * Watchdog enabled * 1-Wire communication with DS2482-100 I2C driver * No SD * Serial speed 115200 * Wiznet 5100 (for MEGA & DUE) * Free Ram printing enabled * de:ad:be:ef:fe:00 * DMX support enabled * Modbus support enabled * OneWire support enabled * Artnet disabled * Defailt MQTT input topic: /myhome/in * Default MQTT topic to publish device status: /myhome/s_out * Default Alarm output topic /alarm If you've using Arduino IDE to compile & flash firmware, it will use Default options above and you will not able to configure additional compilers options except edit “options.h” file
lighthub.txt · Last modified: 2019/02/17 15:05 by admin