Description
Basic Infos
- This issue complies with the issue POLICY doc.
- I have read the documentation at readthedocs and the issue is not addressed there.
- I have tested that the issue is present in current master branch (aka latest git).
- I have searched the issue tracker for a similar issue.
- If there is a stack dump, I have decoded it.
- I have filled out all fields below. <- my core code is like 12 files.
Platform
- Hardware: ESP8285 device
- Core Version: latest git
- Development Env: Arduino IDE
- Operating System: Ubuntu
Settings in IDE
- Module: Nodemcu
- Flash Mode: ?
- Flash Size: 4MB
- lwip Variant: v2 Lower Memory
- Reset Method: nodemcu
- Flash Frequency: ?
- CPU Frequency: 80Mhz
- Upload Using: SERIAL
- Upload Speed: 115200
Problem Description
Working on a node MCU E-12 .
I've been trying out promiscuous mode, as from the mini sniffer or spacehuhns project. I tried if it was possible to connect wifi while using this mode.
(after disabling promicous_mode, setting a new callback, and then reenabling it)
WiFi.status() kept responding 0 although that the connection didn't seem to be successful -> because, client.connect(WiFi.gatewayIP(); ,80); //tried it with my router first, both respond 0.
So, is this intended behavior? shouldn't wifi.status change it's status if promiscuous mode cancels it?
recalling Wifi.disconnect() and Wifi.begin() right after, on the same network, seems to get stuck indefinetly.
This works:
Serial.println(WiFi.status());
Serial.println("start udp");
wifi_promiscuous_enable(disable);
WiFi.disconnect(true);
WiFi.begin(ssid, pw);
wait_for_wifi();
WiFiClient client;
const int httpPort = 80;
if (!client.connect(WiFi.gatewayIP(), httpPort)) {
Serial.println("connection failed");
return;
}{
Serial.println("success 80 ");
}
wifi_promiscuous_enable(enable);
Serial.println("end udp");
So i have to disable promiscuous mode when connecting or using wifi. otherwise begin will get stuck and any connection tries will return 0.
I am guessing i can't use promiscuous mode while using the wifi normally. which seems a little odd since it doesn't seem like it gets in the way of normal traffic. If promiscuous mode just listens in on whatever floats through the air it shouldn't really matter if those packets are addressed to me.
And if it is a problem, shouldn't WiFi.begin scream if promiscuous mode gets or is enabled while it is called ?