Go Down

Topic: ESP8266 Smart Home with Android and openHAB (Read 137 times) previous topic - next topic

veseo

Hi,

we have just ported Souliss on ESP8266, see below the screenshot of the Android application SoulissApp.



Here a sample sketch to run togheter with the Souliss library, I strongly suggest to download the whole IDE that contains the Arduino cores for ESP8266 that we have tested from this link.

Code: [Select]

 /************************************************************************** 
   Souliss - Hello World for Expressif ESP8266 
   This is the basic example, create a software push-button on Android 
   using SoulissApp (get it from Play Store).   
   Load this code on ESP8266 board using the porting of the Arduino core 
   for this platform. 
 ***************************************************************************/ 
 // Configure the framework 
 #include "bconf/MCU_ESP8266.h"       // Load the code directly on the ESP8266 
 #include "conf/Gateway.h"          // The main node is the Gateway, we have just one node 
 #include "conf/DynamicAddressing.h"     // Use dynamic addressing 
 #include "conf/DisableEEPROM.h" 
 // Define the WiFi name and password 
 #define WIFICONF_INSKETCH 
 #define WiFi_SSID        "mywifi" 
 #define WiFi_Password      "mypassword"   
 // Include framework code and libraries 
 #include <ESP8266WiFi.h> 
 #include "Souliss.h" 
 // This identify the number of the LED logic 
 #define MYLEDLOGIC     0         
 void setup() 
 {   
   Initialize(); 
   // Connect to the WiFi network and get an address from DHCP 
   Setup_ESP8266();               
   SetAsGateway(myvNet_esp8266);    // Set this node as gateway for SoulissApp   
   // This node will serve all the others in the network providing an address 
   SetAddressingServer(); 
   Set_SimpleLight(MYLEDLOGIC);    // Define a simple LED light logic 
   pinMode(5, OUTPUT);         // Use pin 5 as output   
 } 
 void loop() 
 {   
   // Here we start to play 
   EXECUTEFAST() {             
     UPDATEFAST();   
     FAST_50ms() {  // We process the logic and relevant input and output every 50 milliseconds 
       Logic_SimpleLight(MYLEDLOGIC); 
       DigOut(5, Souliss_T1n_Coil,MYLEDLOGIC); 
     }   
     // Here we handle here the communication with Android 
     FAST_GatewayComms();                     
   } 
 } 


This tiny sketch handle the communication with SoulissApp and control a relay (we have tested on Olimex ESP8266-EVB) on GPIO5.

Is just the simplest example, you can mix multiple ESP and control them from a central point, either SoulissApp or openHAB and have a network that contains also Arduino based on ATmega AVR that use 2.4 GHz radio like nRF24L01 and RFM69 or RS485 communication.

Have a try, and share your ideas!
Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

veseo

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy