当前位置:网站首页>WiFi smartconfig implementation
WiFi smartconfig implementation
2022-06-12 04:55:00 【hi_ LeTian】
Many devices now use mobile phones directly wifi To configure the , There is no operating interface for the device , image TISmartConfig,Airkiss.
There are also many descriptions on the Internet , I have also realized , Overall, it is relatively simple .
Device end , Need to be able to support wifi Mixed mode , Basically .
The process of implementation is to pass the data to be sent through udp The length of the packet , The device is in mixed mode , By fetching udp The radio bag , according to 802.11 Filter the features of , Just find the package of the custom protocol , Lock specific MAC After the address , Continuous packet capturing , Just parse it out , It's simpler .
Definition of agreement
Generally, a protocol header is defined , If used 0x1, 0x4, 0x8, In this way, the device side is grasping UDP Packet time , After seeing such a packet length rule , It is considered as a package header , You can add another Baotou CRC8 check , this 4 Bytes , As UDP The length of the package , Continuous transmission .
The test is general 3,4 A continuous UDP Chances of being out of order , It's not that big , In this way, you can quickly lock the start of the protocol .
Code the data , There are many general data , Expect to send continuously UDP, Can receive continuously in sequence , It's unrealistic . Therefore, each data byte , Recode , Here's what I did , Each node uses 4 Two bytes to encode , such :
Forerunner | Data serial number | data |CRC8
The first byte is fixed to 0xc, Indicates the beginning of a byte , The second byte represents the sequence number of the data byte , The third byte is the real data , The fourth byte is CRC check : To the front 3 Bytes for verification , The receiving end can judge whether it is normal .
That is, you need to send a string to the device , Such as : “12345678”, Express WIFI Connection password , Then you need to send 4*8=32 individual UDP The datagram , Because every data is numbered , In this way, different data can be verified and received multiple times , The success rate is very high .
Send another... In the data CRC Verification of data , Verify the received data again .
Can be like Airkiss Also send one SSID Of CRC check , Verify found SSID Is it really to be configured SSID, I feel a little superfluous .
Can be like Airkiss Send a random number , Used when the equipment end is connected WIFI when , Notify the user for configuration , The device is already connected through your data connection .
Generally like WIFI Data like passwords , The relatively small , Tested it , It's done in a few seconds .
边栏推荐
- Understanding of day16 array create query static and dynamic array array array performance in memory
- Thousand word masterpiece "programming biography"
- Question for the 3D printing lattice?
- How to deploy PostgreSQL as a docker container
- From science to startup
- Force/release learning and sorting in IC Verification (6) research on the influence of wire type signals
- JS how to get the date
- Detailed explanation of Command Execution Vulnerability
- Why is Julia so popular?
- 加速訓練之並行化 tf.data.Dataset 生成器
猜你喜欢

asp. Net core theme Middleware

Soil type, soil texture, soil nutrient and change data, soil organic matter, soil pH, soil nitrogen, phosphorus and potassium

Ubunt 20.04 uses CDROM or ISO as the installation source

Qinglong wool - Kaka

How to generate provincial data from county-level data in ArcGIS?

BI 如何让SaaS产品具有 “安全感”和“敏锐感”(上)

How to count the total length of roads in the region and draw data histogram

leetcode797. All possible paths (medium)

Understanding of day16 array create query static and dynamic array array array performance in memory

In the era of smart retail, Weimeng reshapes the value of "shopping guide"
随机推荐
【cjson】根节点注意事项
Drive safety coding & troubleshooting guide
Force/release learning and sorting in IC Verification (6) research on the influence of wire type signals
EnterpriseTECH STAR Question
InnoDB data storage structure – MySQL
kali下安装pycharm并创建快捷访问
Ten trends of Internet Security in 2022 industry released
Report on the current market situation and future development trend of adhesive industry for radar and ultrasonic sensors in the world and China 2022 ~ 2028
kali_ Nat mode, bridging Internet / host only_ detailed
1006 next spread
How to count the total length of roads in the region and draw data histogram
2022 self study materials for Zhejiang computer level III network and security technology examination (1) (updated on 2.28)
Big manufacturers compete to join rust, performance and safety are the key, and the 2021 rust developer survey report is announced
Interview must ask: summary of ten classic sorting algorithms
[GIS tutorial] land use transfer matrix
How Bi makes SaaS products have a "sense of security" and "sensitivity" (Part I)
LabVIEW about TDMS and Binary Storage Speed
Normalized vegetation index (NDVI) data, NPP data, GPP data, evapotranspiration data, vegetation type data, ecosystem type distribution data
Spatial distribution data of national multi-year average precipitation 1951-2021, temperature distribution data, evapotranspiration data, evaporation data, solar radiation data, sunshine data and wind
Gao Xiang slam14 notes on three Lie groups and Lie algebra