Skip to content

pham-tuan-binh/rust-wifi-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wifi Visualizer Using Rust on ESP32

Thumb

This project uses an ESP32 microcontroller and a WS2812 LED matrix to create a visual representation of WiFi packets. The visualization mimics the cascading digital rain effect seen in The Matrix, with packets streaming down the LED matrix in a dynamic and fluid manner. The firmware is written in Rust, leveraging the esp-hal-smartled library for LED control and ESP WiFi for network connectivity. This creates an engaging way to monitor network activity in real time.

A YouTube video walking through this project can be found here.

P/S: Technically, I'm a 2 days old Rust developer at the time of this repo publishment. So if you see a lot of unsafe blocks and static variables in my code instead of atomic structures, I know, I'm sorry :_(

Hardware Components

  • ESP32: The microcontroller used for running the firmware. This can be any ESP32 variant that is supported by Esp-hal crate.
  • WS2812 Matrix: An addressable RGB LED matrix controlled via a single data pin.

Software Components

  • ESP WiFi: Enables network connectivity for the ESP32.
  • esp-hal-smartled: A Rust library for driving WS2812 and similar addressable LEDs.

Installing the Toolchain & Building the Project

  1. Install Rust and Cargo
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Install ESP32 Rust Toolchain
    cargo install espflash espup
    espup install
    # In Unix systems, source the export file
    . $HOME/export-esp.sh
  3. Build and Flash the Firmware
    cargo run --release

Changing the Target for Different ESP32 Variants

To target a different ESP32 chip, modify the target field in the .cargo/config.toml file accordingly:

Then, build and flash:

cargo run --release

Modifying LED Matrix Dimensions

To change the LED matrix dimensions, edit main.rs:

// Const Configuration
const ROW_SIZE: usize = <NEW_ROW_SIZE>;
const COL_SIZE: usize = <NEW_COL_SIZE>;
const LED_COUNT: usize = ROW_SIZE * COL_SIZE;

Credits

Special thanks to:

License

This is just a for-fun weekend project, so it's free-for-all to use, distribute and modify. However, I would love to know if you are building something cool on top of this or inspired by this. Ping me at binhpham@binhph.am or tag me on social media.

Don't stop building and learning. From your friendly neighborhood guy who builds stuff.

About

Real-time Wi-Fi traffic visualizer using Rust on ESP32

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages