Skip to content

Update #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip

# Quick links

- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.0/)
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.1/)
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))

Expand All @@ -28,15 +28,15 @@ ESP8266 Arduino core comes with libraries to communicate over WiFi using TCP and

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).

- Install the current upstream Arduino IDE at the 1.8.7 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software).
- Install the current upstream Arduino IDE at the 1.8.9 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software).
- Start Arduino and open the Preferences window.
- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
- 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).

#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`

Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.0/](https://arduino-esp8266.readthedocs.io/en/2.7.0/)
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.1/](https://arduino-esp8266.readthedocs.io/en/2.7.1/)

### Using git version
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
Expand Down Expand Up @@ -73,7 +73,7 @@ Documentation for latest development version: https://arduino-esp8266.readthedoc

### Issues and support ###

[ESP8266 Community Forum](https://www.esp8266.com/u/arduinoanswers) is a well-established community for questions and answers about Arduino for ESP8266. If you need help, have a "How do I..." type question, have a problem with a 3rd party library not hosted in this repo, or just want to discuss how to approach a problem, please ask there.
[ESP8266 Community Forum](https://www.esp8266.com/u/arduinoanswers) is a well-established community for questions and answers about Arduino for ESP8266. Stackoverflow is also an alternative. If you need help, have a "How do I..." type question, have a problem with a 3rd party library not hosted in this repo, or just want to discuss how to approach a problem, please ask there.

If you find the forum useful, please consider supporting it with a donation. <br />
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
Expand All @@ -96,7 +96,7 @@ For minor fixes of code and documentation, please go ahead and submit a pull req

Check out the list of issues that are easy to fix — [easy issues pending](https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+label%3A%22level%3A+easy%22). Working on them is a great way to move the project forward.

Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first.
Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first. PRs with such changes require testing and approval.

Feature branches with lots of small commits (especially titled "oops", "fix typo", "forgot to add file", etc.) should be squashed before opening a pull request. At the same time, please refrain from putting multiple unrelated changes into a single pull request.

Expand Down
4 changes: 2 additions & 2 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4960,15 +4960,15 @@ espinotee.menu.baud.3000000.upload.speed=3000000
wifinfo.name=WifInfo
wifinfo.build.board=WIFINFO
wifinfo.build.variant=wifinfo
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS)
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS)
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
Expand Down
2 changes: 1 addition & 1 deletion bootloaders/eboot/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int copy_raw(const uint32_t src_addr,
return 0;
}

#define XMC_SUPPORT
//#define XMC_SUPPORT
#ifdef XMC_SUPPORT
// Define a few SPI0 registers we need access to
#define ESP8266_REG(addr) *((volatile uint32_t *)(0x60000000+(addr)))
Expand Down
Binary file modified bootloaders/eboot/eboot.elf
Binary file not shown.
3 changes: 1 addition & 2 deletions cores/esp8266/Crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
THE SOFTWARE.
*/

#include <bearssl/bearssl.h>
#include "Crypto.h"
#include <TypeConversion.h>

#include <bearssl/bearssl.h>
#include <assert.h>

namespace TypeCast = experimental::TypeConversion;
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/Crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define __ESP8266_ARDUINO_CRYPTO_H__

#include <Arduino.h>
#include <bearssl/bearssl_kdf.h>

namespace experimental
{
Expand Down Expand Up @@ -745,8 +746,7 @@ struct HKDF

private:

// Use an opaque type to avoid #include <bearssl/bearssl.h> which drags the lib declarations into userland. The global scope prefix is required for compilation to succeed, it seems.
::br_hkdf_context hkdfContext;
br_hkdf_context hkdfContext;
};


Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ using fs::SPIFFSConfig;
#endif //FS_NO_GLOBALS

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
extern fs::FS SPIFFS;
extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
#endif

#endif //FS_H
2 changes: 1 addition & 1 deletion cores/esp8266/TZ.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

// autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
// by script <esp8266 arduino core>/tools/TZupdate.sh
// Fri May 1 20:39:05 UTC 2020
// Thu May 7 19:02:21 UTC 2020
//
// This database is autogenerated from IANA timezone database
// https://www.iana.org/time-zones
Expand Down
6 changes: 4 additions & 2 deletions cores/esp8266/spiffs_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
return flash_hal_read(addr, size, dst);
}



#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

namespace spiffs_impl {

Expand Down Expand Up @@ -149,6 +149,8 @@ extern "C" void spiffs_request_end(void)
SPIFFS.end();
}

#pragma GCC diagnostic pop

#endif // ARDUINO
#endif // !CORE_MOCK

Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/spiffs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class SPIFFSImpl : public FSImpl
return false;
}
_cfg = *static_cast<const SPIFFSConfig *>(&cfg);
return true;
return true;
}

bool begin() override
Expand Down
3 changes: 2 additions & 1 deletion cores/esp8266/umm_malloc/umm_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ void ICACHE_FLASH_ATTR print_stats(int force);


int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#define UMM_INFO_PRINTF(fmt, ...) umm_info_safe_printf_P(PSTR(fmt), ##__VA_ARGS__)
#define UMM_INFO_PRINTF(fmt, ...) umm_info_safe_printf_P(PSTR4(fmt), ##__VA_ARGS__)
// use PSTR4() instead of PSTR() to ensure 4-bytes alignment in Flash, whatever the default alignment of PSTR_ALIGN


#endif
2 changes: 1 addition & 1 deletion doc/boards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Parameters in Arduino IDE:
~~~~~~~~~~~~~~~~~~~~~~~~~~

- Card: "WEMOS D1 Mini Lite"
- Flash Size: "1M (512K SPIFFS)"
- Flash Size: "1M (512K FS)"
- CPU Frequency: "80 Mhz"

Power:
Expand Down
4 changes: 2 additions & 2 deletions doc/esp8266wifi/bearssl-client-secure-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ The web browser you're using to read this document keeps a list of 100s of certi

In many cases your application will know the specific CA it needs to validate web or MQTT servers against (often just a single, self-signing CA private to your institution). Simply load your private CA in a `BearSSL::X509List` and use that as your trust anchor.

However, there are cases where you will not know beforehand which CA you will need (i.e. a user enters a website through a keypad), and you need to keep the list of CAs just like your web browser. In those cases, you need to generate a certificate bundle on the PC while compiling your application, upload the `certs.ar` bundle to SPIFFS or SD when uploading your application binary, and pass it to a `BearSSL::CertStore()` in order to validate TLS peers.
However, there are cases where you will not know beforehand which CA you will need (i.e. a user enters a website through a keypad), and you need to keep the list of CAs just like your web browser. In those cases, you need to generate a certificate bundle on the PC while compiling your application, upload the `certs.ar` bundle to LittleFS or SD when uploading your application binary, and pass it to a `BearSSL::CertStore()` in order to validate TLS peers.

See the `BearSSL_CertStore` example for full details as the `BearSSL::CertStore` requires the creation of a cookie-cutter object for filesystem access (because the SD and SPIFFS filesystems are presently incompatible with each other). At a high level in your `setup()` you will call `BearSSL::initCertStore()` on a global object, and then pass this global certificate store to `client.setCertStore(&gCA)` before every connection attempt to enable it as a validation option.
See the `BearSSL_CertStore` example for full details.

Supported Crypto
~~~~~~~~~~~~~~~~
Expand Down
11 changes: 6 additions & 5 deletions doc/esp8266wifi/client-secure-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,32 @@ Load client certificate from file system.
.. code:: cpp

#include <FS.h>
#include <LittleFS.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

const char* certyficateFile = "/client.cer";
const char* certificateFile = "/client.cer";

*setup() or loop()*

.. code:: cpp

if (!SPIFFS.begin())
if (!LittleFS.begin())
{
Serial.println("Failed to mount the file system");
return;
}

Serial.printf("Opening %s", certyficateFile);
File crtFile = SPIFFS.open(certyficateFile, "r");
Serial.printf("Opening %s", certificateFile);
File crtFile = LittleFS.open(certificateFile, "r");
if (!crtFile)
{
Serial.println(" Failed!");
}

WiFiClientSecure client;

Serial.print("Loading %s", certyficateFile);
Serial.print("Loading %s", certificateFile);
if (!client.loadCertificate(crtFile))
{
Serial.println(" Failed!");
Expand Down
4 changes: 2 additions & 2 deletions doc/faq/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ perform. It is not listed among libraries verified to work with ESP8266.

`Read more <a03-library-does-not-work.rst>`__.

In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M SPIFFS) or 4M (3M SPIFFS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?
In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M FS) or 4M (3M FS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The reason we cannot have more than 1MB of code in flash has to do with
Expand All @@ -90,7 +90,7 @@ total, but switching such "banks" on the fly is not easy and efficient,
so we don't bother doing that. Besides, no one has so far complained
about 1MB of code space being insufficient for practical purposes.

The option to choose 3M or 1M SPIFFS is to optimize the upload time.
The option to choose 3M or 1M filesystem is to optimize the upload time.
Uploading 3MB takes a long time so sometimes you can just use 1MB. Other
2MB of flash can still be used with ``ESP.flashRead`` and
``ESP.flashWrite`` APIs if necessary.
Expand Down
10 changes: 10 additions & 0 deletions doc/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ following include to the sketch:

#include "FS.h"

SPIFFS Deprecation Warning
--------------------------

SPIFFS is currently deprecated and may be removed in future releases of
the core. Please consider moving your code to LittleFS. SPIFFS is not
actively supported anymore by the upstream developer, while LittleFS is
under active development, supports real directories, and is many times
faster for most operations.


SPIFFS and LittleFS
-------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,6 @@ BeagleBone, CubieBoard).
- `What is PlatformIO? <https://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=arduino-esp8266>`__
- `PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=arduino-esp8266>`__
- `PlatformIO Core <https://docs.platformio.org/en/latest/core.html?utm_source=arduino-esp8266>`__ (command line tool)
- `Advanced usage <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266>`__ - custom settings, uploading to SPIFFS, Over-the-Air (OTA), staging version
- `Advanced usage <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266>`__ - custom settings, uploading to LittleFS, Over-the-Air (OTA), staging version
- `Integration with Cloud and Standalone IDEs <https://docs.platformio.org/en/latest/ide.html?utm_source=arduino-esp8266>`__ - Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode
- `Project Examples <https://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=arduino-esp8266#examples>`__
2 changes: 1 addition & 1 deletion doc/libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is a bit different from standard EEPROM class. You need to call ``EEPROM.be

``EEPROM.write`` does not write to flash immediately, instead you must call ``EEPROM.commit()`` whenever you wish to save changes to flash. ``EEPROM.end()`` will also commit, and will release the RAM copy of EEPROM contents.

EEPROM library uses one sector of flash located just after the SPIFFS.
EEPROM library uses one sector of flash located just after the embedded filesystem.

`Three examples <https://github.com/esp8266/Arduino/tree/master/libraries/EEPROM>`__ included.

Expand Down
2 changes: 1 addition & 1 deletion doc/ota_updates/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ If this is the case, then most likely ESP module has not been reset after initia
The most common causes of OTA failure are as follows:

- not enough physical memory on the chip (e.g. ESP01 with 512K flash memory is not enough for OTA).
- too much memory declared for SPIFFS so new sketch will not fit between existing sketch and SPIFFS – see `Update process - memory view <#update-process-memory-view>`__.
- too much memory declared for the filesystem so new sketch will not fit between existing sketch and the filesystem – see `Update process - memory view <#update-process-memory-view>`__.
- too little memory declared in Arduino IDE for your selected board (i.e. less than physical size).
- not resetting the ESP module after initial upload using serial port.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ unsigned int status = WL_IDLE_STATUS;

void setup() {
delay(1000);
Serial.begin(9600);
Serial.begin(115200);
Serial.println();
Serial.println("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
Expand Down
3 changes: 0 additions & 3 deletions libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ byte value;
void setup() {
// initialize serial and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
EEPROM.begin(512);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

#define USE_SERIAL Serial

/* this can be run with an emulated server on host:
cd esp8266-core-root-dir
cd tests/host
Expand All @@ -27,21 +25,21 @@

void setup() {

USE_SERIAL.begin(115200);
Serial.begin(115200);

USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
Serial.println();
Serial.println();
Serial.println();

WiFi.begin(STASSID, STAPSK);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
USE_SERIAL.print(".");
Serial.print(".");
}
USE_SERIAL.println("");
USE_SERIAL.print("Connected! IP address: ");
USE_SERIAL.println(WiFi.localIP());
Serial.println("");
Serial.print("Connected! IP address: ");
Serial.println(WiFi.localIP());

}

Expand All @@ -52,29 +50,29 @@ void loop() {
WiFiClient client;
HTTPClient http;

USE_SERIAL.print("[HTTP] begin...\n");
Serial.print("[HTTP] begin...\n");
// configure traged server and url
http.begin(client, "http://" SERVER_IP "/postplain/"); //HTTP
http.addHeader("Content-Type", "application/json");

USE_SERIAL.print("[HTTP] POST...\n");
Serial.print("[HTTP] POST...\n");
// start connection and send HTTP header and body
int httpCode = http.POST("{\"hello\":\"world\"}");

// httpCode will be negative on error
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
USE_SERIAL.printf("[HTTP] POST... code: %d\n", httpCode);
Serial.printf("[HTTP] POST... code: %d\n", httpCode);

// file found at server
if (httpCode == HTTP_CODE_OK) {
const String& payload = http.getString();
USE_SERIAL.println("received payload:\n<<");
USE_SERIAL.println(payload);
USE_SERIAL.println(">>");
Serial.println("received payload:\n<<");
Serial.println(payload);
Serial.println(">>");
}
} else {
USE_SERIAL.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
}

http.end();
Expand Down
Loading