Friday, April 22, 2016

Architecture of my Homy IoT platform

Since I received a lot of questions about the my IoT home control system, here is a description of it.

All the ESPs are sending  MQTT messages to an MQTT broker (I have an ESP8266 acting as a broker) inside the house. The MQTT broker is also bridging all the data to another MQTT broker instance that I have in a cloud.  From now there are two cases:

1. If I am in my WiFi coverage, my mobile app is connecting over the websokets to the MQTT broker and sees all the devices, control them etc.

2. If I am not in my Wifi coverage my mobile app is connecting to the cloud MQTT broker over websockets and sees all the devices, control them etc.

I've chosen to have connection between the mobile application and both MQTT brokers, instead to have one connection to the cloud broker, because if you are at home and your internet connection is down you can not control any device. Having a connection directly to your home MQTT broker is covering this scenario.

The mobile application first is connecting to the local MQTT broker and if is not succeed ( means you are not at home) it connecting to the cloud MQTT broker. This is done automatically and is transparent to the user.

As you can see no port forwarding, nothing to do in your router.

My IoT home control system

Thursday, April 21, 2016

Mqtt broker on ESP8266 #3

[Later edit]. On iotcentral.eu you will find instructions on how to install the ESP8266 MQTT broker on your EPS8266 and how to use the MQTT service provided by iotcentral.eu

Good news today !! In my previous post I've said that I'll add the noPoll for websockets, but I've decided that will be better to write my own websocket part. And it works !!! 


So, to recap what I have for now on this ESP8266 module:



  • MQTT broker functionality
  • Bridging data to/from and another MQTT broker ( usually a cloud MQTT instance)
  • websockets connectivity ( I can now connect with my Homy application directly to the ESP8266 acting as an MQTT broker)

To do list:

  • webconfig interface.  Done!

Previous posts:



Thursday, March 10, 2016

Mqtt broker on ESP8266 #2

[Later edit]. On iotcentral.eu you will find instructions on how to install the ESP8266 MQTT broker on your EPS8266 and how to use the MQTT service provided by iotcentral.eu 

 Working on MQTT broker on ESP8266 has reached the first milestone. Until now functionality  includes MQTT broker and bridging to another instance of MQTT broker cloudmqtt.com or mosquitto. It should work also on AWS IoT but I didn't tested yet.


After more then one million of seconds uptime and hundreds of thousands of transported messages I can declare it in 1.0 version.


Next to implement:


  • websocket server using the noPoll   my own library (work in progress  Done )
  • web interface configuration 






Sunday, February 14, 2016

E-ink display Part III

I am finished the ESP8266 connectivity to my E-ink display. 

At the end the module will stay in low power and every 10 minutes will do:

1.Measure the battery level
2.Measure the temperature from DS18B20 
3.Publish the temperature to the thinkspeak account
4.Publish the ip address, SDK version, B/G/N connectivity, it type as JSON over MQTT
5.Publish the temperature as JSON over MQTT on the temperature topic 
6.Read the current time and show it on E-ink display 
7.Go to sleep for another 10 minutes.


*In the next video the last line instead of MQTT broker address it is the Time (I will make another video and I'll replace the current one)



The purpose of this is to have a mobile device that can be moved around the house to publish temperature to my chronothermostat (of course ESP8266 based).

During the heating time device will update itself every minute otherwise every 10 minutes.

The chronothermostat will have an PID controller that will receive temperature from my module.


Github code can be found  here. Cheers.


E-ink display Part I
E-ink display Part II











Tuesday, February 2, 2016

Mqtt broker on ESP8266 #1

[Later edit]. On iotcentral.eu you will find instructions on how to install the ESP8266 MQTT broker on your EPS8266 and how to use the MQTT service provided by iotcentral.eu

First tries on Esp8266 with MQTT broker.

I was able to send and receive up to 1000 messages in few seconds before the heap run out.

Next to do is to optimize the memory usage, use a memory pool allocator, do some profiling to determin the optimum values for memory chunks....a lot of work to do.

Then do the bridging  (bridgind is done and is working fine)  and websockets, if there is any memory left.




And a video with 1000 messages sent from and to my phone using ESP as broker. Don't forget that there are very small messages.