All Projects → StevenMHernandez → ESP32-CSI-Tool

StevenMHernandez / ESP32-CSI-Tool

Licence: MIT License
Extract Channel State Information from WiFi-enabled ESP32 Microcontroller. Active and Passive modes available. (https://stevenmhernandez.github.io/ESP32-CSI-Tool/)

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ESP32-CSI-Tool

CsiGAN
An implementation for our paper: CsiGAN: Robust Channel State Information-based Activity Recognition with GANs (IEEE Internet of Things Journal, 2019), which is the semi-supervised Generative Adversarial Network (GAN) for Channel State Information (CSI) -based activity recognition.
Stars: ✭ 23 (-77%)
Mutual labels:  csi, channel-state-information
usbhostcopro
USB Host Co-processor
Stars: ✭ 54 (-46%)
Mutual labels:  esp32
IFTTTWebhook
DEPRECATED: Arduino SDK library for triggering IFTTT web hooks on ESP8266 and ESP32 processors
Stars: ✭ 28 (-72%)
Mutual labels:  esp32
Home-Fi
Home Automation App using Flutter, Adafruit IO & Esp32 dev board.
Stars: ✭ 60 (-40%)
Mutual labels:  esp32
aranya
Control all kinds of devices with Kubernetes
Stars: ✭ 16 (-84%)
Mutual labels:  csi
azurefile-csi-driver
Azure File CSI Driver
Stars: ✭ 83 (-17%)
Mutual labels:  csi
issues
Issue Tracker for ESPHome
Stars: ✭ 182 (+82%)
Mutual labels:  esp32
OneWireNg
Arduino 1-wire service library. OneWire compatible. Dallas thermometers support.
Stars: ✭ 32 (-68%)
Mutual labels:  esp32
CanAirIO
W A R N I N G: This is a previous proof of concept of CanAirIO device firmware over a TTGO T-Display board, but now it is only a old reference. The last stable version of CanAirIO device already have support for this board and many features more. Please use the official CanAirIO Firmware instead of this firmware. https://github.com/kike-canaries…
Stars: ✭ 12 (-88%)
Mutual labels:  esp32
Arduino-BLE-MIDI
MIDI over Bluetooth Low Energy (BLE-MIDI) 1.0 for Arduino
Stars: ✭ 133 (+33%)
Mutual labels:  esp32
FirebaseJson
🗃 JSON parser and builder for ESP8266, ESP32, Teensy3.x and Teensy4.x, SAM, SAMD and STM32 (128 k flash or more)
Stars: ✭ 29 (-71%)
Mutual labels:  esp32
esp32 CloudSpeech
Transcribe your voice by Google's Cloud Speech-to-Text API with esp32
Stars: ✭ 72 (-28%)
Mutual labels:  esp32
BulletGCSS
A High Caliber Ground Control Station System designed for the 21st century lifestyle
Stars: ✭ 29 (-71%)
Mutual labels:  esp32
telnetspy
Telnet Server For ESP8266: Cloning the serial port via Telnet. "Debugging over the air"
Stars: ✭ 41 (-59%)
Mutual labels:  esp32
TelegaGraph
TelegaGraph. Print messages from telegram to thermal printer
Stars: ✭ 23 (-77%)
Mutual labels:  esp32
ustd
Micro-standard-library providing minimal and portable array, queue and map for attiny avr, arduinos, esp8266/32 and linux, mac
Stars: ✭ 14 (-86%)
Mutual labels:  esp32
TP Arduino DigitalRain Anim
A library that represents Digital Rain Animation on color displays that support TFT_eSPI
Stars: ✭ 80 (-20%)
Mutual labels:  esp32
sps30
Sensirion SPS30 driver for ESP32, SODAQ, MEGA2560, UNO, ESP8266, Particle-photon on UART OR I2C coummunication
Stars: ✭ 57 (-43%)
Mutual labels:  esp32
Somfy Remote Lib
Emulate a Somfy remote using a 433.42 MHz transmitter.
Stars: ✭ 43 (-57%)
Mutual labels:  esp32
TinyPixelMapper
a Pixelmapping software for the ESP32 and ESP8266 for addressible LED Strips, with a OSC controll interface and FFT
Stars: ✭ 22 (-78%)
Mutual labels:  esp32

ESP32 CSI Tool

ESP32 CSI Tool Website

The purpose of this project is to allow for the collection of Channel State Information (CSI) from the ESP32 Wi-Fi enabled microcontroller. By collecting this data rich signal source, we can use this information for tasks such as Wi-Fi Sensing and Device-free Localization directly from the small, self contained ESP32 microcontroller.

The following projects can be found in this repository:

  • ./active_sta - Active CSI collection (Station) - Connects to some Access Point (AP) (Router or another ESP32) and sends packet requests (thus receiving CSI packet responses).
  • ./active_ap - Active CSI collection (AP) - AP which can be connected to by devices (ESP32, see previous).
  • ./passive - Passive CSI collection - Passively listens for CSI frames on a given channel (default: channel 3).

Each project automatically sends the collected CSI data to both serial port and SD card (if present). These settings can be configured as described below.

In addition to these ESP32 specific projects, we also consider methods for analyzing CSI in Python and MATLAB (See Analysing CSI Data below).

Installation

First, Install Espressif IoT Development Framework (ESP-IDF) by following their step by step installation guide. Notice, this project requires version (v4.3) of ESP-IDF.

Important: It is important that you are able to successfully build and flash the example project from the esp-idf guide onto your own esp32. If you have issues building the example project on your hardware, do not create an issue in this github repo. We will not be able to assist with general ESP32 issues (those issues that are unrelated to this project).

Next, clone this repository:

git clone https://github.com/StevenMHernandez/esp32-csi-tool

Finally, decide which sub-project you would like to flash to your ESP32(s). The simplest case would be to use two ESP32s. One using the Active CSI collection (Station) codebase and the other using the Active CSI collection (AP) codebase. To begin working with a given codebase, open a terminal and change into the respective directory.

cd ./active_sta # For Active Station
# OR
cd ./active_ap # For Active Access Point
# OR
cd ./passive # For Passive CSI collection

We can now begin configuring and flashing your ESP32.

Configuration (ESP-IDF)

The ESP-IDF provides great control over project configuration. This configuration can be updated by running the following command from your terminal.

idf.py menuconfig

It is important to notice that these configurations are project specific and will not automatically be copied between sub-projects. So for example, make sure when you change the Wi-Fi password in Active CSI collection (AP), you also update this configuration in the Active CSI collection (Station) project as well.

The following configurations are important for this project:

  1. Serial flasher config > 'idf.py monitor' baud rate > Custom Baud Rate
  2. Serial flasher config > Custom baud rate value > 1552000 This allows more data to be transmitted on the Serial port
  3. Component config > Common ESP32-related > Channel for console output > Custom UART
  4. Component config > Common ESP32-related > UART console baud rate > 1552000
  5. Component config > Wi-Fi > WiFi CSI(Channel State Information) (Press space to select)
  6. Component config > FreeRTOS > Tick rate (Hz) > 1000
  7. ESP32 CSI Tool Config > **** all options in this menu can be specified per your experiment requirements.

NOTE: For some systems, baud rate 1552000 does not work. Good alternatives to try are 921600, 1000000, 1152000, and 1500000.
The higher baud rate the better! Baud rate is extremely important to achieve high sampling rates without lag!
If you have a problem, please leave any relevant information such as operating system, esp-idf version, list of all baud rates work and baud rates that do not work etc in issue #5.

Flash ESP32

Run the following command from within one of the sub-project's directories.

idf.py flash monitor

This will flash the ESP32 and once completed, will print incoming data from the freshly programmed ESP32's serial port. To exit monitoring, use ctrl+]

Collecting CSI Data

There are two methods to collect CSI data. If your ESP32 has an SD card on board (such as the TTGO T8 V1.7 ESP32), the ESP32 will automatically detect the SD card and automatically output CSI data to a simple csv file.

If the device does not have an SD card or you wish to collect the data directly from the Serial port on your computer, you can run the following command:

# macOS or Linux
idf.py monitor | grep "CSI_DATA" > my-experiment-file.csv

# Windows
idf.py monitor | findstr "CSI_DATA" > my-experiment-file.csv 

Because the clocks on the ESP32 are not synchronized with any real world time, it can be difficult to sync this data with other external data sources or sensors. To help with this, we can pass output first through a python script which appends a timestamp from your computer.

idf.py monitor | python ./python_utils/serial_append_time.py > my-experiment-file.csv

Analysing CSI Data

Once data has been collected, we now wish to run analysis and (most likely) apply deep learning algorithms on the collected data. Luckily, the output from the esp32 is a simple CSV file, thus we can pass the contents to any available CSV parser in our language of choice (Python, MATLAB, R, etc.). The use of CSV was selected for its simplicity and small size when compared with the likes of XML or JSON.

Advanced:

Setting Local Time

Because the ESP32 is not connected to the internet as a whole, it is not possible to automatically set the clock time locally. To handle this, we offer the ability to set the time in a couple of different ways.

First, while running idf.py monitor we can type the following SETTIME: 123123123123 then ENTER where the number 123123123123 indicates the current UNIX time in seconds.

Additionally, the access point code in ./active_ap will automatically send its current timestamp to any connected station running the ./active_sta sub-project. This means that you only need to set the time for the access point and all other nodes will synchronize automatically.

Finally, the simplest method is to simply run the output of idf.py monitor through a utility function which appends the correct timestamp to the output when received on your computer as described in the *Collecting CSI Data section above.

Misc.

ESP32 CSI Tool developed by Steven M. Hernandez

Cite this Tool with BibTeX

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].