Soft-Eliot

From Eliverse Wiki
Jump to: navigation, search

Overview

Soft-Eliot is the software part of Eliot Open Source IoT platform.

NodeMCU Development

Soft-Eliot uses NodeMCU firmware for ESP12E Wifi Module. It has many advantages however the best part of ESP12E is its price. NodeMCU Lolin board is an Arduino killer with its built-in Wifi, processor speed of up to 80 Mhz, large Flash Memory to enormous data compared to Arduino and easy scripting environment based on Lua.

You can order Lolin development boards from Amazon or Aliexpress using the following links:

AliExpress

Amazon

Getting Started

Flashing ESP12E

Lolin has a built-in memory which varies between 1 MB to 8MB. All modules and versions have different memory sizes. When you buy a Lolin, it has no firmware on it. First, you need to Flash Lolin using one of the NodeMCU firmwares. NodeMCU firmwares are actually compilation of libraries build for ESP12E hardware. Below you can download the build used in Eliot Mother Module. After downloading the build, you need a Flasher tool to upload NodeMCU firmware on the module.

ESP8266 Flasher

NodeMCU Firmware for Eliot

After downloading ESP8266 Flasher and NodeMCU Firmware, go to folder where you have downloaded both files and open up ESP8266 Flasher tool. Go to the Config tab and select the firmware .bin file you have downloaded. Adresses are quite important. If you have 4MB Flash version (the most common) of Lolin development board, you can use exact values seen on Image 1A. For other Lolin and ESP versions with different Flash sizes, please visit NodeMCU and Lolin project pages for further information.

Image 1A

Lua Development

After successfully flashing ESP12E, you will now be able to connect to it and start testing it. To connect to ESP12E, connect USB cable to Lolin development board. Lolin development board uses USB-Serial converter chip and once you connect, it should appear as a new COM port on your computer. Locate COM port number. You will be using it to connect to ESP12E.

Next, download ESPlorer Application from the link below. ESPLorer is a great tool to start development on all ESP based development boards.

ESPlorer Download

Extract the contents of zip file to a folder of your choice. Once extracted, click Esplorer.bat file to open Esplorer.

Image 1B

On the right pane, select the COM port of Lolin development board and click connect.

If you can not connect successfully and a time-out occurs, try pressing "reset" button on Lolin development board after clicking "Connect".

On the left pane, you will start development in Lua language. Lua is quite easy and event driven language with very high performance. You can write your scripts and send to NodeMCU on the fly. You may have different Lua scripts located on file system of NodeMCU and you can call or include them during runtime. Unlike Arduino, where you need to compile, send and burn to AVR program EEPROM, Lua scripts are interpreted or compiled during runtime, making development and debugging quite easy.

To learn more about Lua scripting and packages available in NodeMCU firmware, visit NodeMCU Official Web Page.

Lua Modules

Soft-Eliot includes libraries for connecting to OpenHAB server and control Eliot devices on the fly. There are 6 modules readily available. These are:

  • Mother Module
  • RGB Led Controller Module
  • Relay Controller Module
  • PIR Sensor Module
  • Display Module
  • RF Switch Module
  • Gas Detector Module
  • Temperature & Humidity Module

OpenHAB Server

OpenHAB is an open-source Smart Home Application Server. It contains all necessary functionality to power up a smart home application. OpenHAB can be installed on premise, or even on Raspberry Pi or a remote server that you have rented from a VPS provider.

Soft-Eliot utilizes OpenHAB as the application server. Eliot devices connect to OpenHAB instance, whether installed on infrastructure server or a remote server. OpenHAB also offers mobile application for Android and IOS to manage devices connected to OpenHAB over network or Internet.

Eliot devices connect to OpenHAB server via MQTT protocol. MQTT protocol is a full-duplex, lightweight and full-duplex instant messaging protocol. It works like legendary IRC server. Clients connect to MQTT server and subscribe to topics. If a client sends a message to any topic (like a chatroom), every other client subscribed to that particular topic receive the message.

NodeMCU board or ESP12E module in particular connects to MQTT server over WiFi and subscribe to necessary topics and start sending and receiving messages to OpenHAB server over MQTT Server.

OpenHAB has a well documentation on its website. If you want to learn more, please visit OpenHAB WebSite.