You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the "Sparkfun ESP8266 Thing Dev" board and sporadically my sketch crashes after upgrading to version 2.1.0. Downgrading to version 2.0 fixes the issue.
Hardware: Sparkfun ESP8266 Thing Dev
Core Version:
Description
Problem description
Settings in IDE
Module: Generic ESP8266 Module or Sparkfun Thing Dev
Flash Size: 512K (64K SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: DIO
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
#include<ESP8266WiFi.h>
#include<WiFiClientSecure.h>
#include<Servo.h>
#definenoMotion0
#defineMotion1// Extra features ---------------------------------------bool Motion_enabled = true;
bool LED_enabled = true;
// Indicators -------------------------------------------------constint PIR_pin = 5; // Motion sensor pinconstint LED_pin = 4; // Flashing LED pinconstint motionIndicatorLED = 13; // Indicator LEDint lastState = noMotion;
bool firstTime = true;
Servo myservo;
int pos = 0; // variable to store the servo positionconstint ServoPin = 2; // Set to GPIO2constchar* ssid = ""; // Your Wifi Nameconstchar* password = ""; // Wifi Passwordconstchar* host = "api.instagram.com";
constint httpsPort = 443;
constchar* hashtag = ""; // Your Hashtag goes here//Your Instagram Access Token goes hereconstchar* access_token = ""; // Your instagram access token// Initilize the counters to 0int NewMCount = 0;
int LastMCount = 0;
//---------------------------------------voidRotateServo() {
if (NewMCount > LastMCount) {
if (LED_enabled) {
Serial.println("Flashing LED...");
digitalWrite(LED_pin, HIGH);
}
Serial.println("Rotating Servo from 0 degrees to 180 degrees");
for (pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'delay(15); // waits 15ms for the servo to reach the position
}
Serial.println("Rotating Servo from 180 degrees to 0 degrees");
for (pos = 180; pos >= 1; pos -= 1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'delay(15);
}
if (LED_enabled) {
digitalWrite(LED_pin, LOW);
Serial.println("Turned off the LED...");
}
}
}
//---------------------------------------voidsetup() {
Serial.setDebugOutput(true);
pinMode(LED_pin, OUTPUT);
pinMode(motionIndicatorLED, OUTPUT);
Serial.begin(115200);
Serial.println("Starting...");
Serial.println("Connecting to Wifi");
//Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
myservo.attach(ServoPin);
Serial.print("Motion feature: ");
if (Motion_enabled) {
Serial.println("Enabled");
}
else {
Serial.println("Disabled");
}
Serial.print("Flashing LED feature: ");
if (LED_enabled) {
Serial.println("Enabled");
}
else {
Serial.println("Disabled");
}
digitalWrite(LED_pin, LOW);
digitalWrite(motionIndicatorLED, LOW);
Serial.println("Setup complete.\n");
}
//---------------------------------------voidloop() {
if (Motion_enabled) {
if (!digitalRead(PIR_pin)) {
if (lastState == Motion) {
Serial.println("No motion detected...");
Serial.println("Disabling the code...");
}
lastState = noMotion;
digitalWrite(motionIndicatorLED, LOW);
return;
}
else {
if (lastState == noMotion) {
Serial.println("Motion detected...");
Serial.println("Activating the code...");
}
digitalWrite(motionIndicatorLED, HIGH);
lastState = Motion;
}
}
WiFiClientSecure client;
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(host);
if (!client.connect(host, httpsPort)) {
Serial.println("Connection failed");
return;
}
String url = "/v1/tags/";
url += hashtag;
url += "?access_token=";
url += access_token;
Serial.println("Requesting Data..");
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: ESP8266\r\n" +
"Connection: close\r\n\r\n");
// Parse http headers herewhile (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
break;
}
}
// Read data here
String line = "";
while (client.available()) {
char c = client.read();
line += c;
}
const String header = "{\"meta\":{\"code\":200},\"data\":{\"media_count\":";
line = strstr(line.c_str() , header.c_str());
// If everything is OKif (line.startsWith(header)) {
int i = header.length();
while (i <= line.length()) {
if (line.charAt(i) == ',') break;
i++;
}
LastMCount = NewMCount;
NewMCount = line.substring(header.length(), i).toInt();
Serial.print("\nNewMCount = ");
Serial.println(NewMCount);
Serial.print("LastMCount = ");
Serial.println(LastMCount);
if (firstTime) {
firstTime = false;
return;
}
RotateServo(); // Rotates the servo motor
}
else// Error
Serial.println("\nUnexpected response ...");
delay(5000);
}
Decoding 29 results
0x40107288: timer0_isr_handler at C:\Users\Del\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_timer.c line 71
0x401072a4: timer0_isr_handler at C:\Users\Del\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_timer.c line 71
0x4020e576: ieee80211_ht_updateparams at ?? line ?
0x40102dca: wDev_MacTim1Arm at ?? line ?
0x40102e2e: wDev_ProcessFiq at ?? line ?
0x40105b55: ets_timer_disarm at ?? line ?
0x40105ea2: spi_flash_read at ?? line ?
0x401075f8: pvPortZalloc at C:\Users\Del\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/heap.c line 33
0x4020abfd: pm_set_sleep_time at ?? line ?
0x4020b092: pm_get_sleep_type at ?? line ?
0x4021d9c4: sys_check_timeouts at ?? line ?
0x4020b13f: pm_get_sleep_type at ?? line ?
0x40224af9: ets_timer_handler_isr at ?? line ?
0x40224af9: ets_timer_handler_isr at ?? line ?
0x40224b3e: ets_timer_handler_isr at ?? line ?
I face similar issues. Though I have been thinking I have issues with my program. Since simple sample program like blink LED works. I have been facing the sketch crashing since I upgraded to 2.1.0.
I'm using the "Sparkfun ESP8266 Thing Dev" board and sporadically my sketch crashes after upgrading to version 2.1.0. Downgrading to version 2.0 fixes the issue.
----------------------------- Remove above -----------------------------
Basic Infos
Hardware
Hardware: Sparkfun ESP8266 Thing Dev
Core Version:
Description
Problem description
Settings in IDE
Module: Generic ESP8266 Module or Sparkfun Thing Dev
Flash Size: 512K (64K SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: DIO
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
Debug Messages
Here is the error -
The text was updated successfully, but these errors were encountered: