-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266 Wireless "pm open,type:2 0" Problem... #3134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Additional InformationIf I add the below to the beginning of the loop
The code still drops out after 3 to 6 readings... After this, the readings stay zero even after the Wifi reconnects successfully. Once the readings become 0, the only way to fix it is to power cycle the Wemos... I have also tried adding the following after reading some other posts... but this did nothing. At the top of the sketch:
In the setup_wifi() function
After doing this the debug error changed to pm open,type:0 0 Any ideas....? Thanks, |
UpdateI got the below code to work for over an hour so far with the wireless enabled. The problem now, however, is when I add the MQTT, the output, eventually, reverts back to 0 readings. All I've done is play a bit with the delay values and added:
along the previously mentioned sleep and user_interface.h commands. (I placed it in the main loop and the status always returns a 3 which means connected). I'm not sure if the RAM is filling up and simply calling on the WiFi.status gives it a change to catch-up or what? But it's a big bummer that as soon as I add the MQTT code back in, the original problem re-appears. At least this feels like some progress... I'll keep at this, but any help is GREATLY appreciated. I'm in over my head here. The below code works with wireless but NOT with MQTT
|
I'm going to close this since I no longer believe this is an ESP8266 issue. Currently I have hooked the CO2 sensor up to a relay and every-time I get a zero reading, I power cycle the sensor. This solves the problem but is a pretty crude work-around. I'm not sure if the sensor is going to sleep or if the issue is with the ESP8266, but I believe it is more likely sensor related. It is strange however, that the sensor malfunction appears to be MQTT code related and does not happen without MQTT code... Anyway, I'll just use my current work-around for now. |
I experience exaclty the same problem. Adding MQTT code halts execution completely. --------------WiFi no longer connected! [WIFI] Connecting BSSID: 10:62:EB:F2:40:24 SSID: ELLA_24GHz Channal: 4 (-61) connected with ELLA_24GHz, channel 4 |
maybe the problem with router |
Apologies for bumping this issue but this problem still presist with my hardware and this is the first result that comes out when Googling it. According to this comment, I've managed to fix these problems by forcing the WiFi module to stay awake and setting the WiFi to never sleep: WiFi.forceSleepWake();
WiFi.setSleepMode(WIFI_NONE_SLEEP); |
Re. ESP8266 “pm open,type:2 0” wifi issue. I understand that this usually occurs during a wifi connect attempt, after the “connected with ????, channel 1” and “dhcp client start” events (and is apparently supposed to mean something has entered a sleep state). It immediately causes a “state: 5 -> 0 (0)” and the ESP8266 abandons the wifi connection attempt. (At it had already “connected with ????...” it does not do any subsequent “no ???? found, reconnect after 1s” activities.) I believe it is being caused by an error in the internal (closed source) client-ESP8266 code which gets the DHCP address from the remote router, as when it works you see “ip:192.168.?.100,mask:255.255.255.0,gw:192.168.?.1” instead of “pm open,type:2 0”. Note that the error (for me) is a permanent one. IE. if the client-ESP8266’s software is in a state where the error occurs, it will occur every time. No amount of clearing the flash/wifi settings and re-flashing of the same software will fix it. Some users have said that changing the remote router has helped. In my case the remote router I am trying to connect to is a 2nd router-ESP8266 (in “WiFi.softAP()” mode). And in my case the issue appears to have something to do with my ESP8266 code, as if I change the code in EITHER the client OR the router, I can get it to always work perfectly again. So I believe it is an issue related to failing to get a DHCP address, possibly caused by some weird timing-conflict (between the code running on the client-ESP8266, and the code running on the remote router). To fix it I just need to change my code in the client-ESP8266 unit and I can change it from never working to always working. And it usually only needs a very small change such as adding a new “Serial.println()” line in “setup()”, which would seem to suggest there might also be a code-alignment/word-alignment issue somewhere. Finally note that even when I’m getting the “pm open,type:2 0” issue between one “client-ESP8266 (eg. AT Tinker branded)” and one of my “router-ESP8266”:
Which would seem to imply that it is also effected by the hardware it is running on. Note that the same code will work on some of my ESP8266s, but NOT on other of my ESP8266s. (All my ESP8266 are D1mini’s, but purchased at different times with different branding.) Summary: I hope this info will be of use. |
This is dark magic :)
|
INFO
Using a CO2 sensor with an ESP8266 via I2C. Transmitting data over wifi to a raspberry pi access point via MQTT Mosquitto broker. Works great for anywhere between 3 to 9 readings but then I get an error (or what I assume is an error)...
"pm open,type:2 0"
I assume this is the error because the readings always stop on the next set after this bugger shows up.
I have no idea what it means, so any suggestions would be GREATLY appreciated.
Below is both the code and debug output. Originally I removed all MQTT and Wireless parts from the code to narrow down the problem. When all of this was removed the readings were perfect for hours. Then I removed only the MQTT parts and left the wireless. BOOM... readings stop after a few iterations... the problem is somewhere in the wireless, not with MQTT. In addition to the pm open error, there also seem to be some weird reconnects (from debug) happening when the connection is first made. Are these supposed to occur?
DEBUG
CODE
The text was updated successfully, but these errors were encountered: