From 52112500ad5bd777f76e124bf61bf005424c4682 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sun, 24 Jan 2016 22:07:22 +0300 Subject: [PATCH 1/8] Update changelog --- doc/changes.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/changes.md b/doc/changes.md index 9384fb0a5..1855121d5 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -13,7 +13,6 @@ title: Change Log - Add espduino board - Rework StreamString::write to use String internal buffer directly (#1289) - Add function to measure stack high water mark -- Update SDK to esp_iot_sdk_v1.5.0_15_12_15_p1 - Fix RAM corruption caused by our hook of register_chipv6_phy(init_data*). - Optimize PWM interrupt handler for better precision - Add warning levels configurable through Preferences @@ -22,6 +21,9 @@ title: Change Log - Set CPU frequency before running setup - Add core_esp8266_features.h to be able to detect the features and libraries included in the ESP core - Added ESPino to supported boards +- Fix pwm first step getting skipped +- Update SDK to 1.5.1_16_01_08 +- HardwareSerial: allow mapping of UART0 TX to GPIO2 ### Libraries @@ -40,6 +42,14 @@ title: Change Log - Allow setting client side TLS key and certificate - Replace chain of UDP pbufs with a single pbuf before sending (#1009) - Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources +- Unique Built-In libraries library.properties name +- Improvements for MD5Builder with Stream +- ESP8266SSDP: fixing TTL to 2 per spec +- ESP8266WebServer: a content length of zero should also be sent +- Use SoftwareSerial version 2.2 +- EEPROM: optimised _dirty flag +- ESP8266mDNS: advertise all hosted services +- Removed OneWire library ### Tools From bc82547dddd894d0e226ba43c337eada660eb2d2 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sun, 24 Jan 2016 22:44:47 +0300 Subject: [PATCH 2/8] Update staging package docs link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c12cde778..944672d59 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Documentation: [http://esp8266.github.io/Arduino/versions/2.0.0/](http://esp8266 ##### Staging version ![](http://arduino.esp8266.com/staging/badge.svg) Boards manager link: `http://arduino.esp8266.com/staging/package_esp8266com_index.json` -Documentation: [http://esp8266.github.io/Arduino/versions/2.1.0-rc1/](http://esp8266.github.io/Arduino/versions/2.1.0-rc1/) +Documentation: [http://esp8266.github.io/Arduino/versions/2.1.0-rc2/](http://esp8266.github.io/Arduino/versions/2.1.0-rc2/) ### Using git version [![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino) From 6408e43331de8384f7357d47788cb98f3e0d267a Mon Sep 17 00:00:00 2001 From: Peter Szabo Date: Sun, 24 Jan 2016 21:11:23 +0100 Subject: [PATCH 3/8] make espota compatible with python 3.5 --- tools/espota.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/espota.py b/tools/espota.py index d3b125492..f273ecee1 100755 --- a/tools/espota.py +++ b/tools/espota.py @@ -92,10 +92,10 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm logging.info('Sending invitation to: %s', remoteAddr) sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) remote_address = (remoteAddr, int(remotePort)) - sent = sock2.sendto(message, remote_address) + sent = sock2.sendto(message.encode(), remote_address) sock2.settimeout(10) try: - data = sock2.recv(37) + data = sock2.recv(37).decode() except: logging.error('No Answer') sock2.close() @@ -111,10 +111,10 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm sys.stderr.write('Authenticating...') sys.stderr.flush() message = '%d %s %s\n' % (AUTH, cnonce, result) - sock2.sendto(message, remote_address) + sock2.sendto(message.encode(), remote_address) sock2.settimeout(10) try: - data = sock2.recv(32) + data = sock2.recv(32).decode() except: sys.stderr.write('FAIL\n') logging.error('No Answer to our Authentication') @@ -173,7 +173,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm logging.info('Waiting for result...') try: connection.settimeout(60) - data = connection.recv(32) + data = connection.recv(32).decode() logging.info('Result: %s' ,data) connection.close() f.close() From 419bbb83dcdef01f98e37fc4126fd984d86ca126 Mon Sep 17 00:00:00 2001 From: Makuna Date: Sun, 24 Jan 2016 12:38:33 -0800 Subject: [PATCH 4/8] Updated library docs Updated esp8266 specific branches for NeoPixelBus Added reference to Task library --- doc/libraries.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/libraries.md b/doc/libraries.md index c9c714e2f..d2a93cd1a 100644 --- a/doc/libraries.md +++ b/doc/libraries.md @@ -147,10 +147,11 @@ Libraries that don't rely on low-level access to AVR registers should work well. - [DallasTemperature](https://github.com/milesburton/Arduino-Temperature-Control-Library.git) - [DHT-sensor-library](https://github.com/adafruit/DHT-sensor-library) - Arduino library for the DHT11/DHT22 temperature and humidity sensors. Download latest v1.1.1 library and no changes are necessary. Older versions should initialize DHT as follows: `DHT dht(DHTPIN, DHTTYPE, 15)` - [NeoPixel](https://github.com/adafruit/Adafruit_NeoPixel) - Adafruit's NeoPixel library, now with support for the ESP8266 (use version 1.0.2 or higher from Arduino's library manager). -- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus) - Arduino NeoPixel library compatible with ESP8266. Use the "NeoPixelAnimator" branch for ESP8266 to get HSL color support and more. +- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus) - Arduino NeoPixel library compatible with ESP8266. Use the "DmaDriven" or "UartDriven" branches for ESP8266. Includes HSL color support and more. - [PubSubClient](https://github.com/Imroy/pubsubclient) - MQTT library by @Imroy. - [RTC](https://github.com/Makuna/Rtc) - Arduino Library for Ds1307 & Ds3231 compatible with ESP8266. - [Souliss, Smart Home](https://github.com/souliss/souliss) - Framework for Smart Home based on Arduino, Android and openHAB. - [ST7735](https://github.com/nzmichaelh/Adafruit-ST7735-Library) - Adafruit's ST7735 library modified to be compatible with ESP8266. Just make sure to modify the pins in the examples as they are still AVR specific. +- [Task](https://github.com/Makuna/Task) - Arduino Nonpreemptive multitasking library. While similiar to the included Ticker library in the functionality provided, this library was meant for cross Arduino compatibility. - [UTFT-ESP8266](https://github.com/gnulabis/UTFT-ESP8266) - UTFT display library with support for ESP8266. Only serial interface (SPI) displays are supported for now (no 8-bit parallel mode, etc). Also includes support for the hardware SPI controller of the ESP8266. - [WiFiManager](https://github.com/tzapu/WiFiManager) - WiFi Connection manager with web captive portal. If it can't connect, it starts AP mode and a configuration portal so you can choose and enter WiFi credentials. From e455315bbf08ffa64a2b5cb20f6c451f3fcfd837 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 25 Jan 2016 00:43:03 +0100 Subject: [PATCH 5/8] Added comment on Reset reason --- tools/sdk/include/user_interface.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/sdk/include/user_interface.h b/tools/sdk/include/user_interface.h index 470556c70..81868563b 100644 --- a/tools/sdk/include/user_interface.h +++ b/tools/sdk/include/user_interface.h @@ -23,13 +23,13 @@ #endif enum rst_reason { - REASON_DEFAULT_RST = 0, - REASON_WDT_RST = 1, - REASON_EXCEPTION_RST = 2, - REASON_SOFT_WDT_RST = 3, - REASON_SOFT_RESTART = 4, - REASON_DEEP_SLEEP_AWAKE = 5, - REASON_EXT_SYS_RST = 6 + REASON_DEFAULT_RST = 0, /* normal startup by power on */ + REASON_WDT_RST = 1, /* hardware watch dog reset */ + REASON_EXCEPTION_RST = 2, /* exception reset, GPIO status won’t change */ + REASON_SOFT_WDT_RST = 3, /* software watch dog reset, GPIO status won’t change */ + REASON_SOFT_RESTART = 4, /* software restart ,system_restart , GPIO status won’t change */ + REASON_DEEP_SLEEP_AWAKE = 5, /* wake up from deep-sleep */ + REASON_EXT_SYS_RST = 6 /* external system reset */ }; struct rst_info{ From d9a51f9fa1b42002c291c2f5796ff996f25bb637 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 25 Jan 2016 00:43:57 +0100 Subject: [PATCH 6/8] Added getResetReason in human readable form --- cores/esp8266/Esp.cpp | 22 ++++++++++++++++++++++ cores/esp8266/Esp.h | 1 + 2 files changed, 23 insertions(+) diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp index a0e5c6f41..3416c9b91 100644 --- a/cores/esp8266/Esp.cpp +++ b/cores/esp8266/Esp.cpp @@ -329,6 +329,28 @@ bool EspClass::checkFlashConfig(bool needsEquals) { return false; } +String EspClass::getResetReason(void) { + char buff[32]; + if (resetInfo.reason == REASON_DEFAULT_RST) { // normal startup by power on + strcpy_P(buff, PSTR("Power on")); + } else if (resetInfo.reason == REASON_WDT_RST) { // hardware watch dog reset + strcpy_P(buff, PSTR("Hardware Watchdog")); + } else if (resetInfo.reason == REASON_EXCEPTION_RST) { // exception reset, GPIO status won’t change + strcpy_P(buff, PSTR("Exception")); + } else if (resetInfo.reason == REASON_SOFT_WDT_RST) { // software watch dog reset, GPIO status won’t change + strcpy_P(buff, PSTR("Software Watchdog")); + } else if (resetInfo.reason == REASON_SOFT_RESTART) { // software restart ,system_restart , GPIO status won’t change + strcpy_P(buff, PSTR("Software/System restart")); + } else if (resetInfo.reason == REASON_DEEP_SLEEP_AWAKE) { // wake up from deep-sleep + strcpy_P(buff, PSTR("Deep-Sleep Wake")); + } else if (resetInfo.reason == REASON_EXT_SYS_RST) { // external system reset + strcpy_P(buff, PSTR("External System")); + } else { + strcpy_P(buff, PSTR("Unknown")); + } + return String(buff); +} + String EspClass::getResetInfo(void) { if(resetInfo.reason != 0) { char buff[200]; diff --git a/cores/esp8266/Esp.h b/cores/esp8266/Esp.h index f04dd0e4d..405a94c8e 100644 --- a/cores/esp8266/Esp.h +++ b/cores/esp8266/Esp.h @@ -131,6 +131,7 @@ class EspClass { uint32_t getFreeSketchSpace(); bool updateSketch(Stream& in, uint32_t size, bool restartOnFail = false, bool restartOnSuccess = true); + String getResetReason(); String getResetInfo(); struct rst_info * getResetInfoPtr(); From c81abd2a926796627834b1aa1ee15879a1b86471 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 25 Jan 2016 00:48:46 +0100 Subject: [PATCH 7/8] Added getResetReason --- doc/changes.md | 1 + doc/libraries.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/changes.md b/doc/changes.md index 1855121d5..bed0289f1 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -6,6 +6,7 @@ title: Change Log ### Core +- Add function to know last reset resaon. - Allow control of enabling debug and debug level from IDE - Make HardwareSerial::begin() and end() interrupt safe - Put HardwareSerial and cbuf methods called from interrupt context in RAM diff --git a/doc/libraries.md b/doc/libraries.md index 210171ec6..22e913bab 100644 --- a/doc/libraries.md +++ b/doc/libraries.md @@ -83,6 +83,8 @@ APIs related to deep sleep and watchdog timer are available in the `ESP` object, `ESP.restart()` restarts the CPU. +`ESP.getResetReason()` returns String containing the last reset resaon in human readable format. + `ESP.getFreeHeap()` returns the free heap size. `ESP.getChipId()` returns the ESP8266 chip ID as a 32-bit integer. From 1b3f5e0cb563dc2794c6cf2136a31104f35f0520 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 25 Jan 2016 09:21:23 +0300 Subject: [PATCH 8/8] Remove duplicate item from changelog --- doc/changes.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/changes.md b/doc/changes.md index 1855121d5..8a920eb8f 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -41,15 +41,14 @@ title: Change Log - Fix link-time dependency of ESP8266WebServer on SPIFFS (#862) - Allow setting client side TLS key and certificate - Replace chain of UDP pbufs with a single pbuf before sending (#1009) -- Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources - Unique Built-In libraries library.properties name - Improvements for MD5Builder with Stream - ESP8266SSDP: fixing TTL to 2 per spec - ESP8266WebServer: a content length of zero should also be sent - Use SoftwareSerial version 2.2 -- EEPROM: optimised _dirty flag +- EEPROM: optimised `_dirty` flag - ESP8266mDNS: advertise all hosted services -- Removed OneWire library +- Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources ### Tools