Smart home python. Online web interface designer for managing Raspberry Pi. What Raspberry can do and how it works

Hello, friends

In my reviews of smart home devices from the Xiaomi ecosystem, I have already mentioned the name Domoticz several times. Finally, I got around to sharing my work on this topic, and telling what it is and how you can complement the standard capabilities of a smart home from Xiaomi using this system. It’s impossible to tell this in one review, but you have to start somewhere - let’s go...

Introduction - a few words about Domoticz

1. What is Domoticz?
This is a multi-platform software with open source focused on creating a smart home control system. Supports a large number of various devices from different vendors, including works with Xiaomi devices.
2. Which Xiaomi devices can be controlled by Domoticz?
I will only talk about those devices that I have personally tested. At the moment, you can control the Xiaomi Gateway - and all the devices it controls - buttons, opening and motion sensors, ZigBee sockets, Aqara switches. Yeelight lighting gadgets are also supported - RGBW and White lamps, Celling Light ceiling lamp.
I read about working with miflora bluetooth sensors.
3. Why do I need Domoticz?
The system has more flexible options for setting up scenarios - for example, checking the activity of the device, something that is not in MiHome, or creating variables - which allow one condition - for example, pressing a key - to perform different actions, depending on the value of the variable.
Scenarios created in Domoticz do not depend on Chinese servers or Internet availability.
Domoticz expands the functionality of devices - for example, new actions “free fall” or “alert” for a cube, or “Long Click Release” for a button.
4. If I use Domoticz, will I not be able to work with MiHome?
Both systems live perfectly in parallel - the functionality of MiHome is completely preserved, it’s just that some of the scripts will live in one system and some in the other. In principle, all scenarios can live in Domoticz.
5. Why do I need MiHome if I use Domoticz?
At least for adding new devices. The choice is yours - but my opinion is that at the moment Domoticz is best used as an addition to MiHome
6. What is needed to connect Xiaomi devices to Domoticz?
I want to reassure you right away - there is no need for soldering irons, programmers or dancing with tambourines. Also you don't need Linux or virtual machines- you can try everything right on your working Windows, and if you like it, then it makes sense to allocate a separate hardware platform for it, for example, the hero of today’s review.
Literally after the first successful experiments on my desktop PC, I got excited about the idea of ​​a separate hardware base for Domoticz. I decided on the Raspberry Pi Model 3 B - a compact but powerful single-board computer based on a BCM2837 SoC processor with 4 Cortex-A53 cores, operating at a frequency of 1.2GHz, 1GB of RAM and Wi-Fi and Bluetooth 4.1 wireless modules. .

Set

I included 4 items in my order -

Payment screen


Raspberry Pi Model 3 B Motherboard -
What’s interesting is that the store has two modifications - Chinese and English. At the time of purchase, the Chinese one was $7 cheaper, so I took it. What is Chinese there is honestly a mystery to me.
Case for Raspberry Pi Model 3 B -
Power supply HN - 528i AC / DC 5V 2A -
Copper heatsinks for Raspberry Pi -
For a complete set you will also need a microSD card - at least 4 GB and an HDMI cable. I had both a cable and a 32 GB card in my stash, so I didn’t buy it.

What's in the package

After the allotted time - just over two weeks, the courier brought the parcel with my order.


Let's take a closer look. Power supply with Type C plug and micro-USB connector.


The declared maximum current is 2A at a voltage of 5V.


Test switching on with a load of 2A shows some voltage drop, but within acceptable limits, the power supply is more or less honest.


A set of three copper radiators in a bag for passive cooling.


All radiators have a square shape, two radiators with pins and a side length of about 12 mm and one flat with a side length of about 15 mm.


The case is made of dark plastic with an embossed image of a raspberry on the lid.


Case dimensions - approximately 90 by 65 mm




The case is disassembled into 5 parts - everything is held in place by latches, no screws.


The accessories are finished - it's time to move on to the most important thing
RASPBERRY PI 3 MODEL B
Raspberry Pi 3 Model B is the direct successor to Raspberry Pi 2 Model B. The board is fully compatible with its predecessor, but is equipped with greater performance and new communication tools:
64-bit quad-core ARM Cortex-A53 processor with clock frequency 1.2 GHz on a Broadcom BCM2837 single-chip chip; built-in Wi-Fi 802.11n and Bluetooth 4.1.
In addition, the processor has ARMv53 architecture, which means you can use your favorite operating system: Debian Wheezy, Ubuntu Mate, Fedora Remix and even MS Windows 10.


Technical specifications more details
CPU - Broadcom BCM2837, ARM Cortex-A53 Quad Core, 1.2 GHz
Number of processor cores - 4
GPU - VideoCore IV 3D
RAM - 1 GB
Storage - microSD
Networking capabilities
Ethernet 10/100
WiFi 2.4G 150 mb/s
Video output - HDMI
USB ports - 4
Wireless capabilities - Bluetooth
Audio output - 3.5 Jack
85.6 x 53.98 x 17mm, 45 grams


The box contains documentation and a quick installation booklet - by the way, on English language, as well as a bag of thick brown paper with a computer.


On one of the long sides of the computer there are micro USB ports for power, a full-size HDMI port, CSI-2 Camera port - for connecting a camera via the MIPI interface, and a 3.5 mm audio jack. Also on the top side there is a processor module and an Ethernet/USB Hub lan9514-jzx


On the front side there are 4 USB port and Ethernet port


On the other side of the motherboard there are 40 general purpose input/output (GPIO) pins.


On the second end side there is a DSI Display Port for connecting a standard display


On the bottom side of the board there is an LPDDR2 SDRAM memory module - EDB8132B4PB-8D-F


And a micro-SD slot for a memory card


Copper heatsinks are placed on the USB/Ethernet Hub and the processor on one side


And on the memory chip on the other. This heatsink is flat - does not interfere with the installation of the computer board in the case


Everything fits into the case perfectly, there are no screw connections - it sits on plastic protrusions.


All cutouts on the case exactly match the computer connectors




To start, we need an external monitor (TV) with an HDMI input, USB keyboard, it will be more convenient if the mouse and power supply are the same. A monitor, keyboard and mouse will only be needed at the time of installation, then only the power supply will be sufficient.

Operating system installation

For installation operating system, first of all you need to download the archive with distribution kits - . While the almost one and a half gigabyte archive is downloading, we download the utility for formatting the SD card - SD Card Formatter -. This distribution is much more compact - only 6 MB, so without wasting time, install the program


and, after installation, insert the memory card into the card reader (you have a card reader, don’t you) and launch SD Card Formatter. In the Options menu you need to set “FORMAT SIZE ADJUSTMENT” to “ON”


After waiting for the download of the large distribution to complete, open the resulting archive and unpack its contents onto a freshly formatted flash drive.
The next step is the first launch of the Raspberry Pi (a flash drive with a recorded distribution, of course we install it into it). Sorry for the quality of the next few photos - from the TV screen :(
When you first start it, a menu for selecting the operating system starts - what to install, and the list even includes a version of WIndows 10 for Raspberry Pi. At this stage, you can select the language (at the bottom of the screen) - Russian is available and will connect to Wi-Fi networks- Wi-Fi networks button


The operating system I need - Raspbian based on Linux Debian - is presented in two versions, lite and full, with a graphical interface. I chose the full version


After this, we can calmly go drink tea with bagels; installation will take a long time.


Periodically measuring the temperature during installation, the maximum I saw was 38 degrees.
After the installation is complete and the computer restarts, the Raspbian desktop loads


The only thing I did here was to enable SSH in the settings - in order to manage the system from a desktop PC, I already did everything else through the terminal.


To control Raspberry from a desktop PC, we need any terminal program, I use good old Putty


Default username and password - pi And raspberry. To change the password, use the command passwd.


I recommend immediately setting a static IP address for Raspberry. You can find out current addresses using the command ifconfig , Where
eth0 is Ethernet
lo is local interface 127.0.0.1
wlan0 is the wi-fi interface

And in order to edit the settings file, enter the command
sudo nano /etc/dhcpcd.conf
and in the file that opens, scrolling to the end, add the necessary settings depending on which interface we will use.
For example, we want to use the address 192.168.0.222, mask 255.255.255.0, gateway address and DNS - 192.168.0.1
For Ethernet we insert
interface eth0

static routers=192.168.0.1

For wifi
interface wlan0
static ip_address=192.168.0.222/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1


To exit the editor press ctrl+x
To save changes, press “Y” and then enter

Installation of Domoticz
Most of the setup work has already been completed, now we need to install the Domoticz system. This is done with one command -
sudo curl -L install.domoticz.com | sudo bash
Which initializes the process of downloading and installing the system


During the installation process, the installer will ask questions about the installation location, etc. - I left all these points by default.


After successful installation, the installer will write the addresses and ports of the Domoticz system web interface


But, to work with the Xiaomi gateway, we need a beta version of the system. Updating to the latest beta version is carried out using the commands
cd ~/domoticz
sudo ./updatebeta



Now the Domoticz system is available via the web interface:

Now is the time to start adding Xiaomi devices. But first -

Preparatory work

So, what do you need to start working with Domoticz?
IP Address Reservation
The first step is to set static IP addresses for the devices you plan to manage - for now this is the gateway and lamps. This is done on your home router using a DHCP client table that looks something like this -


and information from the Network info tabs of the gateway and lamp control plugins, where the MAC addresses of devices are indicated


Using this information, you need to register the issuance of permanent IP addresses to these devices - since they will be controlled via IP, and if the address is changed, Domoticz will lose contact with it. The address reservation table looks something like this -

Developer Mode

Developer mode must be activated. For the Xiaomi Gateway, you need to go to the menu, select the about option, at the bottom of the screen where the version is written (2.23 for me) - click on it until two new options appear in the menu, they can be in Chinese, in my example - in English. Click on the first of the two - local area network communication protocol, activate the top switch in the menu and write down the gateway password.


For lamps, everything is simpler - you need to install the Yeelight application, if you have not installed it yet, and for each lamp - go to the menu, developer mode - enable

Adding devices

To add devices, go to the Settings - Hardware tab
127.0.0.1:8080/#/Hardware (instead of 127.0.0.1 - the address of your Domoticz)
We select the type of Xiaomi Gateway device, call it something, indicate its IP address, which we reserved on the router, and enter the password received in the developer mode window. Port - it works for me on port 54321. The Domotics wiki describes the connection indicating port 9898


To add lamps, just add the YeeLight LED device - you don’t need to specify addresses, the lamps will pull themselves up.


The sensors connected to the gateway will not all be connected at once; this process may take an hour or more - you need to wait. This is due to the fact that ZigBee devices are activated only at the moment of data transmission. You can push the process a little - by opening and closing windows with sensors, breathing on temperature sensors, turning sockets on and off - in a word, forcing devices to transmit data.

Devices

MUCH more devices will be added than you expect :) A list of them is available on the Settings - devices tab.
127.0.0.1:8080/#/Devices


For example, each temperature and humidity sensor will be added as three devices, separately temperature, separately humidity, and all together. Sockets - a separate socket (controlled device) separately - as an energy consumption sensor. But the gateway has a separate backlight, a separate alarm siren, a separate alarm clock, a door bell and a volume control. In order to add a device to the list of used ones, you need to click the green arrow at the end of the line. Remove from used - blue arrow. We don’t add what we don’t need.
Devices added for use are located in several tabs -

Switches

This tab contains all managed devices
127.0.0.1:8080/#/LightSwitches
Switches, buttons, lamps, etc. Here we can turn on, turn off, and do any actions with devices manually.

For example, select the sound that will sound on the gateway, or the color of the light on an RGB lamp, or the brightness on a white lamp.

Temperature

This tab groups climate sensors - humidity and temperature
127.0.0.1:8080/#/Temperature
At first, they are all called the same, you can determine which one is which by their readings and checking with the Mi Home application, after which they can be renamed accordingly.

Auxiliary

The gateway light sensor is grouped here - although its readings are very strange, as well as energy consumption meters for sockets.
127.0.0.1:8080/#/Utility

Scenarios

To create scenarios, you need to go to the tab - Settings - Advanced - Events. Scripting is available in two versions - block and scripting in the lua language.

Example scripts

When learning to work with Domoticz, it’s best to start with blocks. Here everything is divided into groups and creating scenarios is quite simple. An example of a simple scenario on blocks is turning on the light when motion is detected, and turning it off a minute after the motion sensor switches to off status. After compiling the script, you need to name it, check the Event active: - option to enable it and save it.

Exactly the same script in lua

Examples of using

I will pay more attention to specific scenarios in other reviews; here, as an example, I will give a scenario that IMPOSSIBLE implement in Mi Home, namely, a two-button Aqara switch with disconnecting wires - the left button will work as intended - breaking and connecting a phase, and the right button - not connected to the line (to power the switch, connecting only one of the buttons is enough) - will turn on and off Yeelight lamp, which has no physical connection to the switch.
In this scenario, the status of the Yeelight lamp will be checked, the value of the On or Off switch itself will not matter. If the state of the lamp is other than Off, it means it is working and will be turned off, and if it is turned off, it will be turned on.

With this, I will conclude the introductory part on Domoticz, if the topic is interesting, I will continue, there is still a lot of interesting things.

Video version of the review (2 parts) -



Thank you for your attention.

Good day to all!

For some time now I have been interested in the topic of home automation, or smart home. Since I had never encountered this topic in any way before (like probably many of you who are now reading this article), I spent a fair amount of time educating myself on the Internet. I immediately abandoned expensive “ready-made” smart home systems and decided to make my home automation system on a budget, from scratch and in stages. Since finished projects with step by step instructions I couldn’t find them (designed for absolute beginners) on the global network, so I decided to write this series of articles. Here I will describe in detail and step by step the creation of my specific home automation systems. It should be a kind of guide for those people who themselves want to create such a system, but do not have the necessary knowledge (for absolute beginners). As a result, we will have a ready-made smart home system assembled from scratch.

Since we are talking here about specific system home automation, I won’t tell you how and what I chose from. My system will be based on the MajorDoMo platform (this is software). You can read what it is on the official website of this platform. As a server on which the MajorDoMo platform will be installed, I will use a Raspberry pi 3 model B+ single-board computer with the Raspbian operating system installed on it.

So, let's begin!

I have a new single board computer Raspberry pi 3 model B+, And me First of all, you need to install the operating system on it.

In general, there are many Linux-based operating systems for this computer, but I chose Raspbian- the official operating system for Raspberry pi. If you have the same single-board device, then you can not bother and immediately install the operating system on it along with MajorDoMo by downloading the base image from the official MajorDoMo website. I’ll take a slightly more labor-intensive route and first install Raspbian for myself (since I want to get to know Linux a little better), and then the MajorDoMo smart home platform.

In addition to Raspberry pi, you can choose other single-board computers (or regular computers, laptops, netbooks) and other operating systems for MajorDoMo. In this case, only the installation methods for the MajorDoMo platform may differ from those discussed in this article. Further configuration of the platform itself, I think, will be the same everywhere (but I’m not entirely sure, since I haven’t worked with the platform myself yet, and I think that this issue will become clearer in the future).

To install the Raspbian operating system on a single board computer, we need:

  • MicroSD card volume of at least 8 GB
  • Regular personal computer(laptop) on Windows
  • program (you can download it from the official website).
  • operating system image Raspbian(I chose Raspbian Stretch Lite without a graphical shell, since I will only work with raspberry remotely, you can also download this image from the official website)

The installation process itself is quite simple:

  • We insert a MicroSD card into a regular computer (laptop).
  • Launch the Etcher program.

  • Press the first button Select image, after which the explorer will open, with which we will select the previously downloaded Raspbian image.
  • Next, using the second button Select drive you will need to select our MicroSD card into which the system image will be written. If only one card is inserted into the computer, it will be selected automatically.

  • And lastly, press the button Flash!, after which the Raspbian image is written to the memory card.

All! Now you can remove the memory card from the computer and insert it into the special slot on the bottom of the Raspberry pi.

Our single-plate device is ready to go. To verify this, we will need a TV or monitor with an HDMI input, and an HDMI cable. It will not be possible to connect remotely to raspberry at this stage, since SSH in raspbian is disabled by default (we will deal with this in the next article).

Let's connect the HDMI cable to the HDMI output of the microcomputer and the HDMI input of the TV (monitor).

Now we turn on the TV and supply power to the microcomputer from a regular charger for smartphones with a Micro USB connector. (It is advisable that this Charger was at least 2 A, in case of further expansion of the single-board).

When power is applied, the single board will turn on automatically (there are no power buttons on it). On the TV screen (monitor) we will see the process of loading the operating system. When the operating system boots, we will be asked to enter a username and password to log into the system. (There is no graphical shell in our version, there is only a command line).

Default login - pi, and the password is raspberry.

This is where we end for today.

In the next article we will look at the necessary setup of Raspbian, enable SSH and log into our single board computer remotely.

Spoiler: Since I myself am just beginning to understand smart home systems, and belong to the category of beginners, I ask people with sufficient experience in this matter to be understanding of the possible inaccuracies and flaws of this project. I repeat, I didn’t find a ready-made project for beginners on the Internet (maybe I didn’t look well). There is a lot of information, but it is not collected into a single whole.

More articles:

It is difficult to ignore technological innovations that have long been part of Everyday life. Among such familiar things as the Internet or smartphones, the smart home especially stands out, helping to combine the gadgets used and household appliances V single network for more comfortable and simpler control. It is easy to customize a smart home to suit your own needs by introducing new modules into the network and programming them to perform specified scenarios. The sensors used in the process of controlling the house are triggered:

  • To the sound;
  • On the move;
  • For thermal energy.

Simple sensors are even present in shopping malls, where they monitor the automatic opening of doors and perform other tasks. It may be hard to believe that a smart home can become an integral element of a person’s life, but it is true. To reduce your labor costs and train devices to perform simple functions independently, you only need to implement a smart home project that facilitates all this.

How a smart home works

Automated technology uses software that allows it to perform various tasks. Programs are also used in a smart home, expanding the functionality of its capabilities. To program the operation of the device, you must have certain skills. Therefore, for novice owners best choice will be the use of applications already adapted to the requirements of ordinary users.

When developing a smart home, you can choose from several options. In the first case, a ready-made solution will be used, which will remain installed on site. This option requires a minimum of effort, but its cost is significant. Not everyone can afford to implement such a project. Another solution is to understand the concept itself, which will allow you to create and assemble a smart home yourself in the future.

The work process depends on the correctness of the calculations made by the owner, which leads to lower costs. Assembling a smart home yourself is not difficult if you approach the matter with care and understanding. As a result, this will save money and allow you to gain some skills in handling modules.

Smart home automation process

It is easy to make devices used every day work according to a given scenario if you use the appropriate control unit for this. The Raspberry Pi company has developed a minicomputer that is suitable for solving this problem. The device is compact and efficient, and also makes project automation simple and straightforward. Raspberry is inexpensive, especially when compared with other manufacturers that have presented their products on the market. But this did not stop the company from offering truly high-quality equipment that has become popular. Initially, the company developed two variations of the minicomputer:

  • model A;
  • model B.

Visual design and packaging

These devices are controlled by an ARM11 chipset with a performance of 700 MHz. The differences between the variations are the amount of memory on board. Thus, product B is equipped with a 512 MB RAM bar, which is twice the performance of model A with 256 MB. As a result, the company came to the decision to release both variations simultaneously, especially since minicomputer A had additional advantages. It was equipped with an Ethernet port allowing you to connect to the network. The company continued to work on modernizing its products, rethinking the second version of the computer. This led to the appearance of an improved version B, which became even more compact and also received a stylish design. Among the design developments, it is worth noting the presence of 4 USB connectors, which is 2 times the number of ports of this type for the previous version.

Read also: DIY water leak sensor

The device has proven itself in the field of creating smart homes. The low price makes Raspberry an excellent choice for building an entire project, and the versatility of the minicomputer copes with complex tasks. Automation of devices based on such a unit becomes the best among available solutions.

Raspberry is capable of controlling Z-Wave devices, making it easier to control home appliances. Installing the RaZberry board in a miniPC makes the control unit productive and reliable. Z-Wave represents the modern standard for a smart home made possible through a wireless technology process. As a result, the owner has the opportunity to refuse the use of additional elements and consumables, reducing overall costs. Managing Z-Wave is easy. Therefore, a person who has no practical experience in working on such projects can implement a smart home.

An additional benefit is the ability to upgrade an existing board. So, if there is a decrease in performance, which is no longer sufficient for the modules to operate, then Z-Wave can be upgraded using auxiliary elements, as is the case with improving a standard PC. Performing an upgrade eliminates the need to completely change the device.

Controller from Z-Wave

If the user does not have enough experience or free time to complete the installation, then Z-Wave can offer services for setting up or installing equipment in any region of the Russian Federation. Any questions can be resolved using an extensive database that is freely available, or using technical support. Raspberry has proven itself with the best side and in the field of video surveillance. Using a board and a standard webcam, the user receives a system that is capable of broadcasting an image to the network, regardless of the location of the tracking device. Monitoring an object becomes even easier, since there is no need to constantly monitor the situation. It is enough to track the main events at the end of the work to find out about any incidents recorded by the video camera.

A modern smart home is a multifaceted system that is responsible for performing preset tasks and also provides access to actions that are based on preset algorithms. This makes the project more autonomous and independent of human commands. A smart home independently looks for solutions in difficult situations, based on previous experience.

Designing such a house is not difficult, especially with careful planning. As a result, the owner becomes the recipient of enormous benefits due to his innovations. Having decided on the features of automation, you can significantly reduce time consumption, as well as save energy resources and increase safety for home residents. Convenience is determined by the selected components on which the project is based, so Raspberry will become a reliable assistant in creating a smart home.

Smart home on Raspberry Pi

As is known, many functions performed household appliances, can be automated without much effort, and managing the operation of equipment remotely becomes even easier. Next, the reader can get acquainted with exactly how to develop your project, starting from the capabilities of the Raspberry minicomputer. The main issue will be the development of a controller capable of productively monitoring the lighting in each individual room, as well as adjusting the current temperature readings and other life support parameters in the house. Raspberry Pi will control multimedia equipment, as well as home security elements.

Composition of the control unit

To assemble your smart home, you will first need to purchase all the components included in the minimum configuration:

  • NodeMCU ESP-12E;
  • Volumetric sensor;
  • Temperature sensors;
  • Humidity sensors
  • relay module;
  • memory card;
  • Raspberry Pi 3.

The processor itself, and in this configuration it is the third model, is selected arbitrarily, so another version will be no less efficient and suitable for a smart home. The choice in favor of Raspberry Pi 3 is due to the fact that the unit is equipped with wireless communication modules. You can replace the NodeMCU with an Arduino Nano, or use an auxiliary module for Wi-Fi.

Read also: Siri will soon be able to tailor its responses to the person

The components that make up the control unit must be connected and adjusted. To reduce the cost of time and effort, it will be beneficial to purchase a ready-made solution, like NodeMCU. Power elements are selected in the quantity involved in the project. The presented configuration will require 3 elements. The sensor configuration is determined individually. If desired, you can abandon the volumetric sensor if its use has no logical need.

Installing Raspbian

To complete the OS installation, you will need to visit official page companies where you can always find and download the latest version. Next, the card is formatted to FAT. According to the specified instructions, we build the image for the operating system in use. All that remains is to connect the card to the minicomputer, as well as attach a keyboard and a screen, which can be a TV. The download process usually takes a little time, after which you can start setting up.

This way you can set your own password and other parameters. You should not change the current boot screen setting, since the graphic part will not be used while the smart home is running. Let's move on to changing the host, located in the Hostname item, and also set SSH, which will allow you to manage the device in the future with greater comfort. When all the settings have been applied, all that remains is to reboot the device by clicking Finish.

WIFI adjustment

When the device is restarted, you should go to the interfaces, where the procedure is as follows:

  • We write the command sudo nano /etc/network/interfaces;
  • Finding the part iface wlan0 inet manual and replace this line with iface wlan0 inet static,
  • Don't forget to indicate your own static IP address.

An example of the work done looks like this:

auto wlan0 allow-hotplug wlan0 iface wlan0 inet static address 192.168.1.150 netmask 255.255.255.0

gateway 192.168.1.1 wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf address, netmask, gateway —

but in your case, the setup must take place under your own router.

The next step is to go to the supplicant, where you should specify the following command

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

The window that opens allows you to enter all the necessary settings for the wireless network.

Example settings:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

network=( ssid=”your SSID » psk=”your password”)

sudo ifdown wlan0

The process will be completed, after which it remains to specify

sudo ifup wlan0

waiting for the reboot caused by the command to complete

sudo reboot

Provided that all operations are performed correctly, we end up with a fully configured wireless network, to which the device is switched at startup.

Minicomputer update

Before starting further adjustments, you should deal with the system upgrade. The sequence is not complicated:

  • enter sudo apt-get update sudo apt-get upgrade;
  • check the current version with the command g++-4.9 –v and check with the current one;
  • if the version you are using is outdated, then enter sudo apt-get install g++.

Let's move on to installing NODE.JS. This program, starting from the fourth version, supports ARM. In order to install NODE.JS, you will need to set the sequence of commands:

  • curl -sL https://deb.nodesource.com/setup_6.x;
  • sudo -E bash - sudo apt-get install -y nodejs;
  • To check the current version, enter nodejs –v.

Installing HOMEBRIDGE

The first step is to install Avahi and other components that will be required for MDNS to work. Go to the command line and start entering the following sequence

  • sudo apt-get install avahi-daemon avahi-discover libnss-mdns libavahi-compat-libdnssd-dev;
  • sudo npm install -g --unsafe-perm homebridge hap-nodejs node-gyp;
  • cd /usr/lib/node_modules/homebridge/;
  • sudo npm install --unsafe-perm bignum;
  • cd /usr/lib/node_modules/hap-nodejs/node_modules/mdns;
  • sudo node-gyp BUILDENGINE=Release rebuild.

For testing purposes, perform a test run with the homebridge command, and in response you should expect something like this:

config.json (/home/pi/.homebridge/config.json) not found.

Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

│ 031-45-154 │

Homebridge is running on port 44278

If something similar was obtained, the previous commands were executed and applied correctly. As you can see from the example, the program was unable to detect config.json, which means that you will have to create it yourself:

  • sudo -i;
  • mkdir /root/.homebridge;
  • touch /root/.homebridge/config.json.

The system is very simple, it allows control over the network (external or local) GPIO pins configured for output and receive their status (that is, see what is on and off). Send any commands that can be processed inside Raspberry. Get the state of GPIO pins (specified as 0 or 1) configured to enter. The designer will automatically configure the GPIO pins you need for input or output.

If you need a more flexible system, then it is better to use the previous one.

The user only needs to assemble the interface in the designer, download the archive with files and unpack it on his RaspberryPi 2.
The archive will contain ready-made files related to the web part (html, css, js), sh-script for initializing pins and server for data exchange Home stD Rp . Installing any additional programs not required.

Despite the seeming complexity, everything is very simple and will take 10-15 minutes.

Appearance

Introductory part.

As already mentioned in the previous one, the idea of ​​a web interface is quite simple and in some ways even ascetic. This is due to the fact that I didn’t like the drawn rooms with light bulbs and other half measures, so I chose the “TV remote control” style.

Works on any device - computer, laptop, tablet, mobile phone.


Main interface screen. There can be up to five rooms.

On the main screen there are buttons with the names of the rooms, clicking on which opens a panel with controls for the corresponding room.

Let's open the hallway:

There may be: several buttons configured for exit (BCM0, BCM1, etc.) to enable something with a status return. That is, if it's something (for example overhead light) is turned on, the inscription will be highlighted.

Multiple buttons (SENTSIG1, etc.) to send any command to RaspberryPi.

And several fields (IN_BCM2 etc) to get the state of the GPIO pins (specified as 0 or 1) configured to enter. 0 - the pin is pulled to the ground, 1 - there is voltage on the pin.

In the future, you can change the names of the buttons and swap their places.

Restik on the top right - closing the panel.

Below the button Info The panel with information about the system status is hidden.

Inscription Connect! says that everything is fine, but Count update:- it's just a request counter (the browser requests data from the arduino at ~700ms intervals). The interval can be changed.

If any problem occurs, then a message will appear on the screen ERROR, and in Info The cause of the error will be described.

The entire system operation algorithm is described at the end of the article.

End of introductory part.

Constructor

A short video on working with the constructor, you can watch here this link.

A “smart home” will work on any device, but it must be designed on a regular computer or laptop.

Cookies must be enabled in your browser. However, almost everyone already has them turned on.

The designer is extremely simple and intuitive. By opening here in the next tab, you will find yourself on the first page (there are four in total):

To understand and practice, do everything as written below.

Here you need to select the number of rooms (maximum 5). Let's assume that we have two rooms (hallway and kitchen), then select 2 and click Next.

In the “name of your smart home” and “names of premises”, you can only use letters, numbers, spaces and underscores.

You can fix this later in the index.html file.

On the next page you need to come up with a name for your “smart home” (this is what will be written on the browser tab) and enter it in the field Page title.

Into the fields Server address And Server port no need to write anything (made for the future).

Room names we have already invented (hallway and kitchen), enter them and click the “Next” button...

Here you will see the main screen of your future interface:

Click on the “Hallway” button...

Select two buttons to enable something with return status (Number of on/off buttons).
One button to send a command (Number of signal sending buttons).
And one field for receiving status from any pins (Number of fields for receiving information).

A maximum of five buttons can be selected.

Now close the panel with the button, do the same with the “Kitchen” and click the “Next” button...

The main screen will appear with the “Download archive” button:

This completes the work with the designer, click and move on to the next part.

Attention! Raspbery Pi 2 has a total of 28 GPIOs (BCM0 - BCM27). If you make more than 27 buttons/reception fields in the constructor, then everyone will be superfluous BCM a number will be assigned 28 , and for extra receiving fields IN_BCM the value will simply increase. They will not function.

Connection
Let's put together a simple circuit to test the system:

Connect the LED to the pin BCM 1, through a 500-1000 Ohm resistor. When you press the BCM1 button in the interface, the light will turn on/off, and the inscription will change color.

Also connect the wiring through a resistor 500-1000 Ohm To BCM 3, with this wire you can poke at +3.3 or Ground, and in the field IN_BCM3 zero for one. This way you can track some events.

BCM 2 use only when going out. If you made it as an input (IN_BCM2), then do not use it or remake it as an output (BCM2).

Using buttons SENTSIG described below.

HomestDRp
After unpacking the archive, you will have a folder - mydomrpXXXXXXXXXX, rename it so that it works mydomrp and go into it.

Rename the files indexXXXXXXXXX.html V index.html And initXXXXXXXXX.sh V init.sh.

In folder mydomrp the files will be obtained index.html, init.sh, jquery.js And style.css and program homestdrp.

Open the file index.html and in the twelfth line - var flagobnov = 0, transfer the zero to the one - var flagobnov = 1 (disabled in the constructor). Save the file.

Additional explanations for the files are given at the end of the article.

Now to the homestdrp program...

homestdrp is a web server that receives requests from the client, transmits commands to the RaspberryPi, reads the state of the GPIO pins and sends back information/status to the web client. In other words, its purpose is to exchange data between a web client (browser) and RaspberryPi. It works using the TCP protocol, and in the future also using UDP.

Source

#include #include #include #include #include #include #include #include #include #include #include #include #include char response = "HTTP/1.1 200 OK\r\n" "Content-Type: text/html; charset=UTF-8\r\n\r\n"; char response_css = "HTTP/1.1 200 OK\r\n" "Content-Type: text/css; charset=UTF-8\r\n\r\n"; char response_js = "HTTP/1.1 200 OK\r\n" "Content-Type: text/js; charset=UTF-8\r\n\r\n"; char response_text = "HTTP/1.1 200 OK\r\n" "Content-Type: text/text; charset=UTF-8\r\n\r\n"; char response_403 = "HTTP/1.1 200 OK\r\n" "Content-Type: text/html; charset=UTF-8\r\n\r\n" "403" "" "

403

\r\n"; #define BUFSIZE 1024 #define ARRAY_SIZE 90000 #define BSIZ 512 char send1_array = (0,); char send2_array = (0,); char patch_to_dir = (0,); char fpfile = (0,); char buffer = (0,); int count_simvol = 0; unsigned int PORTW = 0; int len_dat = 0; int count_warning_log =0; void error_log(char *my_error) ( char file_error_log = (0,); snprintf(file_error_log, 26 , "%s", "/var/log/ErrorhomeRp.log"); time_t t; time(&t); FILE *f; f = fopen(file_error_log, "a"); if(f == NULL) ( printf ("Error open /var/log/ErrorhomeRp.log.\n"); exit(0); ) fprintf(f, "%s", ctime(&t)); fprintf(f, "Error %s\n\ n", my_error); printf("Error %s Write to /var/log/ErrorhomestdRp.log.\n", my_error); fclose(f); exit(0); ) void warning_access_log(char *war_ac) ( count_warning_log++ ; char file_Warning_Access_log = (0,); snprintf(file_Warning_Access_log, 31, "%s", "/var/log/Warning_AccessRp.log"); if(count_warning_log > 100) ( system("gzip -f /var/log/ Warning_AccessRp.log"); count_warning_log =0; time_t t; time(&t); FILE *f; f = fopen(file_Warning_Access_log, "w"); fprintf(f, "%s", ctime(&t)); fprintf(f, "%s\n\n", war_ac); printf("Write to /var/log/Warning_AccessRp.log:\n%s\n", war_ac); fclose(f); ) else ( time_t t; time(&t); FILE *f; f = fopen(file_Warning_Access_log, "a"); fprintf(f, "%s", ctime(&t)); fprintf(f, "%s\n \n", war_ac); printf("Write to /var/log/Warning_AccessRp.log:\n%s\n", war_ac); fclose(f); ) ) void read_in_file(char *name_file) ( count_simvol = 0 ; memset(send1_array, 0, ARRAY_SIZE * sizeof(char)); memset(fpfile, 0, 64 * sizeof(char)); snprintf(fpfile, (int)strlen(patch_to_dir) + (int)strlen(name_file) + 1 , "%s%s", patch_to_dir, name_file); FILE *file; file = fopen(fpfile,"r"); if(file == NULL) error_log("open file."); int ch; while(ch = getc(file), ch != EOF) ( send1_array = (char) ch; count_simvol++; if(count_simvol == ARRAY_SIZE - 2) break; ) fclose(file); ) int main(int argc, char *argv) ( if(argc != 4) error_log("not argumets."); PORTW = strtoul(argv, NULL, 0); // port for the web server 80 strncpy(patch_to_dir, argv, 63); // path to the len_dat folder = atoi(argv); // number of characters warning_access_log("START"); /////////////////////////////// /////////////// WEB ///////////////////////////////// ///// int one = 1, client_fd; struct sockaddr_in svr_addr, cli_addr; socklen_t sin_len = sizeof(cli_addr); int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock< 0) error_log("not socket."); setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int)); svr_addr.sin_family = AF_INET; svr_addr.sin_addr.s_addr = INADDR_ANY; svr_addr.sin_port = htons(PORTW); if(bind(sock, (struct sockaddr *) &svr_addr, sizeof(svr_addr)) == -1) { close(sock); error_log("bind."); } if(listen(sock, 10) == -1) { close(sock); error_log("listen."); } ////////////////////////////////////////// work file ////////////////////////////////////////////////// char flin_fldb = {0,}; snprintf(flin_fldb, (int)strlen(patch_to_dir) + (int)strlen("init.sh 1 "), "%s%s", patch_to_dir, "init.sh 1"); system(flin_fldb); char bufRec = {0,}; char To_GPIO = {0,}; FILE *mf; char in_data = {0,}; char gp_file = {0,}; printf("Receive data from RPi\n\n"); for(;;) { client_fd = accept(sock, (struct sockaddr *) &cli_addr, &sin_len); if(client_fd == -1) continue; memset(buffer, 0, BUFSIZE * sizeof(char)); read(client_fd, buffer, BUFSIZE - 1); if((strstr(buffer, "file.db")) != NULL) { memset(in_data, 0, 256 * sizeof(char)); memset(bufRec, 0, BSIZ * sizeof(char)); int i = 0; int ip = 0; for(i = 0; i < len_dat; i++) { memset(gp_file, 0, 32 * sizeof(char)); snprintf(gp_file, 29, "%s%d%s", "/sys/class/gpio/gpio", i, "/value"); if(ip >54) ( in_data = "0"; ip++; in_data = " "; ip++; ) else ( mf = fopen (gp_file, "r"); if(mf == NULL) error_log("gpio, fail last argument.") ; in_data = getc(mf); ip++; in_data = " "; ip++; fclose (mf); ) ) printf("Data:%s\n", in_data); int len_ara = (int)strlen(in_data) + 59; snprintf(bufRec, len_ara, "%s%s", response_text, in_data); write(client_fd, bufRec, len_ara - 1); close(client_fd); ) else if((strstr(buffer, "comanda")) != NULL) /////////// comand ( memset(To_GPIO, 0, 64); snprintf(To_GPIO, (int)strlen(patch_to_dir ) + (int)strlen("init.sh 0 ") + 4, "%sinit.sh 0 %c%c%c", patch_to_dir, buffer, buffer, buffer); system(To_GPIO); close(client_fd); warning_access_log(buffer); printf("To Gpio:%s\n", To_GPIO); ) else if((strstr(buffer, "GET / ")) != NULL) ( read_in_file("index.html"); int len_ara = count_simvol + (int)strlen(response) + 1; memset(send2_array, 0, len_ara * sizeof(char)); snprintf(send2_array, len_ara, "%s%s", response, send1_array); write(client_fd, send2_array, count_simvol + 59); close(client_fd); warning_access_log(buffer); printf("Trans index.html.\n\n"); ) else if((strstr(buffer, "style.css")) != NULL) ( read_in_file("style.css"); int len_ara = count_simvol + (int)strlen(response_css) + 1; memset(send2_array, 0, len_ara * sizeof(char)); snprintf(send2_array, len_ara, "%s %s", response_css, send1_array); write(client_fd, send2_array, count_simvol + 58); close(client_fd); warning_access_log(buffer); printf("Trans style.css.\n\n"); ) else if((strstr(buffer, "jquery.js")) != NULL) ( read_in_file("jquery.js"); int len_ara = count_simvol + (int)strlen(response_js) + 1; memset(send2_array, 0 , len_ara * sizeof(char)); snprintf(send2_array, len_ara, "%s%s", response_js, send1_array); write(client_fd, send2_array, count_simvol + 57); close(client_fd); warning_access_log(buffer); printf( "Trans jquery.js.\n\n"); ) else ( write(client_fd, response_403, sizeof(response_403) - 1); close(client_fd); warning_access_log(buffer); ) ) ) //END main //gcc -Wall -Wextra -Werror homestdrp.c -o homestdrp

Now copy the folder mydomrp to any convenient place on the RaspberryPi, for example to the root, - /mydomrp, make files homestdrp And init.sh executable...

Sudo chmod +x /mydomrp/homestdrp sudo chmod +x /mydomrp/init.sh

And we run the program with three parameters:

Sudo /mydomrp/homestdrp 80 /mydomrp/ 6

Later, to automate the launch, add this command to the file rc.local

Nano /etc/rc.local

You must enter to the line exit 0, like this:

... (/mydomrp/homestdrp 80 /mydomrp/ 6)& exit 0

About parameters:

First parameter - TCP port. You can specify any port, but if you no longer have any servers occupying the standard (80) port, then specify it, well, if it’s busy, then write something else, for example 82 (you will enter the “smart home” like this - address :82 ) .

Second parameter- The path to the folder /mydomrp/ (with obligatory slash / at the end).

Fourth parameter- amount of data sent to the client (it’s not worth going into details of this point, at least for now), you need to look at this figure in the file index.html in line if(vars.length == 6). In the code it is located here:

Show(); setInterval(show,680); function show())( if(flagobnov == 1) ( $.ajax(( type: "POST", url: "file.db", timeout:560, cache: false, success: function(data)( var vars = data.split(" "); if(vars.length == 6) THIS DIGIT ( count_obnov++; ...

After a successful start, homestdrp first of all it launches the init.sh script (Start init.sh), which first deletes all references to all GPIOs, and then creates the necessary ones (Export selected pin) and sets them modes (in/out) (Initialization selected pin) .


For mistakes - sh: echo: I/O error don't pay attention, that's how it should be. After all, the script clears GPIOs that are not there anyway.

Now, opening the page in the browser, you will see various messages in the terminal and the sending of the read GPIO data:

All actions homestdrp, accompanied by writing to a file /var/log/Warning_AccessRp.log, and warnings are written there too.

In case of a critical error (for example, do not add an argument), it will be written to a file /var/log/ErrorhomestdRp.log and the program will stop.

Now if you stop homestdrp(Ctrl + c), then the interface will report an error:

Explanations

How to use the button SENTSIG x?

Opening the init.sh file (from /mydomrp folder), among other things, you will find these lines:

104) # reaction to the button SENTSIG1 ;; 109) # reaction to the button SENTSIG2 ;; ...

Here it is (instead of # reaction to the button SENTSIG1) and you need to enter your commands.
That is, if instead of "# reaction to the button SENTSIG1" you write reboot (without #), save the file and click the button in the interface SENTSIG1, then the raspberry will reboot, or if instead of "# reaction to the button SENTSIG2" you write apt-get update && apt-get upgrade, then it will be updated.

In general, you can do whatever your heart desires.

Explanations for the file index.html

For clarity, open the file generated by the designer.

SetInterval(show,680); ...

...receives a response in text form (data separated by spaces) and sorts them into variables.

... /* receive */ if(vars == 1) ( $(".d2otkl").show(); $(".d2vkl").hide(); ) else if(vars == 0) ( $(".d2otkl").hide(); $(".d2vkl").show(); ) $("#indata3").html("INDATA3" + " " + vars); if(vars == 1) ( $(".d3otkl").show(); $(".d3vkl").hide(); ) else if(vars == 0) ( $(".d3otkl"). hide(); $(".d3vkl").show(); ) ...

If you install the system where the communication quality leaves much to be desired (for example, at the dacha), that is, the pings there are very large, then “timeout” errors will appear. To avoid this, you need to increase the request timeout:

Show(); setInterval(show,680); function show())( if(flagobnov == 1) ( $.ajax(( type: "POST", url: "file.db", timeout:560, /* this number (in milliseconds)*/ cache: false, ...

The default value is 560ms, increase it in 100ms increments and try. Accordingly, it is necessary to increase and setInterval(show,680), also for 100 ms.

You can change the names of the buttons (D2, D3, SENTSIG1, etc.) here:

...

D2
D2
SENTSIG1
...

You can change the names of the fields for receiving data (IN_BCM3, IN_BCM5, etc.) here:

... $("#indata3").html("IN_BCM3" + " " + vars); ...

The browser constantly requests data and thereby creates traffic. To avoid this, you can either close the page or uncomment this block:

/*slmode++; if(slmode > 70) ( $(".pansl").show(300); flagobnov = 0; slmode = 0; )*/

Then after ~a minute, the page will be covered with a translucent panel and updates will stop. Clicking on the panel will remove it and updates will resume.

After making changes to index.html be sure to refresh the page in your browser.

Write all questions and wishes in the comments!

That's all for now, in

The controllers are prepared, the sensors are hung, the wires are tightened. All that’s left to do is choose the “brain” of your smart home. A device that can solve a number of tasks to manage all smart functions. Of course there is Arduino Tian or . But there are also monsters of the microcomputer world, like the extremely popular Raspberry Pi, which is capable of everything that is required of a modern smart home.

What are the differences between Raspberry Pi and Arduino

First of all, it’s worth making a reservation that Arduino is not a computer, and Raspberry Pi is not a microcontroller. There is constant confusion with these two terms.

This is a board with electrical wiring and an ATmega controller. It allows you to work with digital and analog inputs/outputs at a very low level, does not have an operating system as such and runs the code loaded into it continuously. Arduino consumes a ridiculous amount of electricity and can run for months on a block of AA batteries provided there is no significant load. But Arduino has very little real computing power, and many functions and protocols have to be implemented from scratch.

Raspberry Pi is already an entire computer on one board, having on board instead of a microcontroller an SoC (System on a Chip) based on ARM architecture, just like in modern mobile devices. Raspberry can run various Linux or Windows 10 IoT distributions. It has many soldered GPIO (input/output) pins, which can be accessed using ready-made libraries. And, unlike Arduino, programs here run inside the OS and work with pins through a software layer. In most cases, this does not prevent you from creating simple circuits, but sometimes it can be critical. It is important to note that the Raspberry Pi does not have analog pins, but there are more than enough digital ones.

New cloud "Raspberry"
Old "Malina"

What can Raspberry Pi do?

There are several versions of the computer: first, second and third generations, as well as a mini version of Zero. We received the older Raspberry Pi 3 Model B for review as part of the Raspberry kit from our friends from Amperka.

Technical characteristics of the third generation model:

  • 4-core 64-bit Broadcom BCM2837 1.2 GHz processor;
  • 1GB RAM;
  • Wi-Fi and BT LE module BCM43438;
  • 4 USB ports standard 2.0.

This allows you not only to install a full-fledged OS with a graphical interface on a single-board computer, but also to connect it to a FullHD monitor and use it as a work PC, as well as run, for example, Quake III on it.

“Raspberry” set from “Amperki”

For the Raspberry Pi to work successfully, you will need several components:

  • the board itself;
  • power supply 5V micro-USB;
  • HDMI cable for connecting a monitor;
  • microSD memory card on which the OS will be installed.

Kits from "" already contain everything you need, and more. The older ones had indexes Y, Z depending on the configuration, and in the box you could find a breadboard, a bundle of cables, buttons, LEDs, resistors, etc. The new set “,” which turned out to be our review, includes instead of electronic components a finished board with many soldered elements. Unlike its predecessor, the focus here is not on working with basic details, but on the Internet of Things with many interesting examples.

The kit includes a colorful 88-page manual that gives a basic understanding of the computer itself, the standard Raspbian OS, the basics of working with the command line and file Linux system, as well as writing code in Python. Python is a relatively simple object-oriented programming language that has gained considerable popularity on the Raspberry Pi platform. The tutorial in the kit will teach you the basics of syntax and working in the Thonny IDE.

Expansion board for experiments

" " is a pumped-up version of the " " set. If in “Matryoshka” with Arduino there were a lot of very simple experiments with basic electrical elements like capacitors and LEDs, then in “Malina” the primacy was given to integration with Internet services. The experiments offered by Amperka will help you set up your web server and write a small website for managing board pins. The complete textolite board in the shape of a cloud with buttons and LEDs will definitely help with this.

And then the fun begins. The second half of the book will tell you how to create a bot on VKontakte and connect it to the Raspberry Pi so that the board can issue commands directly from social media. networks. And then it is proposed to set up a torrent downloader on Raspberry and write a web interface for it for control, for example, from a phone connected to home Wi-Fi.

The result is a smart device that can interact with the Internet and execute commands. And, most importantly, everything you need is already included in the kit.

Raspberry Pi for smart home

Craftsmen have already adapted the Raspberry Pi for many tasks besides being used as a work machine. You can use it to make a Wi-Fi router or even your own digital PBX. True, in both respects it will be inferior to specialized analogues, but strong point“Raspberries” is about the opportunity to create something of your own. And we are interested, first of all, in how it can be used to create a smart home.

There are two main scenarios: using the board as a single device that controls all sensors, or as a gateway that collects data and issues instructions to simpler devices.

As usual, Amperka's management is excellent

In the first case, all the work falls on the Raspberry Pi's own pins. The lack of analog pins is compensated by the presence of inexpensive digital sensors like ds18b20 or the use of special ADC expansion cards. Among the standard pins (see diagram below) you can find contacts with PWM, I²C, SPI and UART. Thus, you can connect most modern sensors to the board, as well as control circuits through power switches or relay blocks. Creating solutions for a smart home on Raspberry Pi is quite simple, especially since many useful tools are already built into the board, such as a WiFi module.

Working with the Internet on Arduino is much more difficult, and the computing capabilities of the microcontroller are completely meager. But here's the paradox: in most simple tasks, such as controlling light or heating, using the Raspberry Pi is often akin to hammering nails, if not with a microscope, then certainly with a voltmeter. The Arduino board consumes less power, the code in it is constantly executed at the lowest level with direct access to the pins, and it costs several times less. And the community of enthusiasts and developers is no less.

Another thing is complex decisions. For example, if you have a large house where you need to hang a bunch of sensors at once, but you want to control heating, lighting, and warm floors, and a gate in the garage, and even so that the valves on the water pipes in the basement close themselves when you leave with the whole family for the weekend. Well, you never know. Here we will talk about several boards that need to be combined into a network with a brain center. This is where the Raspberry Pi will show itself in all its glory. The microcomputer can act as a head unit, accumulating information from various sensors throughout the house and controlling all devices. Information can be collected and displayed using a web server, and the data can be stored on an SD card.

In such a project, the issue of device synchronization arises. And here the RS-485 protocol can be useful, which allows you to transmit a signal over long distances over two wires (ideally, with ground), or a regular local network, since Arduino can work with simple http requests, which is quite enough to implement a home network smart home.

Conclusion

Don't forget that Raspberry Pi is a device for enthusiasts. And this is precisely his strength. If you set out to figure it out, with the help of this microcomputer you can assemble many interesting solutions, and not only for a smart home. And the built-in network interface and WiFi module make it easy to connect the board to a local network or the Internet. It’s convenient that kits like “” from Amperka already include everything you need, including a competent manual that makes it easy to get acquainted with the basics of working with the Raspberry Pi.

In complex circuits, Arduino analog boards can come to the rescue, for example, the ESP family: 8266 or 32. Compact, fast, with built-in WiFi. We will definitely talk about them in one of the following materials.

Have you already started making your smart home? Or are you just getting ready? Share your projects in the comments.

If you find an error, please highlight a piece of text and click Ctrl+Enter.

Similar articles

2024 my-cross.ru. Cats and dogs. Small animals. Health. Medicine.