[Solved] Regarding Promiscuous Mode
[Solved] Regarding Promiscuous Mode
Postby Rutharesh » Tue Dec 01, 2015 3:16 pm
As per the Documentation provided in the link "http://nonnoise.github.io/ESP-WROOM-02/_downloads/2C-ESP8266__SDK__Programming%20Guide__EN_v1.1.1.pdf", i have used the esp8266 to connect it in Promiscuous Mode, using the "ESP8266_RTOS_SDK" in the link "https://github.com/espressif/ESP8266_RTOS_SDK". In the sdk folder examples/project_template/user i have edited the file user_main.c with the code,
#include "esp_common.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
/*
* To set the Buad rate
*/
void ICACHE_FLASH_ATTR
UART_SetBaudrate(uint8 uart_no, uint32 baud_rate)
{
uart_div_modify(uart_no, UART_CLK_FREQ / baud_rate);
}
void ICACHE_FLASH_ATTR
wifi_promiscuous_cb_t1(uint8 *buf, uint16 len)
{
printf("Received packet");
}
wifi_promiscuous_cb_t wifi_promiscuous_cb_t2 = wifi_promiscuous_cb_t1;
/*
* This is entry point for user code
*/
void ICACHE_FLASH_ATTR
user_init(void)
{
UART_SetBaudrate(0,115200);
struct station_config * config = (struct station_config *)zalloc(sizeof(struct
station_config));
wifi_set_opmode(0x01);
sprintf(config->ssid, "SSID");
sprintf(config->password, "password");
wifi_station_set_config(config);
free(config);
wifi_station_connect();
vTaskDelay(2000);
wifi_station_disconnect;
wifi_promiscuous_enable(1);
wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t2);
}
after building the project template using gen_misc.sh, i have flashed it using "esptool".
By using the minicom i see the serial monitor output where it prints that esp8266 is connected to ssid and by using the dhcp it gets ip and it prints,after that nothing is happening. can you help to get working in the Promiscuous mode. here is the minicom output.
mode : sta(18:fe:34:fa:36:87)
add if0
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 14
pm open phy_2,type:2 0 0
cnt
connected with SSID, channel 7
dhcp client start...
ip:10.10.10.50,mask:255.255.255.0,gw:10.10.10.1
#include "esp_common.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
/*
* To set the Buad rate
*/
void ICACHE_FLASH_ATTR
UART_SetBaudrate(uint8 uart_no, uint32 baud_rate)
{
uart_div_modify(uart_no, UART_CLK_FREQ / baud_rate);
}
void ICACHE_FLASH_ATTR
wifi_promiscuous_cb_t1(uint8 *buf, uint16 len)
{
printf("Received packet");
}
wifi_promiscuous_cb_t wifi_promiscuous_cb_t2 = wifi_promiscuous_cb_t1;
/*
* This is entry point for user code
*/
void ICACHE_FLASH_ATTR
user_init(void)
{
UART_SetBaudrate(0,115200);
struct station_config * config = (struct station_config *)zalloc(sizeof(struct
station_config));
wifi_set_opmode(0x01);
sprintf(config->ssid, "SSID");
sprintf(config->password, "password");
wifi_station_set_config(config);
free(config);
wifi_station_connect();
vTaskDelay(2000);
wifi_station_disconnect;
wifi_promiscuous_enable(1);
wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t2);
}
after building the project template using gen_misc.sh, i have flashed it using "esptool".
By using the minicom i see the serial monitor output where it prints that esp8266 is connected to ssid and by using the dhcp it gets ip and it prints,after that nothing is happening. can you help to get working in the Promiscuous mode. here is the minicom output.
mode : sta(18:fe:34:fa:36:87)
add if0
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 14
pm open phy_2,type:2 0 0
cnt
connected with SSID, channel 7
dhcp client start...
ip:10.10.10.50,mask:255.255.255.0,gw:10.10.10.1
Re: Regarding Promiscuous Mode
Postby ESP_Faye » Tue Dec 01, 2015 4:48 pm
Hi,
Please do not put codes below in the user_init, you can use a task to call them.
Thanks for your interest in ESP8266 !
Please do not put codes below in the user_init, you can use a task to call them.
Code: Select all
wifi_station_connect();
vTaskDelay(2000);
wifi_station_disconnect;
wifi_promiscuous_enable(1);
wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t2);
Thanks for your interest in ESP8266 !
Re: Regarding Promiscuous Mode
Postby Rutharesh » Fri Feb 26, 2016 12:24 am
When i use a task to call this code it works
thanks a lot


Code: Select all
wifi_station_connect();
vTaskDelay(2000);
wifi_station_disconnect;
wifi_promiscuous_enable(1);
wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t2);
-
- Posts: 1
- Joined: Fri Feb 26, 2016 12:06 pm
Who is online
Users browsing this forum: No registered users and 16 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.