Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Rutharesh
#35418 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