This post describes the control panel developed with a few open source software and libraries. The main purpose is to have a proof of concept that the various components can be put together to become a useful product.
I have built a smart home system controlled using Openhab and the hardware switches are primarily using Sonoff switches with Tasmota firmware. The switches are controlled using Openhab Habpanel using an Android Tablet. Generally, this is my preferred way of using the Android Tablet but the Arduino control panel is developed so that it can interface to external hardware at low cost.
The control panel is developed using ESP-Link firmware with the El-client APIs and the hardware is an ESP8266 and Mega2560 combi board. Besides acting as a touchscreen based on/off switch, it is also an internet clock (ntp) and a doorbell buzzer.
The software/firmware/libraries are
There are some comments on the current version of EL-client library and ESP-link firmware that I am using.
Occasionally, the MQTT disconnects and the callback will be triggered. The reconnection back to MQTT broker sometimes is not reliable. My way of handling is to trigger a soft reset at the Mega 2560 to re-init the Mega and reconnect to MQTT. So far I have not found a more graceful way to handle reconnect.
Sometimes, the MQTT message is not received when I switch on/off my light directly or via Openhab Habpanel. To work around, every minute (there about), I send messages to inquire about the status of the switches. At the same time, update the clock to display the correct time.
One of the observations I have made about ESP-link and el-client for MQTT library is there seems to be a limit to the number of topics it can respond to concurrently. When I have subscribed to 6 topics and concurrently sent messages to all the topics, only the first 4 topics received the messages.
Please leave your comments for the suggestion for improvement.
Update (9/9/2018)
The Control Panel MQTT message handling has been changed. On the Openhab side, I have put in a new rule to trigger the Control Panel when there is state change on any of the switches. The Control Panel will receive the message as "XXXXXX" where X can be 0 or 1. The 1st X is the status of switch 1, 2nd X is the status of switch 2 etc.
This has solved one of the ESP-link and EL-client whereby when the client subscribed to multiple queues and messages arrived at the same time, the client only pick up some of the messages.
I have built a smart home system controlled using Openhab and the hardware switches are primarily using Sonoff switches with Tasmota firmware. The switches are controlled using Openhab Habpanel using an Android Tablet. Generally, this is my preferred way of using the Android Tablet but the Arduino control panel is developed so that it can interface to external hardware at low cost.
The control panel is developed using ESP-Link firmware with the El-client APIs and the hardware is an ESP8266 and Mega2560 combi board. Besides acting as a touchscreen based on/off switch, it is also an internet clock (ntp) and a doorbell buzzer.
The software/firmware/libraries are
- ESP-Link
- el-client APIs (interface to ESP-Link firmware
- MCUFriends Arduino library to control the TFT screen.
- JOS menu system (adapted the concept and heavily modified the source code)
- Starwars theme doorbell tone source code
Supporting System
The source code is available on GitHub. This is the preliminary release and the source code needs further cleanup.- Openhab 2.0 running on Raspberry PI.
- Mosquitto MQTT 3.1.1
Hardware
- ESP8266 Mega2560 Combi board (this can be bought from Aliexpress or Banggood).
- Arduino 2.8" touchscreen TFT (this can be bought from Aliexpress or Banggood).
- Passive Speaker for the buzzer
- External Antenna
I found a nice 3D casing in Thingiverse. The case design has some minor imperfections and I do not have a 3D printing skill to modify the design. I have also outsourced the printing to 3rd party and I am satisfied with the final output.
I have 2 different 2.8 inch touch screens and one of them requires me to invert the colour when using the MCUFriend library. The built-in antenna for the combi board is not very sensitive and resulted in frequent dropped connections. I have connected an external antenna and the result was quite good. The connection to MQTT server is faster and there are less dropped connections. The details can be found in my other post.
I have 2 different 2.8 inch touch screens and one of them requires me to invert the colour when using the MCUFriend library. The built-in antenna for the combi board is not very sensitive and resulted in frequent dropped connections. I have connected an external antenna and the result was quite good. The connection to MQTT server is faster and there are less dropped connections. The details can be found in my other post.
There are some comments on the current version of EL-client library and ESP-link firmware that I am using.
Occasionally, the MQTT disconnects and the callback will be triggered. The reconnection back to MQTT broker sometimes is not reliable. My way of handling is to trigger a soft reset at the Mega 2560 to re-init the Mega and reconnect to MQTT. So far I have not found a more graceful way to handle reconnect.
Sometimes, the MQTT message is not received when I switch on/off my light directly or via Openhab Habpanel. To work around, every minute (there about), I send messages to inquire about the status of the switches. At the same time, update the clock to display the correct time.
One of the observations I have made about ESP-link and el-client for MQTT library is there seems to be a limit to the number of topics it can respond to concurrently. When I have subscribed to 6 topics and concurrently sent messages to all the topics, only the first 4 topics received the messages.
Please leave your comments for the suggestion for improvement.
Update (9/9/2018)
The Control Panel MQTT message handling has been changed. On the Openhab side, I have put in a new rule to trigger the Control Panel when there is state change on any of the switches. The Control Panel will receive the message as "XXXXXX" where X can be 0 or 1. The 1st X is the status of switch 1, 2nd X is the status of switch 2 etc.
This has solved one of the ESP-link and EL-client whereby when the client subscribed to multiple queues and messages arrived at the same time, the client only pick up some of the messages.
Thank you so very much for sharing this valuable information. If you are looking for make your home super smart, contact Softlogic Australia for the best Smart Home System in Melbourne.
ReplyDelete