{"action":"closed","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/5383","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/5383/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/5383/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/5383/events","html_url":"https://github.com/esp8266/Arduino/issues/5383","id":385210199,"node_id":"MDU6SXNzdWUzODUyMTAxOTk=","number":5383,"title":"ESP8266  web server stops responding after some time while sending sensor data ","user":{"login":"BlackBlood007","id":45422345,"node_id":"MDQ6VXNlcjQ1NDIyMzQ1","avatar_url":"https://avatars3.githubusercontent.com/u/45422345?v=4","gravatar_id":"","url":"https://api.github.com/users/BlackBlood007","html_url":"https://github.com/BlackBlood007","followers_url":"https://api.github.com/users/BlackBlood007/followers","following_url":"https://api.github.com/users/BlackBlood007/following{/other_user}","gists_url":"https://api.github.com/users/BlackBlood007/gists{/gist_id}","starred_url":"https://api.github.com/users/BlackBlood007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlackBlood007/subscriptions","organizations_url":"https://api.github.com/users/BlackBlood007/orgs","repos_url":"https://api.github.com/users/BlackBlood007/repos","events_url":"https://api.github.com/users/BlackBlood007/events{/privacy}","received_events_url":"https://api.github.com/users/BlackBlood007/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-28T10:53:46Z","updated_at":"2018-11-28T19:56:01Z","closed_at":"2018-11-28T19:56:00Z","author_association":"NONE","body":"----------------------------- Delete below -----------------------------\r\n\r\nIf your issue is a general question, starts similar to \"How do I..\", is related to 3rd party libs, or is related to hardware, please discuss at a community forum like esp8266.com.\r\n\r\nINSTRUCTIONS\r\n============\r\nIf you do not follow these instructions, your issue may be dismissed.\r\n\r\n1. Follow the checklist under Basic Infos and fill in the [ ] spaces with an X.\r\n2. Fill in all the fields under Platform and Settings in IDE marked with [ ] (pick the correct option for you in each case, delete the others).\r\n3. If you haven't already done so, test your issue against current master branch (aka latest git), because it may have been already fixed.\r\n4. Describe your problem.\r\n5. If you have a STACK DUMP decode it:\r\n\r\nhttps://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html\r\n\r\n6. Include a Minimal Complete Reproducible Example sketch that shows your issue. Do not include your entire project, or a huge piece of code.\r\n7. Include debug messages:\r\n\r\nhttps://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html \r\n\r\n8. Use markup (buttons above) and the Preview tab to check what the issue will look like.\r\n9. Delete these instructions from the above to the below marker lines before submitting this issue.\r\n\r\n\r\n----------------------------- Delete above -----------------------------\r\n\r\n### Basic Infos\r\n\r\n- [ ] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).\r\n- [ ] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.\r\n- [ ] I have tested that the issue is present in current master branch (aka latest git).\r\n- [ ] I have searched the issue tracker for a similar issue.\r\n- [ ] If there is a stack dump, I have decoded it.\r\n- [ ] I have filled out all fields below.\r\n\r\n#### Platform\r\n\r\n- Hardware:\t\t\t\t\t[ESP-12|ESP-01|ESP-07|ESP8285 device|other]\r\n- Core Version:\t\t\t[latest git hash or date]\r\n- Development Env:\t\t[Arduino IDE|Platformio|Make|other]\r\n- Operating System:\t\t[Windows|Ubuntu|MacOS]\r\n\r\n### Settings in IDE\r\n\r\n- Module:  \t\t\t[Generic ESP8266 Module|Wemos D1 mini r2|Nodemcu|other]\r\n- Flash Mode:\t\t\t[qio|dio|other]\r\n- Flash Size: \t\t[4MB/1MB]\r\n- lwip Variant:   [v1.4|v2 Lower Memory|Higher Bandwidth]\r\n- Reset Method:\t\t[ck|nodemcu]\r\n- Flash Frequency:\t[40Mhz]\r\n- CPU Frequency:\t\t[80Mhz|160MHz]\r\n- Upload Using:\t\t[OTA|SERIAL]\r\n- Upload Speed:   [115200|other] (serial upload only)\r\n\r\n\r\n### Problem Description\r\n\r\nDetailed problem description goes here.\r\n\r\n\r\n### [MCVE](https://stackoverflow.com/help/mcve) Sketch\r\n\r\n```cpp#include <ESP8266WiFi.h> \r\n#include <WiFiClient.h> \r\n#include <ESP8266WebServer.h>\r\n#include <ESP8266mDNS.h>\r\n#include<dht.h>\r\n\r\n//multiplexing\r\n//int x=D3;\r\nint s0 = D0;\r\nint s1 = D1;\r\nint s2 = D2;\r\nint s3 = D6;\r\nint sig=D5;\r\n\r\n\r\n//Temperature \r\ndht DHT;\r\nint d=2;\r\n\r\n//LIGHT\r\n//analog pin\r\nint ldr=A0;\r\n//D3\r\nint led=0;\r\n\r\n//PIR SENSOR\r\n//D8\r\nint pir=15;\r\n//D7\r\nint pirled=13;\r\nString sensordata=\"\";\r\nESP8266WebServer server(80);\r\n\r\n\r\nString page=\"\";\r\n\r\nvoid handleClient()\r\n{\r\nString message=\"\";\r\n    message+=\"number of args  \";\r\nmessage+=server.args();\r\nmessage+=\" \"+server.argName(0)+\" \"+server.arg(0);\r\n  // server.send(200, \"text/plain\",message);  \r\n  \r\n   if(server.arg(0).equals(\"on\"))\r\n   {\r\n    \r\ndigitalWrite(s0,HIGH);\r\ndigitalWrite(s1,HIGH);\r\ndigitalWrite(s2,HIGH);\r\ndigitalWrite(s3, HIGH);\r\ndigitalWrite(sig,LOW);\r\n//server.send(200, \"text/plain\",\"on\"); \r\n   }\r\n   else if(server.arg(0).equals(\"off\"))\r\n   {\r\n    \r\ndigitalWrite(s0,LOW);\r\ndigitalWrite(s1,LOW);\r\ndigitalWrite(s2,LOW);\r\ndigitalWrite(s3,LOW);\r\ndigitalWrite(sig,LOW);\r\n//server.send(200, \"text/plain\",\"off\"); \r\n   }\r\n}\r\nvoid setup() \r\n{\r\n  Serial.begin(9600);\r\n  //WiFi.begin(\"sanghi@19\",\"9165269100@19699\");\r\nWiFi.begin(\"Satyam\",\"hell1234\");\r\n  delay(50);\r\n  while(WiFi.status() != WL_CONNECTED)\r\n  {\r\n    delay(500);\r\n    Serial.println(\".\");\r\n  }\r\n  \r\n   Serial.println(\"\");\r\n  Serial.print(\"Connected to \");\r\n  Serial.println(\"sanghi@19\");\r\n  Serial.print(\"IP address: \");\r\n  Serial.println(WiFi.localIP());\r\n\r\n  //LIGHT\r\n  \r\n  pinMode(led,OUTPUT);\r\n  pinMode(ldr,INPUT);\r\n\r\n  //PIR\r\n  pinMode(pir,INPUT);\r\n  pinMode(pirled,OUTPUT);\r\n\r\n  //multiplexing\r\n  pinMode(s0, OUTPUT);\r\n  pinMode(s1, OUTPUT);\r\n  pinMode(s2, OUTPUT);\r\n  pinMode(s3, OUTPUT);\r\n  pinMode(sig,OUTPUT);\r\n  digitalWrite(s0, LOW);\r\n  digitalWrite(s1, LOW);\r\n  digitalWrite(s2, LOW);\r\n  digitalWrite(s3, LOW);\r\n  digitalWrite(sig,LOW);\r\n\r\n  if (MDNS.begin(\"esp8266\")) {\r\n    Serial.println(\"MDNS responder started\");\r\n  }\r\n server.on(\"/\", handleClient);\r\n   server.on(\"/sensordata\", [](){\r\n   \r\n  server.send(200, \"text/plain\",sensordata);\r\n  });\r\n   \r\n  server.begin();\r\n   Serial.println(\"HTTP server started\");\r\n  delay(3000);\r\npinMode(s0, OUTPUT);\r\npinMode(s1, OUTPUT);\r\npinMode(s2, OUTPUT);\r\npinMode(s3, OUTPUT);\r\npinMode(sig,OUTPUT);\r\ndigitalWrite(s0, LOW);\r\ndigitalWrite(s1, LOW);\r\ndigitalWrite(s2, LOW);\r\ndigitalWrite(s3, LOW);\r\ndigitalWrite(sig,LOW);\r\n}\r\n\r\nvoid loop() {\r\n\r\n server.handleClient();\r\n  int chk = DHT.read11(d);\r\n // Serial.print(\"Temperature = \");\r\n // Serial.println(DHT.temperature);\r\n // Serial.print(\"Humidity = \");\r\n // Serial.println(DHT.humidity);\r\n\r\n // sensordata+=\"<br>   temperature : \"+String(DHT.temperature)+\"  humidity :  \"+String(DHT.humidity);\r\n sensordata+=\",temperature : \"+String(DHT.temperature)+\"  humidity :  \"+String(DHT.humidity);\r\n // delay(500);\r\n///// LIGHT  ////////////////////////////////// \r\n\r\n // Serial.print(\"Light Intensity :\");\r\n // Serial.println(analogRead(ldr));\r\nint reading=analogRead(ldr);\r\nsensordata+=\"    Light Intensity :  \"+String(reading);\r\nif(reading<35)\r\n{\r\n  digitalWrite(led,HIGH);\r\n}\r\nelse\r\n{\r\n  digitalWrite(led,LOW);\r\n}\r\n // delay(500);\r\n\r\n//////// PIR SENSOR /////////////////////////////////\r\n\r\nString pirstatus;\r\nif(digitalRead(pir)==HIGH)\r\n{\r\n  pirstatus=\"  detected motion\";\r\n // Serial.println(\"detected motion\");\r\n  digitalWrite(pirled,HIGH);\r\n//delay(50);\r\n}\r\nelse{\r\n  pirstatus=\"  motion not detected\";\r\n // Serial.println(\"not detected\");\r\n  //delay(50);\r\ndigitalWrite(pirled,LOW);\r\n}\r\nsensordata+=\"    PIR value : \"+pirstatus;\r\n delay(500);\r\n\r\n/////////////////////////////////////////////////\r\ndelay(500);\r\n  \r\n}"}}
{"actor":{"display_login":"devyte"}}