Amosplanet

Stay Hungry, Stay Foolish

Wireless Datalogger Configuration Principle

wireless Datalogger Configuration Principle

The core of Wifi is actually to use various methods to send the SSID and password of the AP ( Router ) to be connected to the WIFI device( Datalogger ) that requires networking equipment, and then the WIFI device connects to the designated WIFI network to achieve the purpose of accessing the LAN or the Internet.

Inside Shinewifi-F, Shinewiif-S or Shinewhifi-X series, ESP chip has been used, ESP chip is manufactured by great Chip Company called Lexin in China. When we configure datalogger via Shinephone or AP mode, they have used SmartConfig technology etc.

Here attached 2 configuration principle

1.SmartConfig

When we use Shinephone to configure wireless datalogger, actually we are using SmartConfig technology. The technical essence of smartconfig is UDP broadcast .Smart config refers to sending multicast or broadcast from a device (usually a mobile phone) connected to the router. Wi-Fi devices that are not connected to the router can receive this information and connect to the router to achieve one-click network configuration of the device.

ESP8266 and ESP32 use the ESP-Touch protocol, which is suitable for SmartConfig technology developed by TI. SmartConfig, also known as Quick Connection, is used to connect new Wi-Fi-based IoT devices to Wi-Fi networks. When the current device has not established any actual communication links with other devices, configure the device to access WIFI with one click.
The basic principle of smartconfig network distribution is to send messages directly to the network equipment to be distributed through the mobile phone. The mobile phone sends a UDP broadcast message, and the network device to be configured scans all available wireless channels, finds the message sending smartConfig, and locks on this channel to start receiving data.

Smartconfig completes the network configuration in the following three steps:

1.The datalogger like Shinewifi-F, Shinewifi-S, Shinewifi-X etc. enters the initialization state and starts monitoring nearby WiFi data packets.

2. After setting the WiFi name and password on your phone, send a UDP broadcast packet via Router

3. The datalogger like Shinewifi-F, Shinewifi-S, Shinewifi-X etc. obtains the configuration information through the UDP packet (length), switches the network mode, connects to the home WiFi, and the configuration is completed.

The following is the encapsulation format of 802.2.

DA: Destination MAC address

SA: source MAC address

LENGTH: Indicates the length of the following data

LLC: indicates LLC header

SNAP: represents 3byte manufacturer code and 2byte protocol type representation

DATA: payload data

FCS: frame check sequence

Sender: You can use 2 different encoding sending methods, UDP broadcast and multicast;

1. UDP Broadcast

From the 802.11 frame format analysis, we know that from the perspective of the wireless signal monitor, regardless of whether the wireless channel is encrypted or not, the DA, SA, LENGTH, LLC, SNAP, and FCS fields are always exposed. Therefore, the signal monitor can learn from these 6 fields. field to obtain valid information. From the sender’s point of view, due to the limitations of the operating system, if broadcast is used, only LENGTH can be controlled by the sender by changing the length of the data packets it needs to send. Therefore, as long as a set of communication using length encoding is specified protocol, you can use the Length field of the data packet for data transmission;

DATA is not good. So plan to start with other fields. Most of the fields cannot be obtained by mobile phones. The most suitable ones are only the length field.

2: UDP multicast

Multicast addresses are reserved Class D addresses from 224.0.0.0-239.255.255.255
The mapping relationship between IP address and MAC address is: set the first 25 bits of the MAC address to 01.00.5e, and the last 23 bits of the MAC address correspond to the bits of the IP address;
Therefore, the sending end can encode the data in the last 23 bits of the multicast IP, send it through the multicast packet, and the receiving end can decode it;

The current mainstream IOT wifi solutions

ManufacturerChip SolutionTechnology NamePacket Type
1TI CC3200SmartConfigSend udp packet to a fixed IP
2高通 QualcommQCA4004/QCA4002SmartConnection
3联发科 MTKMTK7681SmartConnectionMulticast address encoding
4MARVELLMC200+8801/MW300EasyConnectMulticast address encoding
5ReltekAMEBASimpleConfigMulticast address encoding
6乐鑫 ESPRESSIFEsp8266SmartConfigMulticast, via length encoding
7新案线NL6621SmartConfigMulticast address encoding
8微信 WechatAirKissBroadcast across the entire network, via length encoding

SmartConfig Strength

Simple and easy to use, you only need to enter ssid and password on the mobile phone via relevent APP

SmartConfig Weakness

1. The transmission speed is slow, limited by the principle of smartConfig. The fastest one packet can transmit 23-bit data. If you want to make a product, you must also consider issues such as security, leader packets, data verification, and packet loss, resulting in a limited success rate.

2. Router compatibility is a big problem. Due to the rapid development of routers, the internal logic of the models is also diverse, such as:

2.1 Some routers do not forward multicast broadcast packets, which will also reduce the success rate of the device receiving data.

2.2 Router frequency band problem. Nowadays, common Wi-Fi modules usually only have the 2.4GHz frequency band, so they can only communicate with routers in the 2.4GHz frequency band. Today's routers generally have two frequency bands: 2.4GHz and 5GHz. During actual operation, users may misuse the router in the 5GHz band, causing the Wi-Fi device to be unable to receive data.

2.3 Some routers now also have mimo and mumimo functions, and the Wi-Fi module may have a single antenna, resulting in incomplete reception of data sent and received, eventually leading to failure.

Application

2. SoftAP Configuration

SoftAP network configuration, first, the WIFI device to be configured will establish an AP. The user will connect a smartphone or other device with human-computer interaction function to this AP, and then send the device information to be connected to the WIFI device to be configured. After receiving the information, the WIFI device to be configured will find the corresponding AP and actively connect to it to complete the network configuration.

Application

3 thoughts on “Wireless Datalogger Configuration Principle”

  1. Undeniably believe that which you said. Your favorite justification seemed to be on the internet the simplest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they plainly do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will likely be back to get more. Thanks

Leave a Comment

Your email address will not be published. Required fields are marked *