ESP8266 Developer Zone The Official ESP8266 Forum 2016-02-26T12:09:31+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1458 2016-02-26T12:09:31+08:00 2016-02-26T12:09:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1458&p=5832#p5832 <![CDATA[Re: Regarding Promiscuous Mode]]>

Statistics: Posted by redduck1234 — Fri Feb 26, 2016 12:09 pm


]]>
2016-02-26T00:24:44+08:00 2016-02-26T00:24:44+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1458&p=5829#p5829 <![CDATA[Re: Regarding Promiscuous Mode]]> :D thanks a lot

Code:

wifi_station_connect();
vTaskDelay(2000);
wifi_station_disconnect;
wifi_promiscuous_enable(1);
wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t2);

Statistics: Posted by Rutharesh — Fri Feb 26, 2016 12:24 am


]]>
2015-12-01T16:48:07+08:00 2015-12-01T16:48:07+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1458&p=4851#p4851 <![CDATA[Re: Regarding Promiscuous Mode]]>
Please do not put codes below in the user_init, you can use a task to call them.

Code:

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 !

Statistics: Posted by ESP_Faye — Tue Dec 01, 2015 4:48 pm


]]>
2015-12-01T15:16:42+08:00 2015-12-01T15:16:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1458&p=4843#p4843 <![CDATA[[Solved] Regarding Promiscuous Mode]]>
#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

Statistics: Posted by Rutharesh — Tue Dec 01, 2015 3:16 pm


]]>