1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Merge remote-tracking branch 'remotes/esp8266/master'

This commit is contained in:
Markus Sattler 2016-01-25 21:06:00 +01:00
commit 4a88c94c34
7 changed files with 51 additions and 15 deletions

View File

@ -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) ##### Staging version ![](http://arduino.esp8266.com/staging/badge.svg)
Boards manager link: `http://arduino.esp8266.com/staging/package_esp8266com_index.json` 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) ### Using git version [![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)

View File

@ -329,6 +329,28 @@ bool EspClass::checkFlashConfig(bool needsEquals) {
return false; 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 wont change
strcpy_P(buff, PSTR("Exception"));
} else if (resetInfo.reason == REASON_SOFT_WDT_RST) { // software watch dog reset, GPIO status wont change
strcpy_P(buff, PSTR("Software Watchdog"));
} else if (resetInfo.reason == REASON_SOFT_RESTART) { // software restart ,system_restart , GPIO status wont 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) { String EspClass::getResetInfo(void) {
if(resetInfo.reason != 0) { if(resetInfo.reason != 0) {
char buff[200]; char buff[200];

View File

@ -131,6 +131,7 @@ class EspClass {
uint32_t getFreeSketchSpace(); uint32_t getFreeSketchSpace();
bool updateSketch(Stream& in, uint32_t size, bool restartOnFail = false, bool restartOnSuccess = true); bool updateSketch(Stream& in, uint32_t size, bool restartOnFail = false, bool restartOnSuccess = true);
String getResetReason();
String getResetInfo(); String getResetInfo();
struct rst_info * getResetInfoPtr(); struct rst_info * getResetInfoPtr();

View File

@ -6,6 +6,7 @@ title: Change Log
### Core ### Core
- Add function to know last reset resaon.
- Allow control of enabling debug and debug level from IDE - Allow control of enabling debug and debug level from IDE
- Make HardwareSerial::begin() and end() interrupt safe - Make HardwareSerial::begin() and end() interrupt safe
- Put HardwareSerial and cbuf methods called from interrupt context in RAM - Put HardwareSerial and cbuf methods called from interrupt context in RAM
@ -13,7 +14,6 @@ title: Change Log
- Add espduino board - Add espduino board
- Rework StreamString::write to use String internal buffer directly (#1289) - Rework StreamString::write to use String internal buffer directly (#1289)
- Add function to measure stack high water mark - 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*). - Fix RAM corruption caused by our hook of register_chipv6_phy(init_data*).
- Optimize PWM interrupt handler for better precision - Optimize PWM interrupt handler for better precision
- Add warning levels configurable through Preferences - Add warning levels configurable through Preferences
@ -22,6 +22,9 @@ title: Change Log
- Set CPU frequency before running setup - 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 - Add core_esp8266_features.h to be able to detect the features and libraries included in the ESP core
- Added ESPino to supported boards - 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 ### Libraries
@ -39,6 +42,13 @@ title: Change Log
- Fix link-time dependency of ESP8266WebServer on SPIFFS (#862) - Fix link-time dependency of ESP8266WebServer on SPIFFS (#862)
- Allow setting client side TLS key and certificate - Allow setting client side TLS key and certificate
- Replace chain of UDP pbufs with a single pbuf before sending (#1009) - Replace chain of UDP pbufs with a single pbuf before sending (#1009)
- 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
- Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources - Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources
### Tools ### Tools

View File

@ -83,6 +83,8 @@ APIs related to deep sleep and watchdog timer are available in the `ESP` object,
`ESP.restart()` restarts the CPU. `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.getFreeHeap()` returns the free heap size.
`ESP.getChipId()` returns the ESP8266 chip ID as a 32-bit integer. `ESP.getChipId()` returns the ESP8266 chip ID as a 32-bit integer.
@ -141,10 +143,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) - [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)` - [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). - [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. - [PubSubClient](https://github.com/Imroy/pubsubclient) - MQTT library by @Imroy.
- [RTC](https://github.com/Makuna/Rtc) - Arduino Library for Ds1307 & Ds3231 compatible with ESP8266. - [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. - [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. - [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. - [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. - [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.

View File

@ -92,10 +92,10 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
logging.info('Sending invitation to: %s', remoteAddr) logging.info('Sending invitation to: %s', remoteAddr)
sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
remote_address = (remoteAddr, int(remotePort)) remote_address = (remoteAddr, int(remotePort))
sent = sock2.sendto(message, remote_address) sent = sock2.sendto(message.encode(), remote_address)
sock2.settimeout(10) sock2.settimeout(10)
try: try:
data = sock2.recv(37) data = sock2.recv(37).decode()
except: except:
logging.error('No Answer') logging.error('No Answer')
sock2.close() sock2.close()
@ -111,10 +111,10 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
sys.stderr.write('Authenticating...') sys.stderr.write('Authenticating...')
sys.stderr.flush() sys.stderr.flush()
message = '%d %s %s\n' % (AUTH, cnonce, result) message = '%d %s %s\n' % (AUTH, cnonce, result)
sock2.sendto(message, remote_address) sock2.sendto(message.encode(), remote_address)
sock2.settimeout(10) sock2.settimeout(10)
try: try:
data = sock2.recv(32) data = sock2.recv(32).decode()
except: except:
sys.stderr.write('FAIL\n') sys.stderr.write('FAIL\n')
logging.error('No Answer to our Authentication') 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...') logging.info('Waiting for result...')
try: try:
connection.settimeout(60) connection.settimeout(60)
data = connection.recv(32) data = connection.recv(32).decode()
logging.info('Result: %s' ,data) logging.info('Result: %s' ,data)
connection.close() connection.close()
f.close() f.close()

View File

@ -23,13 +23,13 @@
#endif #endif
enum rst_reason { enum rst_reason {
REASON_DEFAULT_RST = 0, REASON_DEFAULT_RST = 0, /* normal startup by power on */
REASON_WDT_RST = 1, REASON_WDT_RST = 1, /* hardware watch dog reset */
REASON_EXCEPTION_RST = 2, REASON_EXCEPTION_RST = 2, /* exception reset, GPIO status wont change */
REASON_SOFT_WDT_RST = 3, REASON_SOFT_WDT_RST = 3, /* software watch dog reset, GPIO status wont change */
REASON_SOFT_RESTART = 4, REASON_SOFT_RESTART = 4, /* software restart ,system_restart , GPIO status wont change */
REASON_DEEP_SLEEP_AWAKE = 5, REASON_DEEP_SLEEP_AWAKE = 5, /* wake up from deep-sleep */
REASON_EXT_SYS_RST = 6 REASON_EXT_SYS_RST = 6 /* external system reset */
}; };
struct rst_info{ struct rst_info{