📜 ⬆️ ⬇️

Another device for a smart home


Introduction


Pursuing home automation over the past three years, I try to keep track of all the new devices in this area. Recently, the exhibition caught the eye of a new device of domestic production. Searching the Internet, I did not find any information about them. I thought strangely and decided to contact the manufacturer (I will not indicate it). After talking, I managed to get a test sample for a month. A month later I decided to share my impressions about this product.

Description from the manufacturer


According to the manufacturer, the device under study is a platform that allows you to create automated systems for monitoring and managing infrastructure facilities. The platform allows you to develop both centralized and distributed systems, including connecting any smart devices, and the functional features of the system are determined by the installed software.

The manufacturer claims the following characteristics of the device:
CPU• CPU: Allwinner H5 Quad-core 64-bit Cortex A53
• RAM: 1GB
• Storage: 8GB eMMC, MicroSD card
operating system• Linux Debian or Ubuntu
Communications• Network: Gbps Ethernet
• WiFi: 802.11b / g / n
• Bluetooth: 4.0 dual mode
• Radio: 2.4 GHz
• 2 x USB Host
• 1 x RS485
I / O Ports• 4 “dry” contacts 350 v / 120 mA
• 4 outputs 12 v / 1A
• 4 inputs 0 - 12 v
Status indication• OLED display
• LED
Nutrition• DC 12 v

We prepare a client


The device comes in two versions: just “bare” hardware and a ready-made solution with software. I got the first option, but it's even more interesting - there is where to frolic fantasies.

The appearance of the device is rather ascetic:


The housing of the device provides for mounting in a cabinet on a DIN rail and occupies four modules in width.

On the front panel are:


Under the covers are:


All connectors are made under the screw that pleased me, because I do not like clamping. On the right side of the box there are no connectors and controls, which in general can be useful for more dense installation of equipment in the cabinet.

On the left side all connectors are assembled:


WiFi antenna interferes with connecting USB devices and network cable. It should either be turned down or carried to the front of the cabinet with a cable, the second option is probably more correct, thus improving the signal level.

We proceed to the "opening of the patient" (the entire body is assembled on latches, it is easy to disassemble it) and see what it is inside / Open the front cover and see:



We go further - we open the case and see that the device consists of three boards: the main board, the processor board is mounted on it and the “upper” board is connected to it with the front side, the front side of which is described above. We examine them more closely:





On the main board is located:



On the reverse side of the "upper" board installed:


Use and programming


As I said, I got bare iron and had to check the work of the modules and the creation of scripts myself. I didn’t philosophize, Linux took Armbian, and did all the programming in Python - quickly, cheaply and angrily! All microcircuits are well known to a wide circle of radio amateurs; it is easy to find a description and basic applications.

After studying the device formed an approximate list of tasks:

  1. Through the outputs of "dry" contacts connect the contactors 220v. (Get manageable power lines)
  2. To two outputs 12v / 1A and to two inputs to connect standard security and fire sensors. (Get a fire and security system, without access to the remote, but it is often not necessary).
  3. Connect free inputs and outputs, leakage sensors and ball valves with 12 v electric drive. (Get leak protection).
  4. Raise the WEB server and write the management interface (Get remote control).
  5. Check the connection by radio, WiFi and RS485 of additional devices (Check the possibility of building a distributed network).
  6. Check the USB modem.
  7. Check work as a router.



For testing, I quickly assembled a booth and began to amuse myself:

ATtiny13 is already programmed, I did not let her touch be responsible for the power according to the manufacturer's plan.

MCP23017, ADS1115, PCF8574, DS3231, BMP180 - all this works on I2C, so an understanding of the functioning of this bus immediately determines about 80% of the code. Everything started (as expected), since the device addressing is already installed by the manufacturer.

nRF24L01P works on the SPI bus, examples of which are also enough. I contacted a pair of devices on the Arduino, everything works as intended.

RS485 was tested on the Modbus protocol with an Eastron SDM220 electricity meter. Indications are removed, no surprises have arisen.

In USB, I plugged in the Huawei E1550 modem, everything was determined, picked up the vpn client and contacted the home server. Installed a web server and played with remote control.

The WiFi module works in both client mode and access point mode. I switched the module to AP mode, installed a DHCP server, configured iptables and got a WiFi router.

Installing a local Blynk server didn't cause any problems. Checked work with ESP8266. Control from the smartphone works, the readings are displayed.

So, all the tasks are completed, the central device of the smart home is running! It may seem that everything is programmed, adjusted easily and simply, or I am a genius.

I assure you it is not so! I have already encountered the majority of microcircuits and modules, so I attacked the rake earlier and my forehead hurt very much , but the bumps were gone, but the knowledge remained!

The power of the processor module is more than enough to solve the problems I have set; during testing, the average load on the processor did not exceed 15%. The presence of eMMC memory and microSD card will allow to organize the duplication of operating systems and software. Consumption without connecting USB devices is about 300 mA. With this consumption, it is easy to organize uninterrupted power supply from a battery for 5 hours.

The selected element base for the construction of the periphery is quite reliable, which gives confidence for the smooth operation of the device in the 24x7 mode.

The presence of a small number of inputs and outputs on the device itself is completely compensated by the presence of 485 bus and a radio module, that is, building a distributed control system will not be difficult, and the set of inputs and outputs that is on board can be used for local control in the power cabinet.

findings


Will this device, declared by the manufacturer, integrate all smart devices? With some stretch, you can say that you will. But unfortunately, there is not enough radio module for 433 MHz, CAN-bus, ZigBee support, but the presence of RS485, radio module at 2.4 GHz and WiFi will allow you to connect a sufficient number of devices, and the interaction protocols can be implemented programmatically.

I repeat, the device under consideration is produced in two versions: a completely ready-made solution for building a distributed control system and only “hardware”. In my opinion, you can buy a ready-made solution only if you do not want to deal with programming and laziness. In other cases, it is much more interesting to take the platform and program it for yourself.

The cost of the device is currently unknown to me. In my opinion, if the manufacturer does not drive the price more than 13 tr. for the "bare" version, then this device is quite interesting to purchase. Having bought all the parts in China and packaged it in a single case, you are unlikely to get cheaper.

The competitor may be Wiren Board 5 . He wins in the number of ports and possible interfaces, but loses in the power of the processor module. This does not affect standard tasks in any way, but installing a Blynk server locally or making a voice control module can be problematic. If anyone tried to do this on WB5, please comment in the comments.

PS: Having already finished the article, I also found the ATSHA204 cryptography chip on the board. It supports the SHA ‑ 256 cryptographic algorithm and is well suited for symmetric authentication tasks. Well, this is quite for Geeks!

Source: https://habr.com/ru/post/410597/