1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-05-15 17:35:24 +03:00

Merge branch 'master' into my_changes_on_2.1.0-rc1

This commit is contained in:
Joost Jager 2016-01-12 21:26:09 +01:00
commit 3d4e4f8cda
44 changed files with 421 additions and 85 deletions

View File

@ -25,7 +25,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
The best place to ask questions related to this core is ESP8266 community forum: http://www.esp8266.com/arduino.
If you find this ESP8266 board manager useful, please consider supporting it with a donation. The ESP8266 Community Forum and IGRR have made this wonderful port available.
If you find this forum or the ESP8266 Boards Manager package useful, please consider supporting it with a donation.
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
#### Available versions
@ -38,11 +38,11 @@ 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.0.0-rc2/](http://esp8266.github.io/Arduino/versions/2.0.0-rc2/)
Documentation: [http://esp8266.github.io/Arduino/versions/2.1.0-rc1/](http://esp8266.github.io/Arduino/versions/2.1.0-rc1/)
### Using git version [![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
- Install Arduino 1.6.5
- Install Arduino 1.6.7
- Go to Arduino directory
- Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
```bash

View File

@ -177,18 +177,20 @@ generic.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
generic.menu.Debug.Serial1=Serial1
generic.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
generic.menu.DebugLevel.None=None
generic.menu.DebugLevel.None.build.debug_level=
generic.menu.DebugLevel.Core=Core
generic.menu.DebugLevel.Core.build.debug_level=-DDEBUG_ESP_CORE
generic.menu.DebugLevel.SSL=Core + SSL
generic.menu.DebugLevel.SSL.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
generic.menu.DebugLevel.WiFic=Core + WiFi
generic.menu.DebugLevel.WiFic.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
generic.menu.DebugLevel.WiFi=WiFi
generic.menu.DebugLevel.WiFi.build.debug_level=-DDEBUG_ESP_WIFI
generic.menu.DebugLevel.None____=None
generic.menu.DebugLevel.None____.build.debug_level=
generic.menu.DebugLevel.Core____=Core
generic.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
generic.menu.DebugLevel.SSL_____=Core + SSL
generic.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
generic.menu.DebugLevel.WiFic___=Core + WiFi
generic.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
generic.menu.DebugLevel.WiFi____=WiFi
generic.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
generic.menu.DebugLevel.HTTPClient=HTTPClient
generic.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
generic.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
generic.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
generic.menu.DebugLevel.HTTPUpdate=HTTPUpdate
generic.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
generic.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
@ -199,12 +201,12 @@ generic.menu.DebugLevel.HTTPServer=HTTPServer
generic.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
generic.menu.DebugLevel.UPDATER=Updater
generic.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
generic.menu.DebugLevel.OTA=OTA
generic.menu.DebugLevel.OTA.build.debug_level=-DDEBUG_ESP_OTA
generic.menu.DebugLevel.OTA2=OTA + Updater
generic.menu.DebugLevel.OTA2.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
generic.menu.DebugLevel.all=All
generic.menu.DebugLevel.all.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA
generic.menu.DebugLevel.OTA_____=OTA
generic.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
generic.menu.DebugLevel.OTA2____=OTA + Updater
generic.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
generic.menu.DebugLevel.all_____=All
generic.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA
# disabled because espressif's bootloader refuses to write above 4M
# generic.menu.FlashSize.8M=8M (7M SPIFFS)
@ -944,8 +946,20 @@ wifinfo.build.variant=wifinfo
wifinfo.build.flash_mode=qio
wifinfo.build.board=ESP8266_ESP12
wifinfo.build.spiffs_pagesize=256
wifinfo.build.debug_port=
wifinfo.build.debug_level=
wifinfo.build.debug_port=Serial1
wifinfo.build.debug_level=Wifinfo
wifinfo.menu.Debug.Disabled=Disabled
wifinfo.menu.Debug.Disabled.build.debug_port=
wifinfo.menu.Debug.Serial=Serial
wifinfo.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
wifinfo.menu.Debug.Serial1=Serial1
wifinfo.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
wifinfo.menu.DebugLevel.None=None
wifinfo.menu.DebugLevel.None.build.debug_level=
wifinfo.menu.DebugLevel.Wifinfo=Wifinfo
wifinfo.menu.DebugLevel.Wifinfo.build.debug_level=-DDEBUG_ESP_WIFINFO
#wifinfo.menu.ESPModule.ESP07512=ESP07 (1M/512K SPIFFS)
#wifinfo.menu.ESPModule.ESP07512.build.board=ESP8266_ESP07

View File

@ -59,7 +59,9 @@ public:
int read() override;
int peek() override;
void flush() override;
size_t readBytes(char *buffer, size_t length) override {
return read((uint8_t*)buffer, length);
}
size_t read(uint8_t* buf, size_t size);
bool seek(uint32_t pos, SeekMode mode);
size_t position() const;

View File

@ -23,6 +23,46 @@ void MD5Builder::addHexString(const char * data){
free(tmp);
}
bool MD5Builder::addStream(Stream & stream, const size_t total_len) {
const int buf_size = 512;
int bytesleft = total_len;
uint8_t * buf = (uint8_t*) malloc(buf_size);
if(buf) {
while((stream.available() > -1) && (bytesleft > 0)) {
// get available data size
int sizeAvailable = stream.available();
if(sizeAvailable) {
int readBytes = sizeAvailable;
// read only the asked bytes
if(readBytes > bytesleft) {
readBytes = bytesleft ;
}
// not read more the buffer can handle
if(readBytes > buf_size) {
readBytes = buf_size;
}
// read data
int bytesread = stream.readBytes(buf, readBytes);
bytesleft -= bytesread;
if(bytesread > 0) {
MD5Update(&_ctx, buf, bytesread);
}
}
// time for network streams
delay(0);
}
// not free null ptr
free(buf);
return (bytesleft == 0);
} else {
return false;
}
}
void MD5Builder::calculate(void){
MD5Final(_buf, &_ctx);
}

View File

@ -37,6 +37,7 @@ class MD5Builder {
void addHexString(const char * data);
void addHexString(char * data){ addHexString((const char*)data); }
void addHexString(String data){ addHexString(data.c_str()); }
bool addStream(Stream & stream, const size_t total_len);
void calculate(void);
void getBytes(uint8_t * output);
void getChars(char * output);

View File

@ -87,8 +87,8 @@ class Stream: public Print {
float parseFloat(); // float version of parseInt
size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer
size_t readBytes(uint8_t *buffer, size_t length) {
virtual size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer
virtual size_t readBytes(uint8_t *buffer, size_t length) {
return readBytes((char *) buffer, length);
}
// terminates if length characters have been read or timeout (see setTimeout)

View File

@ -103,7 +103,7 @@ void ICACHE_RAM_ATTR pwm_timer_isr(){
current_step = 0;
stepcount = 0;
if(pwm_mask == 0) return;
T1L = (pwm_steps[current_step+1] * pwm_multiplier);
T1L = (pwm_steps[current_step] * pwm_multiplier);
TEIE |= TEIE1;
if(pwm_mask & 0xFFFF) GPOS = pwm_mask & 0xFFFF;
if(pwm_mask & 0x10000) GP16O = 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,102 @@
---
title: Debugging
---
## Table of Contents
* [Introduction](#introduction)
* [Requirements](#requirements)
* [Usage](#Usage)
* [Informations](#Informations)
* [For Developers](#for-developers)
## Introduction
Since 2.1.0-rc1 the core includes a Debugging feature that is controllable over the IDE menu.
The new menu points manage the real-time Debug messages.
### Requirements
For usage of the debugging a Serial connection is required (Serial or Serial1).
The Serial Interface need to be initialized in the ```setup()```.
Set the Serial baud rate as high as possible for your Hardware setup.
Minimum sketch to use debugging:
```cpp
void setup() {
Serial.begin(115200);
}
void loop() {
}
```
### Usage
1. Select the Serial interface for the Debugging messages:
![Debug-Port](debug_port.png)
2. Select which type / level you want debug messages for:
![Debug-Level](debug_level.png)
3. Check if the Serial interface is initialized in ```setup()``` (see [Requirements](#requirements))
4. Flash sketch
5. Check the Serial Output
## Informations
It work with every sketch that enables the Serial interface that is selected as debug port.
The Serial interface can still be used normal in the Sketch.
The debug output is additional and will not disable any interface from usage in the sketch.
### For Developers
For the debug handling uses defines.
The defined are set by command line.
#### Debug Port
The port has the define ```DEBUG_ESP_PORT``` possible value:
- Disabled: define not existing
- Serial: Serial
- Serial1: Serial1
#### Debug Level
All defines for the different levels starts with ```DEBUG_ESP_```
a full list can be found here in the [boards.txt](https://github.com/esp8266/Arduino/blob/master/boards.txt#L180)
#### Example for own debug messages
The debug messages will be only shown when the Debug Port in the IDE menu is set.
```cpp
#ifdef DEBUG_ESP_PORT
#define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
#else
#define DEBUG_MSG(...)
#endif
void setup() {
Serial.begin(115200);
delay(3000);
DEBUG_MSG("bootup...\n");
}
void loop() {
DEBUG_MSG("loop %d\n", millis());
delay(1000);
}
```

View File

@ -61,7 +61,7 @@ ESPDuino | 4M | 1M, 3M
*ESP8266FS* is a tool which integrates into the Arduino IDE. It adds a menu item to *Tools* menu for uploading the contents of sketch data directory into ESP8266 flash file system.
- Download the tool: https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.1.3/ESP8266FS-0.1.3.zip.
- Download the tool: https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.2.0/ESP8266FS-0.2.0.zip.
- In your Arduino sketchbook directory, create `tools` directory if it doesn't exist yet
- Unpack the tool into `tools` directory (the path will look like `<home_dir>/Arduino/tools/ESP8266FS/tool/esp8266fs.jar`)
- Restart Arduino IDE

View File

@ -141,6 +141,7 @@ While many RC servo motors will accept the 3.3V IO data pin from a ESP8266, most
Libraries that don't rely on low-level access to AVR registers should work well. Here are a few libraries that were verified to work:
- [Adafruit_ILI9341](https://github.com/Links2004/Adafruit_ILI9341) - Port of the Adafruit ILI9341 for the ESP8266
- [arduinoVNC](https://github.com/Links2004/arduinoVNC) - VNC Client for Arduino
- [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets) - WebSocket Server and Client compatible with ESP8266 (RFC6455)
- [aREST](https://github.com/marcoschwartz/aREST) - REST API handler library.
- [Blynk](https://github.com/blynkkk/blynk-library) - easy IoT framework for Makers (check out the [Kickstarter page](http://tiny.cc/blynk-kick)).

View File

@ -107,7 +107,7 @@ void HTTPClient::begin(String url, String httpsFingerprint) {
int index = url.indexOf(':');
//int index2;
bool hasPort = false;
if(index) {
if(index >= 0) {
protocol = url.substring(0, index);
url.remove(0, (index + 3)); // remove http:// or https://

View File

@ -51,7 +51,7 @@ extern "C" {
#define SSDP_METHOD_SIZE 10
#define SSDP_URI_SIZE 2
#define SSDP_BUFFER_SIZE 64
#define SSDP_MULTICAST_TTL 1
#define SSDP_MULTICAST_TTL 2
static const IPAddress SSDP_MULTICAST_ADDR(239, 255, 255, 250);
@ -89,7 +89,7 @@ static const char* _ssdp_schema_template =
"</specVersion>"
"<URLBase>http://%u.%u.%u.%u:%u/</URLBase>" // WiFi.localIP(), _port
"<device>"
"<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>"
"<deviceType>%s</deviceType>"
"<friendlyName>%s</friendlyName>"
"<presentationURL>%s</presentationURL>"
"<serialNumber>%s</serialNumber>"
@ -128,6 +128,7 @@ SSDPClass::SSDPClass() :
_server(0),
_timer(new SSDPTimer),
_port(80),
_ttl(SSDP_MULTICAST_TTL),
_respondToPort(0),
_pending(false),
_delay(0),
@ -136,6 +137,7 @@ _notify_time(0)
{
_uuid[0] = '\0';
_modelNumber[0] = '\0';
sprintf(_deviceType, "urn:schemas-upnp-org:device:Basic:1");
_friendlyName[0] = '\0';
_presentationURL[0] = '\0';
_serialNumber[0] = '\0';
@ -185,7 +187,7 @@ bool SSDPClass::begin(){
}
_server->setMulticastInterface(ifaddr);
_server->setMulticastTTL(SSDP_MULTICAST_TTL);
_server->setMulticastTTL(_ttl);
_server->onRx(std::bind(&SSDPClass::_update, this));
if (!_server->connect(multicast_addr, SSDP_PORT)) {
return false;
@ -239,6 +241,7 @@ void SSDPClass::schema(WiFiClient client){
uint32_t ip = WiFi.localIP();
client.printf(_ssdp_schema_template,
IP2STR(&ip), _port,
_deviceType,
_friendlyName,
_presentationURL,
_serialNumber,
@ -304,8 +307,8 @@ void SSDPClass::_update(){
case VALUE:
if(cr == 2){
switch(header){
case START:
break;
case START:
break;
case MAN:
#ifdef DEBUG_SSDP
DEBUG_SSDP.printf("MAN: %s\n", (char *)buffer);
@ -318,6 +321,12 @@ void SSDPClass::_update(){
DEBUG_SSDP.printf("REJECT: %s\n", (char *)buffer);
#endif
}
// if the search type matches our type, we should respond instead of ABORT
if(strcmp(buffer, _deviceType) == 0){
_pending = true;
_process_time = millis();
state = KEY;
}
break;
case MX:
_delay = random(0, atoi(buffer)) * 1000L;
@ -365,6 +374,10 @@ void SSDPClass::setHTTPPort(uint16_t port){
_port = port;
}
void SSDPClass::setDeviceType(const char *deviceType){
strlcpy(_deviceType, deviceType, sizeof(_deviceType));
}
void SSDPClass::setName(const char *name){
strlcpy(_friendlyName, name, sizeof(_friendlyName));
}
@ -377,6 +390,10 @@ void SSDPClass::setSerialNumber(const char *serialNumber){
strlcpy(_serialNumber, serialNumber, sizeof(_serialNumber));
}
void SSDPClass::setSerialNumber(const uint32_t serialNumber){
snprintf(_serialNumber, sizeof(uint32_t)*2+1, "%08X", serialNumber);
}
void SSDPClass::setModelName(const char *name){
strlcpy(_modelName, name, sizeof(_modelName));
}
@ -397,6 +414,10 @@ void SSDPClass::setManufacturerURL(const char *url){
strlcpy(_manufacturerURL, url, sizeof(_manufacturerURL));
}
void SSDPClass::setTTL(const uint8_t ttl){
_ttl = ttl;
}
void SSDPClass::_onTimerStatic(SSDPClass* self) {
self->_update();
}

View File

@ -37,6 +37,7 @@ class UdpContext;
#define SSDP_UUID_SIZE 37
#define SSDP_SCHEMA_URL_SIZE 64
#define SSDP_DEVICE_TYPE_SIZE 64
#define SSDP_FRIENDLY_NAME_SIZE 64
#define SSDP_SERIAL_NUMBER_SIZE 32
#define SSDP_PRESENTATION_URL_SIZE 128
@ -64,6 +65,8 @@ class SSDPClass{
void schema(WiFiClient client);
void setDeviceType(const String& deviceType) { setDeviceType(deviceType.c_str()); }
void setDeviceType(const char *deviceType);
void setName(const String& name) { setName(name.c_str()); }
void setName(const char *name);
void setURL(const String& url) { setURL(url.c_str()); }
@ -72,6 +75,7 @@ class SSDPClass{
void setSchemaURL(const char *url);
void setSerialNumber(const String& serialNumber) { setSerialNumber(serialNumber.c_str()); }
void setSerialNumber(const char *serialNumber);
void setSerialNumber(const uint32_t serialNumber);
void setModelName(const String& name) { setModelName(name.c_str()); }
void setModelName(const char *name);
void setModelNumber(const String& num) { setModelNumber(num.c_str()); }
@ -83,6 +87,7 @@ class SSDPClass{
void setManufacturerURL(const String& url) { setManufacturerURL(url.c_str()); }
void setManufacturerURL(const char *url);
void setHTTPPort(uint16_t port);
void setTTL(uint8_t ttl);
protected:
void _send(ssdp_method_t method);
@ -93,6 +98,7 @@ class SSDPClass{
UdpContext* _server;
SSDPTimer* _timer;
uint16_t _port;
uint8_t _ttl;
IPAddress _respondToAddr;
uint16_t _respondToPort;
@ -104,6 +110,7 @@ class SSDPClass{
char _schemaURL[SSDP_SCHEMA_URL_SIZE];
char _uuid[SSDP_UUID_SIZE];
char _deviceType[SSDP_DEVICE_TYPE_SIZE];
char _friendlyName[SSDP_FRIENDLY_NAME_SIZE];
char _serialNumber[SSDP_SERIAL_NUMBER_SIZE];
char _presentationURL[SSDP_PRESENTATION_URL_SIZE];

View File

@ -213,11 +213,10 @@ void ESP8266WebServer::_prepareHeader(String& response, int code, const char* co
content_type = "text/html";
sendHeader("Content-Type", content_type, true);
if (_contentLength != CONTENT_LENGTH_UNKNOWN && _contentLength != CONTENT_LENGTH_NOT_SET) {
sendHeader("Content-Length", String(_contentLength));
}
else if (contentLength > 0){
if (_contentLength == CONTENT_LENGTH_NOT_SET) {
sendHeader("Content-Length", String(contentLength));
} else if (_contentLength != CONTENT_LENGTH_UNKNOWN) {
sendHeader("Content-Length", String(_contentLength));
}
sendHeader("Connection", "close");
sendHeader("Access-Control-Allow-Origin", "*");

View File

@ -40,6 +40,17 @@ extern "C" {
#include "WiFiServer.h"
#include "WiFiClientSecure.h"
#ifdef DEBUG_ESP_WIFI
#ifdef DEBUG_ESP_PORT
#define DEBUG_WIFI(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
#endif
#endif
#ifndef DEBUG_WIFI
#define DEBUG_WIFI(...)
#endif
class ESP8266WiFiClass : public ESP8266WiFiGenericClass, public ESP8266WiFiSTAClass, public ESP8266WiFiScanClass, public ESP8266WiFiAPClass {
public:

View File

@ -85,19 +85,24 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
if(!WiFi.enableAP(true)) {
// enable AP failed
DEBUG_WIFI("[AP] enableAP failed!\n");
return false;
}
if(!ssid || *ssid == 0 || strlen(ssid) > 31) {
// fail SSID too long or missing!
DEBUG_WIFI("[AP] SSID too long or missing!\n");
return false;
}
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
// fail passphrase to long or short!
DEBUG_WIFI("[AP] fail passphrase to long or short!\n");
return false;
}
bool ret = true;
struct softap_config conf;
strcpy(reinterpret_cast<char*>(conf.ssid), ssid);
conf.channel = channel;
@ -116,20 +121,50 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
struct softap_config conf_current;
wifi_softap_get_config(&conf_current);
if(softap_config_equal(conf, conf_current)) {
DEBUGV("softap config unchanged");
return true;
}
if(!softap_config_equal(conf, conf_current)) {
bool ret;
ETS_UART_INTR_DISABLE();
if(WiFi._persistent) {
ret = wifi_softap_set_config(&conf);
} else {
ret = wifi_softap_set_config_current(&conf);
}
ETS_UART_INTR_ENABLE();
if(!ret) {
DEBUG_WIFI("[AP] set_config failed!\n");
return false;
}
ETS_UART_INTR_DISABLE();
if(WiFi._persistent) {
ret = wifi_softap_set_config(&conf);
} else {
ret = wifi_softap_set_config_current(&conf);
DEBUG_WIFI("[AP] softap config unchanged\n");
}
if(wifi_softap_dhcps_status() != DHCP_STARTED) {
DEBUG_WIFI("[AP] DHCP not started, starting...\n");
if(!wifi_softap_dhcps_start()) {
DEBUG_WIFI("[AP] wifi_softap_dhcps_start failed!\n");
ret = false;
}
}
// check IP config
struct ip_info ip;
if(wifi_get_ip_info(SOFTAP_IF, &ip)) {
if(ip.ip.addr == 0x00000000) {
// Invalid config
DEBUG_WIFI("[AP] IP config Invalid resetting...\n");
//192.168.244.1 , 192.168.244.1 , 255.255.255.0
ret = softAPConfig(0x01F4A8C0, 0x01F4A8C0, 0x00FFFFFF);
if(!ret) {
DEBUG_WIFI("[AP] softAPConfig failed!\n");
ret = false;
}
}
} else {
DEBUG_WIFI("[AP] wifi_get_ip_info failed!\n");
ret = false;
}
ETS_UART_INTR_ENABLE();
return ret;
}
@ -142,21 +177,76 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
* @param subnet subnet mask
*/
bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) {
DEBUG_WIFI("[APConfig] local_ip: %s gateway: %s subnet: %s\n", local_ip.toString().c_str(), gateway.toString().c_str(), subnet.toString().c_str());
if(!WiFi.enableAP(true)) {
// enable AP failed
DEBUG_WIFI("[APConfig] enableAP failed!\n");
return false;
}
bool ret = true;
struct ip_info info;
info.ip.addr = static_cast<uint32_t>(local_ip);
info.gw.addr = static_cast<uint32_t>(gateway);
info.netmask.addr = static_cast<uint32_t>(subnet);
wifi_softap_dhcps_stop();
if(wifi_set_ip_info(SOFTAP_IF, &info)) {
return wifi_softap_dhcps_start();
if(!wifi_softap_dhcps_stop()) {
DEBUG_WIFI("[APConfig] wifi_softap_dhcps_stop failed!\n");
}
return false;
if(!wifi_set_ip_info(SOFTAP_IF, &info)) {
DEBUG_WIFI("[APConfig] wifi_set_ip_info failed!\n");
ret = false;
}
struct dhcps_lease dhcp_lease;
IPAddress ip = local_ip;
ip[3] += 99;
dhcp_lease.start_ip.addr = static_cast<uint32_t>(ip);
DEBUG_WIFI("[APConfig] DHCP IP start: %s\n", ip.toString().c_str());
ip[3] += 100;
dhcp_lease.end_ip.addr = static_cast<uint32_t>(ip);
DEBUG_WIFI("[APConfig] DHCP IP end: %s\n", ip.toString().c_str());
if(!wifi_softap_set_dhcps_lease(&dhcp_lease)) {
DEBUG_WIFI("[APConfig] wifi_set_ip_info failed!\n");
ret = false;
}
// set lease time to 720min --> 12h
if(!wifi_softap_set_dhcps_lease_time(720)) {
DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_lease_time failed!\n");
ret = false;
}
uint8 mode = 1;
if(!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) {
DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_offer_option failed!\n");
ret = false;
}
if(!wifi_softap_dhcps_start()) {
DEBUG_WIFI("[APConfig] wifi_softap_dhcps_start failed!\n");
ret = false;
}
// check config
if(wifi_get_ip_info(SOFTAP_IF, &info)) {
if(info.ip.addr == 0x00000000) {
DEBUG_WIFI("[APConfig] IP config Invalid?!\n");
ret = false;
} else if(local_ip != info.ip.addr) {
ip = info.ip.addr;
DEBUG_WIFI("[APConfig] IP config not set correct?! new IP: %s\n", ip.toString().c_str());
ret = false;
}
} else {
DEBUG_WIFI("[APConfig] wifi_get_ip_info failed!\n");
ret = false;
}
return ret;
}
@ -179,6 +269,10 @@ bool ESP8266WiFiAPClass::softAPdisconnect(bool wifioff) {
}
ETS_UART_INTR_ENABLE();
if(!ret) {
DEBUG_WIFI("[APdisconnect] set_config failed!\n");
}
if(wifioff) {
ret = WiFi.enableAP(false);
}

View File

@ -103,10 +103,10 @@ void ESP8266WiFiGenericClass::removeEvent(WiFiEventCb cbEvent, WiFiEvent_t event
*/
void ESP8266WiFiGenericClass::_eventCallback(void* arg) {
System_Event_t* event = reinterpret_cast<System_Event_t*>(arg);
DEBUGV("wifi evt: %d\n", event->event);
DEBUG_WIFI("wifi evt: %d\n", event->event);
if(event->event == EVENT_STAMODE_DISCONNECTED) {
DEBUGV("STA disconnect: %d\n", event->event_info.disconnected.reason);
DEBUG_WIFI("STA disconnect: %d\n", event->event_info.disconnected.reason);
WiFiClient::stopAll();
}

View File

@ -127,7 +127,7 @@ wl_status_t ESP8266WiFiMulti::run(void) {
ip = WiFi.localIP();
mac = WiFi.BSSID();
DEBUG_WIFI_MULTI("[WIFI] Connecting done.\n");
DEBUG_WIFI_MULTI("[WIFI] SSID: %s\n", WiFi.SSID());
DEBUG_WIFI_MULTI("[WIFI] SSID: %s\n", WiFi.SSID().c_str());
DEBUG_WIFI_MULTI("[WIFI] IP: %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
DEBUG_WIFI_MULTI("[WIFI] MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
DEBUG_WIFI_MULTI("[WIFI] Channel: %d\n", WiFi.channel());

View File

@ -3,7 +3,7 @@
#include "c_types.h"
/*------------------------变量定义------------------------*/
/*------------------------<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>------------------------*/
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#ifndef IOT_SIP_MODE
@ -61,7 +61,7 @@ static const unsigned short heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + portBYTE_
//static size_t xFreeBytesRemaining = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );
/*------------------------函数声明-----------------------------------*/
/*------------------------<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------------------------------*/
//static void prvInsertBlockIntoFreeList( xBlockLink *pxBlockToInsert ) ;//ICACHE_FLASH_ATTR;
@ -69,9 +69,9 @@ static const unsigned short heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + portBYTE_
void vApplicationMallocFailedHook( void ) ;//ICACHE_FLASH_ATTR;
void *pvPortMalloc( size_t xWantedSize ) ;//ICACHE_FLASH_ATTR;
void *pvPortMalloc( size_t xWantedSize, const char* file, int line ) __attribute__((malloc, alloc_size(1)));//ICACHE_FLASH_ATTR;
void vPortFree( void *pv ) ;//ICACHE_FLASH_ATTR;
void vPortFree( void *pv, const char* file, int line ) ;//ICACHE_FLASH_ATTR;
size_t xPortGetFreeHeapSize( void ) ;//ICACHE_FLASH_ATTR;

View File

@ -1,4 +1,4 @@
name=Ethernet
name=Ethernet(esp8266)
version=1.0.4
author=Arduino
maintainer=Arduino <info@arduino.cc>

View File

@ -0,0 +1,10 @@
name=OneWire(esp8266)
version=2.2
author=Jim Studt, Tom Pollard, Robin James, Glenn Trewitt, Jason Dangel, Guillermo Lovato, Paul Stoffregen, Scott Roberts, Bertrik Sikken, Mark Tillotson, Ken Butcher, Roger Clark, Love Nystrom
maintainer=
sentence=Access 1-wire temperature sensors, memory and other chips. ESP8266 compatible version.
paragraph=
category=Communication
url=
architectures=esp8266

View File

@ -1,4 +1,4 @@
name=SD
name=SD(esp8266)
version=1.0.5
author=Arduino, SparkFun
maintainer=Arduino <info@arduino.cc>

View File

@ -1,4 +1,4 @@
name=Servo
name=Servo(esp8266)
version=1.0.2
author=Michael C. Miller
maintainer=GitHub/esp8266/arduino

View File

@ -39,13 +39,15 @@ cat << EOF > exclude.txt
package
EOF
# Also include all files which are ignored by git
git ls-files --other --ignored --exclude-standard --directory >> exclude.txt
git ls-files --other --directory >> exclude.txt
# Now copy files to $outdir
rsync -a --exclude-from 'exclude.txt' $srcdir/ $outdir/
rm exclude.txt
# Get additional libraries (TODO: add them as git submodule or subtree?)
wget -q -O SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/2aebc169192fc2031319ad9ad066d5f7aef17caf.zip
# SoftwareSerial version 2.2
wget -q -O SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/306b3f640296f3105a79bcc11d0fd185c95be1c9.zip
unzip -q SoftwareSerial.zip
rm -rf SoftwareSerial.zip
mv espsoftwareserial-* SoftwareSerial

View File

@ -24,8 +24,9 @@ set -e
# some variable definitions
tmp_path=$1
arduinoESP_src="$tmp_path/arduino"
version="$(git --work-tree=$arduinoESP_src describe --tags --always)"
doc_src_path=$2
arduinoESP_src=$(cd $PWD/..; pwd)
version="$(git --work-tree=$arduinoESP_src --git-dir=$arduinoESP_src/.git describe --tags --always)"
release_date=$(date "+%b_%d,_%Y") # format for badge link
build_date=$(date "+%b %d, %Y")
destination_path="$tmp_path/doc"
@ -62,7 +63,8 @@ mkdir -p $destination_path/$version
cp -R $arduinoESP_src/doc/* $destination_path/src
# download doc template
git clone $doc_template_url $destination_path/build
rsync -av $doc_src_path/ $destination_path/build/
# git clone $doc_template_url $destination_path/build
# create versions.html file
@ -113,4 +115,3 @@ popd
# grab badge
wget -q -O $destination_path/$version/badge.svg "https://img.shields.io/badge/updated-$release_date-blue.svg"

View File

@ -1,3 +1,34 @@
esp_iot_sdk_v1.5.1_16_01_08 Release Note
----------------------------------------
Resolved Issues (Bugs listed below apply to Bug Bounty Program):
1.espconn_abort may cause system crash.
Optimization:
1.Optimize the data receiving process under TCP connection.
2.Optimize low MAC and increase stability of the software.
3.Optimize watchdog feeding process.
4.Optimize softAP working mode so that some stations can be easily connected.
5.Optimize station working mode, enabling connection even when the SSID of the AP has changed.
6.Optimize station working mode, and increase routers compatibility during the connection process.
7.Optimize SSL shakehand.
8.Optimize espconn internal timer.
9.Optimize UDP transmission.
10.Improve the flash writing process.
11.Strenthen WPA2 security protocols.
12.Improve data sending ability.
13.Straighten the control capability of GPIO16 under light sleep mode.
14.boot.bin is upgrade to version 1.5, resolving boot failure when firmware is upgraded over the air (OTA).
AT release note
1.Optimize the process of establishing TCP server via AT command.
2.Optimize UART-WiFi transparent transmission mode via AT command.
Please be noted that with the release of NONOS SDK Version 1.5.0 (ESP8266_NONOS_SDK_V1.5.0), the space that AT commands occupies has increased to more than 4Mbit. Therefore, flash with 512Kbit capacity is no longer supported. Please choose flash with at least 8Mbit capacity.
Please be noted that firmware upgrade over-the-air process is changed a bit. We will upgrade the latest firmware to Espressif Cloud server only after it has been tested and the overall performance is guaranteed. Users may not be able to download firmware encapsulated in ESP8266_NONOS_SDK_V1.5.0 and other more advanced versions.
esp_iot_sdk_v1.5.0_15_12_15_p1 Release Note
----------------------------------------
Here is a patch based on ESP8266_NONOS_SDK_V1.5.0 solved a problem that calling espconn_abort may cause unexpected reset.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
1.5.0_15_12_15_p1
1.5.1_16_01_08