Code Monkey home page Code Monkey logo

esp32-80211-tx's Introduction

esp_wifi_80211_tx sample code

Rickrolling with WiFi Networks

Introduction

Sending arbitrary IEEE 802.11 frames can be useful in various ways, e.g. for mesh networking, unidirectional long-distance communication or low-overhead data transmission. It can, however, be abused for spamming large numbers of invalid SSIDs, jamming WiFi networks or sending deauthentication frames in order to sniff SSIDs of hidden wireless networks. Please be advised that such usage is morally doubtful at best and illegal at worst. Use this at your own risk.

Espressif have now created the esp_wifi_80211_tx API, making esp32free80211 obsolete. The new function is thoroughly documented in the API guide. Since at the time of writing not a lot of sample code using esp_wifi_80211_tx exists and many developers wanting to send arbitrary data with their ESP32s end up using esp32free80211 with an outdated esp-idf version, I want to hereby provide some more up-to-date sample code for esp_wifi_80211_tx.

Project Description

In order to demonstrate the freedom output functionality, this software broadcasts the infamous lines from Rick Astley's Never gonna give you up. This is achieved by manually assembling IEEE 802.11 beacon frames in main.c and broadcasting them via the currently unofficial esp_wifi_80211_tx API in Espressif's esp32-wifi-lib.

If you want to use raw packet sending functionality in your own project, just declare the esp_wifi_80211_tx function like this:

// buffer: Raw IEEE 802.11 packet to send
// len: Length of IEEE 802.11 packet
// en_sys_seq: see https://github.com/espressif/esp-idf/blob/master/docs/api-guides/wifi.rst#wi-fi-80211-packet-send for details
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);

Compile / Flash

This project uses the Espressif IoT Development Framework. With the ESP-IDF installed, execute

make menuconfig

and configure the SDK to use your preferred settings (baudrate, python2 executable, serial flasher port, …) and proceed to compile and flash this project using

make flash

Project License: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

esp32-80211-tx's People

Contributors

bandi13 avatar jeija avatar redfast00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-80211-tx's Issues

Way to receive in the same low overhead manner?

Is there any? I am trying to make a short range link with lowest possible latency. So far experimenting with esp-now I achieved around 700 packets per second with about 1ms latency, but I wonder if sending with esp32-80211-tx will yield better results. Could you hint on a way to receive raw packets? Do you have an example maybe?

Issue while building project

Hi, I am currently running Ubuntu trying to flash your program on a ESP32 board but when executing the "idf.py build" I get an error.
I will attach the error down bellow. If it´s anything you have already dealt with before I would appreciate it if you guide me how to get it fixed.
/home/name/Esp/esp-idf/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
2 | #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
| ^~~~~~~
../main/main.c:53:36: error: unknown type name 'system_event_t'
53 | esp_err_t event_handler(void *ctx, system_event_t *event) {
| ^~~~~~~~~~~~~~
../main/main.c: In function 'app_main':
../main/main.c:95:9: error: implicit declaration of function 'tcpip_adapter_init' [-Werror=implicit-function-declaration]
95 | tcpip_adapter_init();
| ^~~~~~~~~~~~~~~~~~
In file included from /home/name/Esp/esp-idf/components/esp_hw_support/include/esp_intr_alloc.h:11,
from /home/name/Esp/esp-idf/components/esp_hw_support/include/esp_cpu.h:20,
from /home/name/Esp/esp-idf/components/esp_hw_support/include/spinlock.h:11,
from /home/name/Esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:74,
from /home/name/Esp/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h:58,
from /home/name/Esp/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:70,
from ../main/main.c:1:
../main/main.c:99:25: error: implicit declaration of function 'esp_event_loop_init'; did you mean 'esp_event_loop_run'? [-Werror=implicit-function-declaration]
99 | ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
| ^~~~~~~~~~~~~~~~~~~
/home/name/Esp/esp-idf/components/esp_common/include/esp_err.h:117:30: note: in definition of macro 'ESP_ERROR_CHECK'
117 | esp_err_t err_rc_ = (x);
| ^
../main/main.c:99:45: error: 'event_handler' undeclared (first use in this function); did you mean 'xt_handler'?
99 | ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
| ^~~~~~~~~~~~~
/home/name/Esp/esp-idf/components/esp_common/include/esp_err.h:117:30: note: in definition of macro 'ESP_ERROR_CHECK'
117 | esp_err_t err_rc_ = (x);
| ^
../main/main.c:99:45: note: each undeclared identifier is reported only once for each function it appears in
99 | ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
| ^~~~~~~~~~~~~
/home/name/Esp/esp-idf/components/esp_common/include/esp_err.h:117:30: note: in definition of macro 'ESP_ERROR_CHECK'
117 | esp_err_t err_rc_ = (x);
| ^
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
HINT: Maybe you forgot to import tcpip_adapter_init, esp_event_loop_init library(s) in header file or add the necessary REQURIES component. Try to add missing libraries to your project header file or check idf_component_register(REQUIRES ...) section in your component CmakeList.txt file. For more information run 'idf.py docs -sp api-guides/build-system.html'.
ninja failed with exit code 1, output of the command is in the /home/name/Esp/esp32-80211-tx/build/log/idf_py_stderr_output_155569 and /home/name/Esp/esp32-80211-tx/build/log/idf_py_stdout_output_155569

broadcast user data

Hii Jeija,
Is there any way that I can broadcast user data like wifi password in beacon frame ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.