Page 1 of 2
Monitor mode
Posted:
Mon Jan 19, 2015 10:17 am
by GregoryR
Greetings to all!
Is it possible to use ESP module in monitor mode, and how to capture network traffic?
Are there any examples?
Re: Monitor mode
Posted:
Mon Jan 19, 2015 12:51 pm
by Fr4gg0r
Would be good if someone asked that question on the manufacturer's forum.
Re: Monitor mode
Posted:
Tue Jan 20, 2015 1:17 am
by GregoryR
Tell me please, what this code does?
Code: Select all#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#include "user_config.h"
#include "user_interface.h"
#include "driver/uart.h"
os_event_t user_procTaskQueue[user_procTaskQueueLen];
static volatile os_timer_t channelHop_timer;
static void loop(os_event_t *events);
static void promisc_cb(uint8 *buf, uint16 len);
void channelHop(void *arg)
{
// 1 - 13 channel hopping
uint8 new_channel = wifi_get_channel() % 12 + 1;
os_printf("** hop to %d **\n", new_channel);
wifi_set_channel(new_channel);
}
static void ICACHE_FLASH_ATTR
promisc_cb(uint8 *buf, uint16 len)
{
os_printf("-> %3d: %d", wifi_get_channel(), len);
printmac(buf, 4);
printmac(buf, 10);
printmac(buf, 16);
os_printf("\n");
}
//Main code function
static void ICACHE_FLASH_ATTR
loop(os_event_t *events)
{
os_delay_us(10);
}
//Init function
void ICACHE_FLASH_ATTR
user_init()
{
uart_init(115200, 115200);
os_delay_us(100);
uart0_sendStr("*** Monitor mode test ***\r\n");
os_printf(" -> Promisc mode setup ... ");
wifi_set_promiscuous_rx_cb(promisc_cb);
wifi_promiscuous_enable(1);
os_printf("done.\n");
os_printf(" -> Timer setup ... ");
os_timer_disarm(&channelHop_timer);
os_timer_setfn(&channelHop_timer, (os_timer_func_t *) channelHop, NULL);
os_timer_arm(&channelHop_timer, CHANNEL_HOP_INTERVAL, 1);
os_printf("done.\n");
os_printf(" -> Set opmode ... ");
wifi_set_opmode( 0x1 );
os_printf("done.\n");
//Start os task
system_os_task(loop, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
os_printf(" -> Init finished!\n\n");
}
Re: Monitor mode
Posted:
Fri May 27, 2016 7:31 am
by Pratik Lodha
did you find out how to run it in monitor mode