Skip to content

Commit 3d4e4f8

Browse files
committed
Merge branch 'master' into my_changes_on_2.1.0-rc1
2 parents ae14091 + b4ef8cf commit 3d4e4f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+420
-84
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ESP8266 Arduino core comes with libraries to communicate over WiFi using TCP and
1111
- [Using git version](#using-git-version-)
1212
- [Using stable version with PlatformIO](#using-stable-version-with-platformio)
1313
- [Documentation](#documentation)
14-
- [Issues and support](#issues-and-support)
14+
- [Issues and support](#issues-and-support)
1515
- [Contributing](#contributing)
1616
- [License and credits](#license-and-credits)
1717

@@ -25,7 +25,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
2525
- 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).
2626

2727
The best place to ask questions related to this core is ESP8266 community forum: http://www.esp8266.com/arduino.
28-
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.
28+
If you find this forum or the ESP8266 Boards Manager package useful, please consider supporting it with a donation.
2929
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
3030

3131
#### Available versions
@@ -38,11 +38,11 @@ Documentation: [http://esp8266.github.io/Arduino/versions/2.0.0/](http://esp8266
3838
##### Staging version ![](http://arduino.esp8266.com/staging/badge.svg)
3939
Boards manager link: `http://arduino.esp8266.com/staging/package_esp8266com_index.json`
4040

41-
Documentation: [http://esp8266.github.io/Arduino/versions/2.0.0-rc2/](http://esp8266.github.io/Arduino/versions/2.0.0-rc2/)
41+
Documentation: [http://esp8266.github.io/Arduino/versions/2.1.0-rc1/](http://esp8266.github.io/Arduino/versions/2.1.0-rc1/)
4242

4343
### Using git version [![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
4444

45-
- Install Arduino 1.6.5
45+
- Install Arduino 1.6.7
4646
- Go to Arduino directory
4747
- Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
4848
```bash

boards.txt

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,20 @@ generic.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
177177
generic.menu.Debug.Serial1=Serial1
178178
generic.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
179179

180-
generic.menu.DebugLevel.None=None
181-
generic.menu.DebugLevel.None.build.debug_level=
182-
generic.menu.DebugLevel.Core=Core
183-
generic.menu.DebugLevel.Core.build.debug_level=-DDEBUG_ESP_CORE
184-
generic.menu.DebugLevel.SSL=Core + SSL
185-
generic.menu.DebugLevel.SSL.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
186-
generic.menu.DebugLevel.WiFic=Core + WiFi
187-
generic.menu.DebugLevel.WiFic.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
188-
generic.menu.DebugLevel.WiFi=WiFi
189-
generic.menu.DebugLevel.WiFi.build.debug_level=-DDEBUG_ESP_WIFI
180+
generic.menu.DebugLevel.None____=None
181+
generic.menu.DebugLevel.None____.build.debug_level=
182+
generic.menu.DebugLevel.Core____=Core
183+
generic.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
184+
generic.menu.DebugLevel.SSL_____=Core + SSL
185+
generic.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
186+
generic.menu.DebugLevel.WiFic___=Core + WiFi
187+
generic.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
188+
generic.menu.DebugLevel.WiFi____=WiFi
189+
generic.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
190190
generic.menu.DebugLevel.HTTPClient=HTTPClient
191191
generic.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
192+
generic.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
193+
generic.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
192194
generic.menu.DebugLevel.HTTPUpdate=HTTPUpdate
193195
generic.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
194196
generic.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
@@ -199,12 +201,12 @@ generic.menu.DebugLevel.HTTPServer=HTTPServer
199201
generic.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
200202
generic.menu.DebugLevel.UPDATER=Updater
201203
generic.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
202-
generic.menu.DebugLevel.OTA=OTA
203-
generic.menu.DebugLevel.OTA.build.debug_level=-DDEBUG_ESP_OTA
204-
generic.menu.DebugLevel.OTA2=OTA + Updater
205-
generic.menu.DebugLevel.OTA2.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
206-
generic.menu.DebugLevel.all=All
207-
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
204+
generic.menu.DebugLevel.OTA_____=OTA
205+
generic.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
206+
generic.menu.DebugLevel.OTA2____=OTA + Updater
207+
generic.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
208+
generic.menu.DebugLevel.all_____=All
209+
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
208210

209211
# disabled because espressif's bootloader refuses to write above 4M
210212
# generic.menu.FlashSize.8M=8M (7M SPIFFS)
@@ -944,8 +946,20 @@ wifinfo.build.variant=wifinfo
944946
wifinfo.build.flash_mode=qio
945947
wifinfo.build.board=ESP8266_ESP12
946948
wifinfo.build.spiffs_pagesize=256
947-
wifinfo.build.debug_port=
948-
wifinfo.build.debug_level=
949+
wifinfo.build.debug_port=Serial1
950+
wifinfo.build.debug_level=Wifinfo
951+
952+
wifinfo.menu.Debug.Disabled=Disabled
953+
wifinfo.menu.Debug.Disabled.build.debug_port=
954+
wifinfo.menu.Debug.Serial=Serial
955+
wifinfo.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
956+
wifinfo.menu.Debug.Serial1=Serial1
957+
wifinfo.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
958+
959+
wifinfo.menu.DebugLevel.None=None
960+
wifinfo.menu.DebugLevel.None.build.debug_level=
961+
wifinfo.menu.DebugLevel.Wifinfo=Wifinfo
962+
wifinfo.menu.DebugLevel.Wifinfo.build.debug_level=-DDEBUG_ESP_WIFINFO
949963

950964
#wifinfo.menu.ESPModule.ESP07512=ESP07 (1M/512K SPIFFS)
951965
#wifinfo.menu.ESPModule.ESP07512.build.board=ESP8266_ESP07

cores/esp8266/FS.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class File : public Stream
5959
int read() override;
6060
int peek() override;
6161
void flush() override;
62-
62+
size_t readBytes(char *buffer, size_t length) override {
63+
return read((uint8_t*)buffer, length);
64+
}
6365
size_t read(uint8_t* buf, size_t size);
6466
bool seek(uint32_t pos, SeekMode mode);
6567
size_t position() const;

cores/esp8266/MD5Builder.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,46 @@ void MD5Builder::addHexString(const char * data){
2323
free(tmp);
2424
}
2525

26+
bool MD5Builder::addStream(Stream & stream, const size_t total_len) {
27+
const int buf_size = 512;
28+
int bytesleft = total_len;
29+
uint8_t * buf = (uint8_t*) malloc(buf_size);
30+
if(buf) {
31+
while((stream.available() > -1) && (bytesleft > 0)) {
32+
33+
// get available data size
34+
int sizeAvailable = stream.available();
35+
if(sizeAvailable) {
36+
int readBytes = sizeAvailable;
37+
38+
// read only the asked bytes
39+
if(readBytes > bytesleft) {
40+
readBytes = bytesleft ;
41+
}
42+
43+
// not read more the buffer can handle
44+
if(readBytes > buf_size) {
45+
readBytes = buf_size;
46+
}
47+
48+
// read data
49+
int bytesread = stream.readBytes(buf, readBytes);
50+
bytesleft -= bytesread;
51+
if(bytesread > 0) {
52+
MD5Update(&_ctx, buf, bytesread);
53+
}
54+
}
55+
// time for network streams
56+
delay(0);
57+
}
58+
// not free null ptr
59+
free(buf);
60+
return (bytesleft == 0);
61+
} else {
62+
return false;
63+
}
64+
}
65+
2666
void MD5Builder::calculate(void){
2767
MD5Final(_buf, &_ctx);
2868
}

cores/esp8266/MD5Builder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class MD5Builder {
3737
void addHexString(const char * data);
3838
void addHexString(char * data){ addHexString((const char*)data); }
3939
void addHexString(String data){ addHexString(data.c_str()); }
40+
bool addStream(Stream & stream, const size_t total_len);
4041
void calculate(void);
4142
void getBytes(uint8_t * output);
4243
void getChars(char * output);

cores/esp8266/Stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Stream: public Print {
8787

8888
float parseFloat(); // float version of parseInt
8989

90-
size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer
91-
size_t readBytes(uint8_t *buffer, size_t length) {
90+
virtual size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer
91+
virtual size_t readBytes(uint8_t *buffer, size_t length) {
9292
return readBytes((char *) buffer, length);
9393
}
9494
// terminates if length characters have been read or timeout (see setTimeout)

cores/esp8266/core_esp8266_wiring_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void ICACHE_RAM_ATTR pwm_timer_isr(){
103103
current_step = 0;
104104
stepcount = 0;
105105
if(pwm_mask == 0) return;
106-
T1L = (pwm_steps[current_step+1] * pwm_multiplier);
106+
T1L = (pwm_steps[current_step] * pwm_multiplier);
107107
TEIE |= TEIE1;
108108
if(pwm_mask & 0xFFFF) GPOS = pwm_mask & 0xFFFF;
109109
if(pwm_mask & 0x10000) GP16O = 1;

doc/Troubleshooting/debug_level.png

36.4 KB
Loading

doc/Troubleshooting/debug_port.png

33.8 KB
Loading

doc/Troubleshooting/debugging.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Debugging
3+
---
4+
5+
## Table of Contents
6+
* [Introduction](#introduction)
7+
* [Requirements](#requirements)
8+
* [Usage](#Usage)
9+
* [Informations](#Informations)
10+
* [For Developers](#for-developers)
11+
12+
## Introduction
13+
14+
Since 2.1.0-rc1 the core includes a Debugging feature that is controllable over the IDE menu.
15+
16+
The new menu points manage the real-time Debug messages.
17+
18+
### Requirements
19+
20+
For usage of the debugging a Serial connection is required (Serial or Serial1).
21+
22+
The Serial Interface need to be initialized in the ```setup()```.
23+
24+
Set the Serial baud rate as high as possible for your Hardware setup.
25+
26+
Minimum sketch to use debugging:
27+
```cpp
28+
void setup() {
29+
Serial.begin(115200);
30+
}
31+
32+
void loop() {
33+
}
34+
```
35+
36+
### Usage
37+
38+
1. Select the Serial interface for the Debugging messages:
39+
![Debug-Port](debug_port.png)
40+
41+
2. Select which type / level you want debug messages for:
42+
![Debug-Level](debug_level.png)
43+
44+
3. Check if the Serial interface is initialized in ```setup()``` (see [Requirements](#requirements))
45+
46+
4. Flash sketch
47+
48+
5. Check the Serial Output
49+
50+
51+
52+
## Informations
53+
54+
It work with every sketch that enables the Serial interface that is selected as debug port.
55+
56+
The Serial interface can still be used normal in the Sketch.
57+
58+
The debug output is additional and will not disable any interface from usage in the sketch.
59+
60+
### For Developers
61+
62+
For the debug handling uses defines.
63+
64+
The defined are set by command line.
65+
66+
#### Debug Port
67+
68+
The port has the define ```DEBUG_ESP_PORT``` possible value:
69+
- Disabled: define not existing
70+
- Serial: Serial
71+
- Serial1: Serial1
72+
73+
#### Debug Level
74+
75+
All defines for the different levels starts with ```DEBUG_ESP_```
76+
77+
a full list can be found here in the [boards.txt](https://github.com/esp8266/Arduino/blob/master/boards.txt#L180)
78+
79+
#### Example for own debug messages
80+
81+
The debug messages will be only shown when the Debug Port in the IDE menu is set.
82+
83+
```cpp
84+
#ifdef DEBUG_ESP_PORT
85+
#define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
86+
#else
87+
#define DEBUG_MSG(...)
88+
#endif
89+
90+
void setup() {
91+
Serial.begin(115200);
92+
93+
delay(3000);
94+
DEBUG_MSG("bootup...\n");
95+
}
96+
97+
void loop() {
98+
DEBUG_MSG("loop %d\n", millis());
99+
delay(1000);
100+
}
101+
```
102+

doc/filesystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ESPDuino | 4M | 1M, 3M
6161

6262
*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.
6363

64-
- Download the tool: https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.1.3/ESP8266FS-0.1.3.zip.
64+
- Download the tool: https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.2.0/ESP8266FS-0.2.0.zip.
6565
- In your Arduino sketchbook directory, create `tools` directory if it doesn't exist yet
6666
- Unpack the tool into `tools` directory (the path will look like `<home_dir>/Arduino/tools/ESP8266FS/tool/esp8266fs.jar`)
6767
- Restart Arduino IDE

doc/libraries.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ While many RC servo motors will accept the 3.3V IO data pin from a ESP8266, most
141141
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:
142142
143143
- [Adafruit_ILI9341](https://github.com/Links2004/Adafruit_ILI9341) - Port of the Adafruit ILI9341 for the ESP8266
144+
- [arduinoVNC](https://github.com/Links2004/arduinoVNC) - VNC Client for Arduino
144145
- [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets) - WebSocket Server and Client compatible with ESP8266 (RFC6455)
145146
- [aREST](https://github.com/marcoschwartz/aREST) - REST API handler library.
146147
- [Blynk](https://github.com/blynkkk/blynk-library) - easy IoT framework for Makers (check out the [Kickstarter page](http://tiny.cc/blynk-kick)).

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void HTTPClient::begin(String url, String httpsFingerprint) {
107107
int index = url.indexOf(':');
108108
//int index2;
109109
bool hasPort = false;
110-
if(index) {
110+
if(index >= 0) {
111111
protocol = url.substring(0, index);
112112
url.remove(0, (index + 3)); // remove http:// or https://
113113

0 commit comments

Comments
 (0)