Introduction to ESP-CSI Solution

[中文]

Features of the Solution

ESP-CSI (Channel State Information) is a technology provided by Espressif for obtaining the state information of Wi-Fi channels. It utilizes the features of the ESP series chips, and by analyzing detailed indicators of Wi-Fi channels, such as phase, propagation delay, signal-to-noise ratio, channel matrix, data rate, etc., it provides more detailed and meticulous wireless channel information. This strongly supports a variety of advanced applications and intelligent sensing technologies, bringing more innovation and application possibilities.

ESP-CSI provides more information than traditional signal strength (RSSI). RSSI simply measures the strength of the signal, while CSI provides more detailed and richer channel information, including the amplitude and phase of the signal. This information is very useful for some advanced applications, such as indoor positioning, environmental monitoring, and human perception.

ESP-CSI has a wide range of application prospects in the fields of IoT, smart homes, smart cities, etc., making devices more intelligent and accurately perceive and respond to changes in the surrounding environment.

Advantages of the Solution

  • No additional hardware cost: The ESP-CSI solution is based on the inherent features of the ESP series chips, without the need for additional hardware costs, providing developers with an economical and efficient solution.

  • Real-time response: ESP series chips can process and analyze CSI data in real time on the device locally, providing fast response and high performance.

  • Interference resistance: The amplitude of CSI is essentially a set of channel attenuation coefficients. As long as the channel itself does not change, it is very robust against interference from power adapters and other frequency hoppers.

  • Finer granularity: Instead of using composite values (such as RSSI) to measure channels, it samples frequency responses in units of subcarriers in the channel, thus describing the channel in a finer granularity within the frequency domain.

Common Application Scenarios of ESP-CSI

  • Intruder Detection: With ESP-CSI, you can choose a combination of highly sensitive subcarriers and signals from non-line-of-sight propagation path directions to improve the sensitivity of passive personnel detection and expand the detection range under different multipath propagation environments. This can form an intrusion detection system, providing an efficient intrusion detection solution for security applications.

  • Positioning and Ranging: ESP-CSI can draw on the RSSI method and use CSI as richer fingerprint information (including signal amplitude and phase information on multiple subcarriers), or through the frequency-selective attenuation model for more accurate positioning and ranging. This helps to achieve more accurate positioning and distance measurement in indoor or complex environments.

  • Human Activity Detection and Recognition: With the high sensitivity of ESP-CSI, it can recognize human movements, gestures, and daily activities. This is very useful for implementing smart home, health monitoring, and human interaction applications.

  • Espressif ESP-CSI Intelligent Human Perception Detection Solution

Chip CSI Performance Ranking

  • ESP32-C5 > ESP32-C6 > ESP32-C3 ≈ ESP32-S3 > ESP32

Implementation of ESP-CSI

Using only one ESP chip and router

get_router_csi
  • The ESP chip sends the constructed Ping (Packet Internet Groper) packets to the router. Ping is a protocol used to test the network connection with the target device, usually used to detect network latency and connection status. In Ping packets, it usually includes information such as the source IP address, target IP address, timestamp, etc.

  • The router will reply with Ping packets carrying some CSI information.

  • After the ESP chip captures the returned data packets, it parses these packets to extract CSI information. Parsing CSI information involves analyzing the structure and fields of the packets to obtain various parameters of channel status information, such as amplitude, phase, etc.

Exchange of CSI information between two or more ESP chips

get_device_csi
  • Two ESP chips construct their own Ping request packets respectively. The Ping request packets contain information such as the source IP address, target IP address, timestamp, etc. These Ping request packets will be sent to the router. They do not communicate directly with each other, but realize indirect communication through the router as a relay.

  • After the router receives the Ping request packets sent by the two ESP chips, it determines which device the packets should be forwarded to based on the target IP address.

  • After ESP chip B receives the Ping request from ESP chip A, it generates a Ping reply packet based on the information in the request, and carries the required CSI information. When generating the reply, ESP chip B records the sending timestamp for subsequent round-trip time (RTT) calculation.

  • ESP chip B sends the generated Ping reply packet back to the router through the Wi-Fi module. Then the router forwards the Ping reply packet sent by ESP chip B to ESP chip A.

  • After ESP chip A captures the returned packets, it parses these packets to extract CSI information. Parsing CSI information involves analyzing the structure and fields of the packets to obtain various parameters of channel status information, such as amplitude, phase, etc.

Obtaining CSI information through a dedicated packet transmission device

get_broadcast_csi
  • The packet transmission device continuously sends broadcast packets on different wireless channels. Each time it sends a broadcast packet, it switches to a new wireless channel, thus covering the entire spectrum bandwidth.

  • All ESP devices will receive the broadcast packets sent by the packet transmission device. Since they are all working in monitoring mode, they can simultaneously capture the broadcast packets from the packet transmission device.

  • Each ESP device needs to parse these packets and extract the required CSI information after receiving the broadcast packets. Parsing broadcast packets involves analyzing the structure and fields of the packets to obtain various parameters of channel status information, such as amplitude, phase, etc.

Note

CSI data can only be obtained when the Wi-Fi packet rate is 802.11 a/g/n.

ESP-CSI References

Common Crystal Multi-Antenna Solution

The CSI research network cards used in the current algorithm deployment scenarios are mostly multi-antenna network cards. We design the common crystal of two chips, which can achieve a similar effect. esp-crab provides a Wifi-CSI RF phase synchronization solution, which includes two working modes: 1. Self-transmission and self-reception mode; 2. Single-transmission and dual-reception mode.

Common Crystal Solution Schematic and Example

  • Self-transmission and reception mode: In this mode, two ESP32-C5 chips send and receive signals respectively. By calculating the phase information in the received Wi-Fi CSI signal, it is possible to sense disturbances in the radio frequency signal path at the millimeter level. At the same time, by installing copper sheets to control the transmission path of the radio frequency signal, the sensing range can also be adjusted, thus providing technical support for high-precision short-range Wi-Fi sensing. This mode makes Wi-Fi signal sensing more refined, suitable for precise sensing applications in short distances and complex environments.

Self-transmission and reception amplitude effect Self-transmission and reception phase effect

  • Single-transmission dual-reception mode: In this mode, one ESP32-C5 chip is responsible for sending signals, while the two ESP32-C5 chips of esp-crab are responsible for receiving signals. By dispersing the sender and receiver, Wi-Fi sensing can be achieved in a large spatial range. The co-crystal Wi-Fi CSI information obtained by esp-crab can meet the performance requirements of Wi-Fi sensing in cutting-edge research, and can directly dock with mature advanced algorithms, further enhancing the accuracy and application value of the wireless sensing system. This mode provides strong technical support for wireless sensing and positioning in large ranges and complex environments.

Single-transmission dual-reception phase effect

Motion Detection Algorithm

We have designed a multi-antenna co-crystal development board for collecting and real-time processing of CSI data. The board is equipped with an ESP32-C3 and an ESP32-S3. The ESP32-C3 is connected to three onboard directional antennas through an antenna switch, while the ESP32-S3 is connected to an antenna socket to provide more flexible antenna types and signal transmission path choices. During operation, the ESP32-C3 continuously sends airborne packets (such as ESP-NOW), while the ESP32-S3 is responsible for obtaining CSI from the airborne packets sent by the ESP32-C3 that are reflected by the environment. The two chips are connected through a clock buffer to eliminate the relative frequency offset caused by the clock asynchrony between the two chips. In this way, the detection algorithm running on the ESP32-S3 can further utilize the phase information in the CSI data for detection. The calculation results and thresholds of the motion detection algorithm will be displayed on the screen in real time, and the motion detection results will be highlighted in red.

effect_show_of_motion_detect

Our Patents