{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/4345","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/4345/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/4345/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/4345/events","html_url":"https://github.com/esp8266/Arduino/issues/4345","id":296142117,"number":4345,"title":"Issues #353/#3100 Continue. WiFi only works once after erasing flash","user":{"login":"mlbranchus","id":17607786,"avatar_url":"https://avatars1.githubusercontent.com/u/17607786?v=4","gravatar_id":"","url":"https://api.github.com/users/mlbranchus","html_url":"https://github.com/mlbranchus","followers_url":"https://api.github.com/users/mlbranchus/followers","following_url":"https://api.github.com/users/mlbranchus/following{/other_user}","gists_url":"https://api.github.com/users/mlbranchus/gists{/gist_id}","starred_url":"https://api.github.com/users/mlbranchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlbranchus/subscriptions","organizations_url":"https://api.github.com/users/mlbranchus/orgs","repos_url":"https://api.github.com/users/mlbranchus/repos","events_url":"https://api.github.com/users/mlbranchus/events{/privacy}","received_events_url":"https://api.github.com/users/mlbranchus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":39,"created_at":"2018-02-10T23:00:22Z","updated_at":"2018-02-13T18:24:50Z","closed_at":null,"author_association":"NONE","body":"Please fill the info fields, it helps to get you faster support ;)\r\n\r\nif you have a stack dump decode it:\r\nhttps://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.rst\r\n\r\nfor better debug messages:\r\nhttps://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst\r\n\r\n----------------------------- Remove above -----------------------------\r\n\r\n### Basic Infos\r\n\r\n#### Hardware \r\nHardware:\t\t\t?ESP-12?\r\nCore Version:      \t?2.1.0-rc2?\r\n\r\n### Description\r\n\r\nProblem description WiFi only works once after erasing flash\r\n\r\n### Settings in IDE\r\n\r\nModule:  \t\tHuzzah ESP8266 Module\r\nFlash Size: \t\t?4MB/1MB?\r\nCPU Frequency:\t\t80Mhz\r\nFlash Mode:\t\t\t?qio?\r\nFlash Frequency:\t?40Mhz?\r\nUpload Using:\t\t/ SERIAL?\r\nReset Method:\t\t?ck \r\n\r\n\r\n### Sketch\r\n\r\n```cpp\r\n\r\n#include <Arduino.h>\r\n\r\n// Adafruit IO Temperature & Humidity Example\r\n// Tutorial Link: https://learn.adafruit.com/adafruit-io-basics-temperature-and-humidity\r\n//\r\n// Adafruit invests time and resources providing this open source code.\r\n// Please support Adafruit and open source hardware by purchasing\r\n// products from Adafruit!\r\n//\r\n// Written by Todd Treece for Adafruit Industries\r\n// Copyright (c) 2016-2017 Adafruit Industries\r\n// Licensed under the MIT license.\r\n//\r\n// All text above must be included in any redistribution.\r\n\r\n/************************** Configuration ***********************************/\r\n\r\n// edit the config.h tab and enter your Adafruit IO credentials\r\n// and any additional configuration needed for WiFi, cellular,\r\n// or ethernet clients.\r\n#include \"config.h\"\r\n\r\n/************************ Example Starts Here *******************************/\r\n#include <Adafruit_Sensor.h>\r\n#include <DHT.h>\r\n#include <DHT_U.h>\r\n#include <Adafruit_SSD1306.h>\r\n\r\n// oled display\r\nAdafruit_SSD1306 oled = Adafruit_SSD1306();\r\n\r\n// pin connected to DH22 data line\r\n#define DATA_PIN 2\r\n\r\n// create DHT22 instance\r\nDHT_Unified dht(DATA_PIN, DHT22);\r\n\r\n// set up the 'temperature' and 'humidity' feeds\r\nAdafruitIO_Feed *temperature = io.feed(\"temperature\");\r\nAdafruitIO_Feed *humidity = io.feed(\"humidity\");\r\n\r\nvoid setup() {\r\n  oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)\r\n  oled.display();\r\n\r\n  // start the serial connection\r\n  Serial.begin(115200);\r\n\r\n  // wait for serial monitor to open\r\n  while(! Serial);\r\n\r\n  // initialize dht22\r\n  dht.begin();\r\n\r\n  // connect to io.adafruit.com\r\n  Serial.print(\"Connecting to Adafruit IO\");\r\n  io.connect();\r\n\r\n  // wait for a connection\r\n  while(io.status() < AIO_CONNECTED) {\r\n    Serial.print(\".\");\r\n    delay(500);\r\n  }\r\n\r\n  // we are connected\r\n  Serial.println();\r\n  Serial.println(io.statusText());\r\n\r\n  // text display tests\r\n  oled.setTextSize(1);\r\n  oled.setTextColor(WHITE);\r\n}\r\n\r\nvoid loop() {\r\n\r\n  // io.run(); is required for all sketches.\r\n  // it should always be present at the top of your loop\r\n  // function. it keeps the client connected to\r\n  // io.adafruit.com, and processes any incoming data.\r\n  io.run();\r\n\r\n  sensors_event_t event;\r\n  dht.temperature().getEvent(&event);\r\n\r\n  float celsius = event.temperature;\r\n  float fahrenheit = (celsius * 1.8) + 32;\r\n\r\n  Serial.print(\"celsius: \");\r\n  Serial.print(celsius);\r\n  Serial.println(\"C\");\r\n\r\n  Serial.print(\"fahrenheit: \");\r\n  Serial.print(fahrenheit);\r\n  Serial.println(\"F\");\r\n\r\n  // save fahrenheit (or celsius) to Adafruit IO\r\n  temperature->save(fahrenheit);\r\n\r\n  dht.humidity().getEvent(&event);\r\n   \r\n  Serial.print(\"humidity: \");\r\n  Serial.print(event.relative_humidity);\r\n  Serial.println(\"%\");\r\n\r\n  // save humidity to Adafruit IO\r\n  humidity->save(event.relative_humidity);\r\n\r\n  // print it to the OLED\r\n  oled.clearDisplay();\r\n  oled.setCursor(0,0);\r\n  oled.print(\"SSID: \"); oled.println(WIFI_SSID);\r\n  oled.print(\"IP: \"); oled.println(WiFi.localIP());\r\n  oled.print(\"Temp: \"); oled.print(fahrenheit,0); oled.print(\" *F \");\r\n  oled.print(\"Hum: \"); oled.print(event.relative_humidity,0); oled.println(\" %\");\r\n  oled.print(\"IO Status: \");\r\n  aio_status_t aio_status = io.status();\r\n  Serial.print(\"Status: \"); Serial.println(aio_status);\r\n  switch (aio_status) {\r\n     case AIO_IDLE:  oled.println(\"IDLE\"); break;\r\n     case AIO_DISCONNECTED:\r\n     case AIO_NET_DISCONNECTED:  oled.println(\"DISCONNECT\"); break;\r\n     case AIO_NET_CONNECTED:\r\n     case AIO_CONNECTED_INSECURE:\r\n     case AIO_CONNECTED: oled.println(\"CONNECTED\"); break;\r\n  }\r\n  oled.display();\r\n\r\n  // wait 5 seconds (5000 milliseconds == 5 seconds)\r\n  delay(2000);\r\n}\r\nvoid setup() {\r\n\r\n}\r\n\r\nvoid loop() {\r\n\r\n}\r\n```\r\n\r\n### Debug Messages\r\n\r\n```\r\nmessages here\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/365357995","html_url":"https://github.com/esp8266/Arduino/issues/4345#issuecomment-365357995","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/4345","id":365357995,"user":{"login":"beicnet","id":22061547,"avatar_url":"https://avatars3.githubusercontent.com/u/22061547?v=4","gravatar_id":"","url":"https://api.github.com/users/beicnet","html_url":"https://github.com/beicnet","followers_url":"https://api.github.com/users/beicnet/followers","following_url":"https://api.github.com/users/beicnet/following{/other_user}","gists_url":"https://api.github.com/users/beicnet/gists{/gist_id}","starred_url":"https://api.github.com/users/beicnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beicnet/subscriptions","organizations_url":"https://api.github.com/users/beicnet/orgs","repos_url":"https://api.github.com/users/beicnet/repos","events_url":"https://api.github.com/users/beicnet/events{/privacy}","received_events_url":"https://api.github.com/users/beicnet/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T18:24:50Z","updated_at":"2018-02-13T18:24:50Z","author_association":"NONE","body":"Just drag and drop your images here!"}}
{"actor":{"display_login":"beicnet"}}