{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/2083","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/2083/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/2083/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/2083/events","html_url":"https://github.com/esp8266/Arduino/issues/2083","id":158187612,"number":2083,"title":"ESP8266 servo causes crash after updating from core 2.0.0 to 2.2.0 ","user":{"login":"p4yl04d3r","id":19712223,"avatar_url":"https://avatars.githubusercontent.com/u/19712223?v=3","gravatar_id":"","url":"https://api.github.com/users/p4yl04d3r","html_url":"https://github.com/p4yl04d3r","followers_url":"https://api.github.com/users/p4yl04d3r/followers","following_url":"https://api.github.com/users/p4yl04d3r/following{/other_user}","gists_url":"https://api.github.com/users/p4yl04d3r/gists{/gist_id}","starred_url":"https://api.github.com/users/p4yl04d3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4yl04d3r/subscriptions","organizations_url":"https://api.github.com/users/p4yl04d3r/orgs","repos_url":"https://api.github.com/users/p4yl04d3r/repos","events_url":"https://api.github.com/users/p4yl04d3r/events{/privacy}","received_events_url":"https://api.github.com/users/p4yl04d3r/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/esp8266/Arduino/labels/component:%20core","name":"component: core","color":"fad8c7"},{"url":"https://api.github.com/repos/esp8266/Arduino/labels/staged-for-release","name":"staged-for-release","color":"5319e7"},{"url":"https://api.github.com/repos/esp8266/Arduino/labels/type:%20bug","name":"type: bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/esp8266/Arduino/milestones/6","html_url":"https://github.com/esp8266/Arduino/milestones/2.3.0","labels_url":"https://api.github.com/repos/esp8266/Arduino/milestones/6/labels","id":1712958,"number":6,"title":"2.3.0","description":"","creator":{"login":"igrr","id":4349050,"avatar_url":"https://avatars.githubusercontent.com/u/4349050?v=3","gravatar_id":"","url":"https://api.github.com/users/igrr","html_url":"https://github.com/igrr","followers_url":"https://api.github.com/users/igrr/followers","following_url":"https://api.github.com/users/igrr/following{/other_user}","gists_url":"https://api.github.com/users/igrr/gists{/gist_id}","starred_url":"https://api.github.com/users/igrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igrr/subscriptions","organizations_url":"https://api.github.com/users/igrr/orgs","repos_url":"https://api.github.com/users/igrr/repos","events_url":"https://api.github.com/users/igrr/events{/privacy}","received_events_url":"https://api.github.com/users/igrr/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":4,"state":"open","created_at":"2016-04-18T08:03:51Z","updated_at":"2016-06-03T06:54:29Z","due_on":"2016-04-29T21:00:00Z","closed_at":null},"comments":15,"created_at":"2016-06-02T16:45:27Z","updated_at":"2016-06-03T22:21:40Z","closed_at":null,"body":"### Basic Infos\r\n\r\n#### Hardware\r\nHardware:\t\tESP-12F\r\nCore Version:      \t2.2.0\r\n\r\n### Description\r\n\r\nServo movement to specific positions causes esp8266 to crash.  I am using Arduino IDE 1.6.9.\r\nI am using the same function to call the servo and only passing in a different value. But only when I pass in a lower/mid value does the controller crash.  I have confirmed the following values (5,30,40,45) trigger a crash.\r\nOther values (0 90,100,175,180) are OK.\r\nHaving a servo connected is optional to trigger the crash.\r\n\r\n### Settings in IDE\r\n\r\nModule:  \t\t\tGeneric ESP8266 Module\r\nFlash Size: \t\t4MB \r\nCPU Frequency:      80Mhz\r\nFlash Mode:\t\tdio\r\nFlash Frequency:\t40Mhz\r\nUpload Using:\t\tSERIAL\r\nReset Method:\t\tck\r\n```c++\r\n#include <Servo.h>  \r\n#include <ESP8266WiFi.h>\r\n#include <PubSubClient.h>\r\n\r\n/* Setup number of servos */\r\n#define SERVO1\r\n//#define SERVO2\r\n//#define SERVO3\r\n/* ENABLE DEBUG */\r\nint debug = 1;            //Set this to 1 for serial debug output\r\n/* Configure GPIO servo pins*/\r\nconst int servoPin1=13;     //Pin for servo1\r\n//const int servoPin2=12;     //Pin for servo2\r\n//const int servoPin3=14;     //Pin for servo3\r\nconst int button_pin=4 ;  //Button or relay driven by x10 switch for manual control\r\n/* Blind tilt settings */\r\nconst int OPEN=90;      //Global settings for open\r\nconst int HALF=30;       //Global settings for half way opened\r\nconst int CLOSE=0;       //Global settings for close in down position\r\nconst int CLOSEUP=180;   //Global setting to close in the up position\r\nServo myservo;     // create servo object to control a servo \r\nint button_value;  //high or low button values\r\nint next=1;\r\n\r\nvoid moveblinds(int value) {\r\n#ifdef SERVO1\r\n        delay(60);\r\n        debug and Serial.print(\"Moving blind1 to: \");\r\n        debug and Serial.println(value);\r\n        myservo.attach(servoPin1);\r\n        myservo.write(value);\r\n        delay(600); \r\n        myservo.detach();\r\n#endif\r\n#ifdef SERVO2\r\n        delay(60);\r\n        debug and Serial.print(\"Moving blind2 to: \");\r\n        debug and Serial.println(value);\r\n        myservo.attach(servoPin2);\r\n        myservo.write(value);\r\n        delay(600); \r\n        myservo.detach();\r\n#endif\r\n#ifdef SERVO3\r\n        delay(60);\r\n        debug and Serial.print(\"Moving blind3 to: \");\r\n        debug and Serial.println(value);\r\n        myservo.attach(servoPin3);\r\n        myservo.write(value);\r\n        delay(600); \r\n        myservo.detach();\r\n#endif     \r\n}\r\n\r\nvoid loop(void) { \r\n    if (!client.connected()) {\r\n       delay(10);\r\n       reconnect();\r\n    }\r\n    client.loop();\r\n    button_value = digitalRead(button_pin); \r\n    if(button_value==LOW){  // button press\r\n      debug and Serial.println(\"button pressed: \"); \r\n      if (next > 4) {\r\n        next=1;\r\n      }\r\n      if (next == 1) { //First pull is OPEN\r\n        moveblinds(OPEN);     //Move to next position\r\n      } \r\n      if (next == 2) {                //Second pull is HALF\r\n        moveblinds(HALF);\r\n      } \r\n      if (next == 3) {                //Third pull is CLOSE \r\n        moveblinds(CLOSE);                    \r\n      } \r\n      if (next == 4) {                 //Forth pull is CLOSEUP \r\n        moveblinds(CLOSEUP);                  \r\n      }\r\n      next++;\r\n   }\r\n   delay(60);\r\n}\r\n```\r\n### Debug Messages\r\n```\r\nConnecting to <ssid>\r\n......\r\nWiFi connected\r\nIP address: xx.xx.xx.xx\r\nMoving blind1 to: 180 <-- never on this move\r\nbutton pressed: \r\nMoving blind1 to: 90  <-- never on this move\r\nbutton pressed: \r\nMoving blind1 to: 30  <-- I crash here almost every time.\r\n\r\nException (0):\r\nepc1=0x40201134 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000\r\n\r\nctx: sys \r\nsp: 3ffffc70 end: 3fffffb0 offset: 01a0\r\n\r\n>>>stack>>>\r\n3ffffe10:  4021250c 3ffed750 3ffffed0 00000016  \r\n3ffffe20:  3fffc200 40106c24 00000020 40106c40  \r\n3ffffe30:  402102b5 3ffffed0 3fffc248 4000050c  \r\n3ffffe40:  4000437d 00000030 00000016 ffffffff  \r\n3ffffe50:  60000200 00000008 00000000 80000000  \r\n3ffffe60:  20000000 3fff0da8 80000000 203fc060  \r\n3ffffe70:  80000000 3fffc6fc 3ffeed1c 3fff0dac  \r\n3ffffe80:  00000294 003fc060 3ffecf40 00000030  \r\n3ffffe90:  3ffedd78 40201154 00000000 bfffffff  \r\n3ffffea0:  ffffffff 3fffc6fc 3ffedd78 3ffeed1c  \r\n3ffffeb0:  3ffedda0 03d3a63d 60000600 00000030  \r\n3ffffec0:  40000f58 00000000 00000020 00000000  \r\n3ffffed0:  00000013 40201154 3ffedd78 00000000  \r\n3ffffee0:  ffffffff 3ffecef4 3ffedd78 3fffdab0  \r\n3ffffef0:  00000000 3fffdcb0 3ffeddb0 00000030  \r\n3fffff00:  3fff04a4 3ffee9d8 00002238 40105cb0  \r\n3fffff10:  401051fc 004f9272 3ffe89d4 00000000  \r\n3fffff20:  3ffedda0 3ffe89d4 0000000f 4010707c  \r\n3fffff30:  00000000 400042db 402053c7 3ffecf40  \r\n3fffff40:  40004b31 3fff0d4c 000002f4 003fc000  \r\n3fffff50:  401054a2 00000000 3ffece40 401070c0  \r\n3fffff60:  40208621 3ffece40 00000000 3fffdc00  \r\n3fffff70:  3fff0d4c 00001000 40208ab6 00000002  \r\n3fffff80:  4021a282 3fffdab0 40209cb7 3fffdab0  \r\n3fffff90:  00000000 3fffdab0 3ffeee08 40203ceb  \r\n3fffffa0:  40000f49 40000f49 3fffdab0 40000f49  \r\n<<<stack<<<\r\n\r\n\r\nDecoding 25 results\r\n0x4021250c: cnx_update_bss_more at ?? line ?\r\n0x40106c24: timer0_isr_handler at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/core_esp8266_timer.c line 71\r\n0x40106c40: timer0_isr_handler at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/core_esp8266_timer.c line 71\r\n0x402102b5: scan_parse_beacon at ?? line ?\r\n0x40201154: delay_end at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/core_esp8266_wiring.c line 38\r\n0x40201154: delay_end at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/core_esp8266_wiring.c line 38\r\n0x40105cb0: _UserExceptionVector_1 at ?? line ?\r\n0x401051fc: ets_timer_arm_new at ?? line ?\r\n0x4010707c: pvPortMalloc at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/heap.c line 13\r\n0x402053c7: pp_enable_noise_timer at ?? line ?\r\n0x401054a2: spi_flash_read at ?? line ?\r\n0x401070c0: pvPortZalloc at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/heap.c line 33\r\n0x40208621: pm_set_sleep_time at ?? line ?\r\n0x40208ab6: pm_get_sleep_type at ?? line ?\r\n0x4021a282: ets_timer_handler_isr at ?? line ?\r\n0x40209cb7: pm_post at ?? line ?\r\n0x40203ceb: loop_task at C:\\Users\\chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.2.0\\cores\\esp8266/core_esp8266_main.cpp line 43\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/223708666","html_url":"https://github.com/esp8266/Arduino/issues/2083#issuecomment-223708666","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/2083","id":223708666,"user":{"login":"p4yl04d3r","id":19712223,"avatar_url":"https://avatars.githubusercontent.com/u/19712223?v=3","gravatar_id":"","url":"https://api.github.com/users/p4yl04d3r","html_url":"https://github.com/p4yl04d3r","followers_url":"https://api.github.com/users/p4yl04d3r/followers","following_url":"https://api.github.com/users/p4yl04d3r/following{/other_user}","gists_url":"https://api.github.com/users/p4yl04d3r/gists{/gist_id}","starred_url":"https://api.github.com/users/p4yl04d3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4yl04d3r/subscriptions","organizations_url":"https://api.github.com/users/p4yl04d3r/orgs","repos_url":"https://api.github.com/users/p4yl04d3r/repos","events_url":"https://api.github.com/users/p4yl04d3r/events{/privacy}","received_events_url":"https://api.github.com/users/p4yl04d3r/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T22:21:40Z","updated_at":"2016-06-03T22:21:40Z","body":"I thought the same thing until I tried it with the minimal logic sketch above. Basically I removing all the MQTT stuff and was able to trigger.  Could it be that I am not defining the ESP-12 correctly to the IDE?  "}}
{"actor":{"display_login":"p4yl04d3r"}}