Computer literacy, assistance and repair

Wi-Fi network management. Wi-Fi lighting controller

Today I want to show you an interesting device with which you can control anything via the Internet using the Wi-Fi module ESP8266 (ESP-01) and the ATmega8A microcontroller.
In this combination, the module acts as a controller WiFi networks and web server, and ATmega8A acts as a power node controller, receives a line via a simple protocol from ESP8266 and having processed it issues a command to open one or another relay through a shift register 74HC595 and transistor assembly ULN2003.

Device diagram:

By accessing the specified IP address, default: 192.168.4.1, you can configure various modes and control the lighting in your apartment or house. The device has a web interface. Firmware for ESP8266 is based on "web dumps" from the respected « PVVX". I just added a couple of handlers in the file so that when a certain line is received from the web side, a 4-byte string will be sent to the UART interface - the command identifier. There are two such commands for each control channel: turn it on and off. Also, there are two additional commands that can turn on and off all lighting channels at once.
And then, by writing a simple web page, I can easily control the lighting of the apartment.

The device works as follows:

From the web side: to put it simply, when you click on any of the buttons, a script is first called that changes the background of the button and changes variable value from 1 to 0 and vice versa with each click and then the AJAX handler is called, which is processed by the program in the ESP8266 and sent to the UART code corresponding to the AJAX command. And ATmega8A accepts and processes this line.

From the microcontroller side: a string is received, processed, and if the string matches the test string, then the necessary actions are performed. It looks like this like this:

Void send_data() ( static char buff_data=0, rel_data=0; static char x=0; if(string_search("@1A00",rx_buffer)) // LIGHT ON kitchen ( rel_data|=0x81; printf("1CH ON\ r\n"); clear_buffer_rx(); x=0; if(demo<42000 && demo_off==0) demo++; } .................... .................... else if(string_search("@2A00",rx_buffer)) // LIGHT OFF кухня { rel_data&=~0x81; printf("1CH OFF\r\n"); clear_buffer_rx(); x=0; if(demo<42000 && demo_off==0) demo++; } relay_send(rel_data); }

This function compares the string that arrives in the UART with a string that executes certain commands. If it matches, then the action is performed.

The UART parser function is homemade, here is its code:

Char string_search(char *str1,char *str2) ( unsigned char addr=0,x=0,y=0; str1+=0; str2+=0; while(str1!=0) ( addr++; ) while(str1[y ]!=0 && str2[x]!=0) ( if(str1[y] == str2[x]) ( y++; x++; ) else ( if(y

The web page does not qualify for an award, and looks like this:

When you press any of the buttons, the lighting turns on!

The settings web pages are hidden from the main page and open when you enter links. I will indicate them below.

If desired, anyone can modify the main page by adding a button or link to it to go to the settings.

192.168.4.1/protect/wifi.htm
192.168.4.1/protect/setup.htm
192.168.4.1/protect/uart.htm
192.168.4.1/protect/upload.htm

For questions about updating the firmware, you can.

Photo of the mounted device:

Attention! Printed circuit boards were designed to be universal (for general use) and boards were used from what was already manufactured, this is all due to the reduction of development time and saving costs on the production of factory boards. Therefore, some nodes are not wired for the task of lighting control.

Yes, the operating system will allow you to find nearby networks and connect to them, but what about add-ons? What if you need to have detailed information on all the Wi-Fi networks around you, troubleshoot your network, turn your laptop into a portable Wi-Fi hotspot, or stay safe on public hotspots? Windows won't help you with all this.

That's why we've found six apps for you. They do everything Windows can't do and more. Five of the six applications are free, while the sixth is not expensive at all.

From MetaGeek is an excellent tool for searching and collecting information on Wi-Fi networks in the area where your computer is located. The program is also useful in solving problems with your own Wi-Fi network.

For all found Wi-Fi networks, InSSIDer shows the MAC address of the router, the router manufacturer (if the program can determine it - usually it can), the channel in use, the SSID or public name of the network, security type, network speed, and the like. In addition, the program shows the current network signal strength.

How would you use a program to solve problems with your wireless network? If you saw that a nearby network with a strong signal was on the same channel as you, you would change the channel of your network (most routers allow this), thereby avoiding potential conflicts.

The program also allows you to identify “dead zones” in your area where there is no sufficiently reliable Wi-Fi signal. To do this, just walk around your home or office with InSSIDer turned on. In the future, you can either avoid these places or try to move your router.

Whether you need to solve problems with your network or find Wi-Fi hotspots to connect to, InSSIDer is the program you'll want to download and try.

Price: Free
Compatibility: Windows XP, Vista and 7 (32- and 64-bit)
Download InSSIDer

Here's another great program for finding Wi-Fi networks and providing information on them, such as how far away they are from you. The radar-like screen shows all nearby hotspots. A separate panel offers detailed information on all found hotspots, including signal strength, network type (for example, 802.11n), router manufacturer, transmission channel, etc.

Next to the radar, the panel provides even more detailed information about the network you are currently connected to, including your personal IP address, public IP address, DNS, gateway information, and more.

Why use Xirrus Wi-Fi Inspector over MetaGeek InSSIDer? For example, because the simpler and clearer layout of Wi-Fi Inspector makes it easier to present information on hotspots. The program also shows your relative physical distance from the hotspot. And probably no one will deny the usefulness of the radar itself.

However, InSSIDer is better than Xirrus Wi-Fi Inspector in terms of obtaining more detailed information on surrounding Wi-Fi networks.

Price: Free
Compatibility: Windows XP SP2+, Vista and 7
Download Xirrus Wi-Fi Inspector

is an excellent, free program that allows you to turn a computer with Windows 7 (the program only works with Windows 7) into a Wi-Fi hotspot, which can then be used by nearby devices - such as a smartphone or tablets of colleagues.

Of course, the computer itself that you would like to convert into a Wi-Fi hotspot must be connected to the Internet and support Wi-Fi. At the same time, the connection to the Internet does not necessarily have to be wired (although it does not hurt), because a Wi-Fi card on a computer can perform a dual function - on the one hand, it can act as a Wi-Fi receiver, and on the other, it can act as a transmitter.

Setting up a hotspot is simple: Once you're connected to the Internet, launch Connectify, give your hotspot a name and set a password. After this, your computer's Wi-Fi card will begin broadcasting a Wi-Fi signal to which other devices can connect. It is worth noting that your computer will work using the Wi-Fi protocol for which it was created. In addition, it will also support older protocols. For example, an 802.11n signal will allow you to connect devices with 802.11b/g/n.

Setting a password will allow you to restrict unauthorized access to the Internet. The hotspot signal itself is protected by WPA2-PSK encryption.

You can even use Connectify to set up a local network without an external Internet connection. Launch the program as a hotspot and nearby devices will be able to connect to its network, even if you do not have Internet access. This can be used, for example, to transfer files within a workgroup or for multiplayer games.

It's worth noting that connecting my Mac to a hotspot based on a Windows 7 computer and Connectify caused me problems. However, other computers and devices connected without problems.

Managing a router involves configuring the device. A router is a rather complex network equipment with enormous functionality, and depending on the operating conditions, one or another control is required.

Setting up a router requires certain knowledge; moreover, before starting the setup, you need to connect it to your computer and go into the same settings.

If you do not take into account “exotic” methods (for example, through a telnet terminal), then there are only two main configuration methods:

  1. Or through a special assistant program;
  2. Or through the built-in web interface of the router.

The first method is more convenient for inexperienced users, since it is designed for almost automatic configuration with minimal human intervention, while the second method provides finer tuning.

Let's start by connecting to a computer.

Connecting the router to the computer

Any router is equipped with a LAN interface (port) designed for a wired connection to a computer. Also, any computer has an Ethernet port for the same purposes. We take the patch court network cable that usually comes with the router, and connect the router to the computer through these ports.

Preparing the router for settings

You can also establish a connection via a Wi-Fi wireless network, but not all routers and computers have Wi-Fi modules, moreover, the wireless network is less reliable and the connection may be interrupted at the most inopportune moment.

Front panel of the router

After turning on the router, you need to pay attention to its indicator lights, usually located on the front panel. Firstly, to make sure that the router is working (in case the power supply is burned out), secondly, to make sure that the firmware is completely loaded into its RAM and the router is ready for use.

Front panel of the router

Further actions depend on how you intend to configure the router - using the assistant software, or yourself through the web interface.

Let's look at the first option first.

Configuration with specialized software

Helper programs are located on CDs that come with the router. Also, if you have Internet access, you can download it from the manufacturer’s official website.

It should be noted right away that not all manufacturers develop such programs!

After installing the program, launch it using the shortcut that appears on the desktop. As a rule, the first window that opens is a welcome window with the manufacturer’s logo, in which you need to start setting up the router.

Initial window of the setup program

Further steps depend on the manufacturer, but it all comes down to choosing a provider, entering the necessary passwords and logins specified in the agreement with the provider. In the remaining steps, simply read the messages displayed and agree to them by clicking “Next” or “Ok”.

Configuration via web interface

But it is much preferable, and more professional, to configure via the router’s web interface. But to enter the settings menu in this way, user authorization will first be required, since the router simply will not allow uninvited guests into its settings.

Label under the bottom of the router

The IP address of the router is also found there.

User authorization

So, we connected the router to the computer with a patch cord and turned it on. Next, open Internet Explorer on your computer, in which we enter the network address of the router.

Logging into router settings

Settings menu structure

With very rare exceptions, the menu structure is the same - either on the left or at the top there is a tree of settings items. Many manufacturers also provide help and hints for the selected menu item on the right side of the window. In the center of the window, direct settings are made, that is, managing the router.

Settings menu

It is very good if the menu is in Russian. If it is initially in English, then we are looking for a line like “Language”, since the menu can be multilingual, and English is simply set by default. Let's change it to Russian.

Wi-Fi setup

That's it, all that remains is to carefully read the names of menu items and make settings. For example, we need to set up a Wi-Fi wireless network. We look at the menu names, we need “Wi-Fi”, “Wireless”, “Wireless Network” or something like that.

Let's look at an example of configuration on a router from Netgear

Setting up Wi-Fi

Go to the “Settings” menu, then select the “Wireless Network Settings” submenu. A settings window will open in which we indicate the name of our wireless network, select the channel, mode, and transmission speed. If desired, you can set a password to connect to the network, or leave the login free.

The rest of the router is configured using the same scheme, some of which can be found in the video tutorial:

Using the Wi-Fi menu, you can quickly connect to a nearby wireless network.

If your network is not listed, make sure the router is close and others can connect to the access point. This could also be the case. To connect to a hidden network, select Connect to another network.

The signal strength of each nearby network is displayed next to its name. The more dark bars, the stronger the network signal.

enter password

Access to networks that have a padlock next to their name is password protected. After selecting a network, enter its password in the login window that appears. If you don't know the password, ask the owner of the Wi-Fi network you're trying to connect to.

Connect to a Wi-Fi network using a mobile device

Depending on the data plan you use, an iPhone or iPad with a cellular connection may provide Internet connectivity to your Mac. When your iOS device is near your Mac, it appears in the Wi-Fi menu as an available connection.


  1. From the Apple menu, select System Preferences.
  2. In the System Preferences window, click Network.
  3. Select Wi-Fi from the list of available network connections.
  4. Check the box next to “Show Wi-Fi status in menu bar.”

Networking

If you want to create a temporary Wi-Fi connection between your Mac and another device, you can create your own network using the Wi-Fi menu.

  1. Click the Wi-Fi menu and select Create Network.
  2. Enter network details such as network name and channel.

When you create a computer-to-computer network, the menu icon changes to a computer icon (). When finished, click the Wi-Fi menu again and select Disable.

Original: How to manage a WiFi connection from the command line
Author: Adrien Brochard
Date of publication: August 14, 2014
Translation: A. Krivoshey
Transfer date: December 2014

When you install a new Linux distribution on your computer, it is always recommended to first connect it to the internet using a wired network. There are two good reasons for this: firstly, there may not be a suitable driver for your wireless adapter in the distribution, and secondly, if you are installing a system without a graphical interface, setting up Wi-Fi on the command line is scary for many. I always try to avoid communicating with Wi-Fi on the command line. However, in the Linux world there is no room for fear. If you don't know something, this is a great reason to learn about it. So I overcame myself and decided to master Wi-Fi management on the Linux command line.

Of course, there are several ways to connect via Wi Fi on the command line. However, for the purposes of this post, I will try to use the basic method: one that uses only the programs and utilities included in the set of "default packages" of any distribution. Obviously, the advantage of this method is that it can be reproduced potentially on any computer running any Linux. Its disadvantage is that it is quite complicated.

So, firstly, it is assumed that you have downloaded the correct drivers for your wireless network card. Without this nothing will work.
You can then check which network interfaces support wireless connections using the command:

Typically, the wireless interface is called wlan0. Of course, there are exceptions, but for the purposes of this guide I will use the generally accepted notation.
Just in case, check that the interface is enabled:

$ sudo ip link set wlan0 up

Once you know your interface is working, you can search for available wireless networks using the command:

$ sudo iw dev wlan0 scan | less


From the output you can find out the network name (SSID), signal strength and the type of security used (i.e. WEP, WPA/WPA2). There may be two options here. The simplest and easiest if the network is not protected. In this case, you can immediately connect to it:

$ sudo iw dev wlan0 connect

If your network uses WEP encryption, everything is also quite simple:

$ sudo iw dev wlan0 connect key 0:

But if the network uses WPA or WPA2 protocols, the matter becomes more complicated. In this case, you need to use the wpa_supplicant utility, which is not always preinstalled on the system. You need to open the /etc/wpa_supplicant/wpa_supplicant.conf file and add the following lines to it:

Network=( ssid="" psk="" priority=1 )

I recommend adding these to the end of the file and making sure other configurations are commented out. Be careful as both ssid and password are case sensitive. You can enter the name of the access point instead of ssid, and wpa_supplicant will replace it with the corresponding ssid.

Once the setup is complete, run this command in the background:

$ sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Now you need to get the IP address using the command:

$ sudo dhcpcd wlan0

If everything is done correctly, you should get a new IP address via DHCP and the process will run in the background. You can always check if there is a connection using the command:


In conclusion, I think mastering this method is worth the effort. You can never be sure that you will always have access to a GUI or a wired connection, so it is important to be prepared for such situations. As mentioned earlier, there are many ways (Network Manager, wicd, netcfg, wifi) to manage your wireless connection. I chose the most general method, although in certain cases the utilities I used may not be available and you will need to download them first. On the other hand, there are much more advanced programs that are definitely not included in the default packages, but greatly simplify the setup process. Either way, it's a good idea to learn the basics.

The age of progress and high technology is already persistently knocking on every home. Today, every home has a computer, as well as a bunch of mobile devices: tablets, smartphones, netbooks, transformers (netbooks with a removable touch screen or tablets with docking stations) and other devices. It is not surprising that now many people have the opportunity to control various devices through. Starting from lighting to other household electrical appliances. Such installations are called "Smart House" and were already known in the early 2000s, but became widespread among ordinary users only in our days, when wireless technologies became available to a wide mass of users.

Some general information

It’s worth noting right away that to control the light, TV, refrigerator, air conditioner, microwave oven or any other electrical appliance, we need a special station or relay. They come in different types, with different capabilities and functions. For example, the cheapest devices are made in the form of an outlet with a remote control. That is, you insert the “Wireless socket” into a regular socket (to connect to the power supply). You turn on the pond compressor in the wireless device (for example, sunsun aco review, etc.), and using the remote control you can turn it off or on. Everything is very easy and very simple!

But there are more expensive and advanced devices that allow you to control household appliances through special applications on tablets and smartphones. In this case, the connection can occur both on a local network and remotely via the Internet.

As you understand, it is simply impossible to describe everything in one article, so we will analyze only two types of Smart Home devices. Control computer functions via Android via Bluetooth.

Wireless outlet

The word “wireless” here means that you can connect to it via Wi-Fi and control its operation. Let's look at how such gadgets work, using the example of a device from Edup. This is a Chinese company, but produces quite high-quality products.

How to use such an outlet?

  1. We connect the device to the power supply (to a regular outlet).
  2. There is a button on the top of the device. Press and hold it until the Wi-Fi indicator starts blinking (if you are holding the button but another icon is constantly blinking, then release the button and press briefly again). Thus, we switched the device to search mode for Wi-Fi networks in order to bind to the router.

Now let's move on to the tablet or smartphone (with the help of which remote control will take place). In our case, the application is called Edup Wi-Fi. After installing the application on your tablet, you will have to register.

After that, log into the application using your login. But now there will not be a single device in it: the fact is that you need to add equipment manually, so we exit the application.

Now open the settings of your smartphone (tablet) and go to the “Wi-Fi” section. Turn on the adapter. When the system offers a list of devices available for connection, find your “wireless” outlet and connect to it. The connection we need is called “Wifino1”. After we have connected to the device, we return to the Edup WiFi application.

Here you need to click the “Settings” button, which is located at the very bottom of the screen on the right. Next, click “Initialize Device”. Information about the connected device will be displayed at the top: and its name.

Below you will need to enter the name of your Wi-Fi network in the field. You must enter exactly as indicated in the router, with all symbols, uppercase or lowercase letters, and so on. The name must match absolutely. And, accordingly, enter the password for your Wi-Fi network.

After this, press the “Start” button. The phone will begin sending the necessary commands to the Wi-Fi outlet. All you have to do is wait for the pairing to be completed. When this happens, the indicator on the outlet itself, which was previously blinking, will stop blinking and will remain constantly on.

Now, when you log into the Edup WiFi app again, the “Devices” section will show your wireless socket connected to the router. Opposite the name there will be a button, when clicked, the device will turn on or off. As you can see, controlling your household appliances via Wi-Fi is a fairly simple and fast process.

"Wireless" relay

The second gadget that will allow you to control the lights in your home via Wi-Fi is a relay. This equipment is more powerful and can withstand higher loads. In this case, everything works directly. That is, the relay itself distributes Wi-Fi, to which you need to connect and then launch the corresponding application and control the operation of the relay in the program.

You don't need to make any special settings. The relay is supplied with setup instructions and a disk with the necessary software. In fact, a relay is practically no different from a socket. But if you can control the outlet via the Internet, the relay requires a direct connection via Wi-Fi or Bluetooth.

There are other options for “Smart Homes” with which you can set up control of all household electrical appliances at once. But the cost of such equipment will be appropriate and affordable to few people.

Related publications