Unicontrol Basics Part 1 – Intro to the System

The unicontrol software was developed as a small intelligent control system tailored-made for ESP8266 modules and primarily intended for our ESPtronic V1.2 board. It is however, also possible and very effective to use it for a number of ready-made control units from most manufacturers equipped with the ESP8266 module. This includes industrially used components such as SONOFF modules and the like.

It is possible to upload the unicontrol program to the integrated module in the given device of another manufacturer as well as to a brand-new ESP8266. Of course, in these cases, the hardware of these units will be used within the scope of our programs, and in most cases, its usability will increase. In the vast majority of cases, this will turn the unit into an intelligent control system with higher added value. There are so many such components on the market that it is impossible to cover them all. A large number of modules with an integrated ESP8266 can also be bought very cheaply from Banggood, Amazon, eBAY, AliExpress or any other online store.

ESP8266 4relay

The basic shortcoming of the vast majority of offered IOT components fitted with ESP8266 is that while it is possible to remotely control the outputs (mostly relays…), it is not possible to make automated decisions based on the measured values at the inputs.

Controlling via the phone, Google Alexa or other systems is nice to look at, but it does not rid the user of the necessity to manually give the instruction. For example, turning on an interior light without the user’s presence makes no sense in most cases. Switching on a kettle, a vacuum cleaner, a refrigerator or other appliances presented in individual product brochures may be useful, but the real added value remains inaccessible.

On the other hand, the provision of automated services by third parties is mostly charged. Our system does not need any external intermediary. Once configured, everything works autonomously and automatically.

ESP 1relay

Basic description

The unicontrol software has built-in handling of various types of digital and analog sensors. This predestines it for a wide variety of uses without the need of any third-party hardware or software. Inputs in the next editions of the unicontrol program will be systematically supplemented with sensors of various sizes. To expand the use of analogue inputs, it is possible to easily define a custom conversion table directly in the program interface, according to which the measured value will be converted to the values in the desired unit. In this way, it is possible to connect any analog sensors to the system. ESP8266 naturally comes with a single AD-converter. To increase the number of analogue inputs up to 8 independent pins it is possible to utilize an Analog Multiplexer.

Peripherals

By configuring the ports in the program menu, the behavior of individual input and output pins can be defined according to the capabilities of the ESP8266, your own needs and the configuration of the hardware used. The program will then use the pins as defined.

The possibilities of using the program are extensive and will be covered in the follow-up articles, including various setting techniques for its use. Online instructions with a detailed description can be found at this link. The unicontrol program uploaded to the ESP8266 needs to be configured as the first step. Subsequently the user may define processes which determine the device’s ultimate behavior. The interface for unicontrol configuration and programming is part of our website at this link and is also accessible as a mobile app available in Googe Play.

The unicontrol software is available in three performance versions that only differ in the number of processes that can be set:

  • The lowest version with five processes ayatec_unicontroll_1.xx_MINI is intended for the simplest applications with not much more that one inputs and one outputs.
  • The golden mean with fifteen ayatec_unicontroll_1.xx_HOME will satisfy most simple to moderately complex control tasks.
  • The most powerful version of the ayatec_unicontroll_1.xx_PRO program can fully transform our ESPtronic V1.2 board to a small control station with many useful functions. There it is possible to define up to forty independent processes, each capable of virtually limitless combinations.

The versions of the programs do not differ in any way except for the number of processes.

Wiring diagram

Before deploying the unicontrol program in the PCB, it is necessary to have available the wiring diagram of the module with the installed ESP8266, which we intend to control with the program. Or at least we need to know the connection of individual ports to outputs. It is also possible to make your own connection design or create the desired control system configuration. With our ESPtronic V1.2 board. it is possible to make such a custom hardware configuration as is required for the proposed deployment.

ESPtronic V1.2 board it has several connection points on it, with which it is possible to modify the configuration with jumpers. If necessary, it is also possible to achieve the desired connection with wire jumpers. Subsequently, after uploading the program, we must correctly configure the inputs and outputs in the Peripheral menu according to this connection. Only after these actions is it possible to set individual processes according to how we want the inputs to behave and the outputs to react to the measured values.

Interface

Setting up the entire system to work according to the proposed requirements takes place using the web interface. The insterface is using predefined lightweight protocols to grant full access to the unicontrol-carrying ESP8266. By default, the set-up takes place by opening the website on a local computer or over our Online web interface. When accessing the interface through our website, it is necessary to unblock bypass the browser security. For example, in the Chrome browser, it is necessary to enable the option in “chrome://flags/” in the “Insecure origins treated as secure” section and write in the box the IP address of the device that we need to set-up.

The reason for this is that while the webpage download is protected with an SSL layer, the subsequent, exclusively local, communication with ESP8266 is not, automatically violating the CORS requirements. Please note that this step is not needed when using an offline interface or a mobile app.

From this moment it is possible to connect to the module and set it up. However, the website is only used for configuring and setting processes. The actual running of the program does not need this page or the Internet itself for its operation. Of course, unless it is further controlled externally via MQTT.

The interface is divided into three columns. The main menu of the entire interfaceis found on the left-hand side, used to navigate through various contents. The center part displays the main content and is used to configure all accessible parameters of the program. The right-hand side then contains connection details of the current live session. The menu and appearance of the current version of the website may differ from the image below, as the site is still being edited and improved.

Individual program menu

Processes

The Processes menu lets you set up the parameters of the program, input and output ports and their configuration according to which it is to be decided how they should behave. “process_xx” usually means that the process has not been defined yet. Each process can bear a name of your choice. The length of the string is limited to 13 characters for capacity reasons.

processes

Peripheral

The purpose of the Periheral settings is to define the behaviour and designation of all hardware peripherals. Before a hardware pin can be addressed as an Input or Output, it needs to be defined in a way that best describes the hardware device connected to it.

Setting the configuration of the hardware used. This step must be done first before the actual programming of the processes. After the required configuration is set, the menu of processes and usable ports is automatically adapted to the allowed configuration.

peripheral

Wireless

In the Wireless menu you may set-up the wireless connection to your Wi-Fi access point and to your preferred MQTT broker. Although neither is essential for operation, both greatly contribute to the user experience and overall capabilities of the unicontrol. Also do not forget to learn about unicontrol internet security .

Please note that ESP8266 cannot connect to hidden networks_even if all parameters are entered correctly.

wireless

Device

In the Device menu you may display or change the basic device and internet security details.

device

System

In the System menu the user may obtain useful information about the device’s operation.

system

Conclusion

This first of the articles only scratches the surface the basic possibilities of our ayatec unicontrol program. In the next installment, uploading the program to the ESP8266 and basic Wi-Fi and MQTT connection settings will be described in more detail.

DOWNLOAD UNICONTROL