Skip to content

Commit c8ac5cf

Browse files
authored
Merge pull request #1980 from nodemcu/dev
2.1.0 master drop
2 parents 22e1adc + 787379f commit c8ac5cf

File tree

153 files changed

+9923
-11221
lines changed

Some content is hidden

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

153 files changed

+9923
-11221
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Make sure all boxes are checked (add x inside the brackets) when you submit your
77
- [ ] I have thoroughly tested my contribution.
88
- [ ] The code changes are reflected in the documentation at `docs/en/*`.
99

10-
\<Description of and rational behind this PR\>
10+
\<Description of and rationale behind this PR\>

CONTRIBUTING.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The following is a set of guidelines for contributing to NodeMCU on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
66

7-
It is appreciated if you raise an issue _before_ you start changing NodeMCU, discussing the proposed change; emphasing that the you are proposing to develop the patch yourself, and outlining the strategy for implementation. This type of discussion is what we should be doing on the issues list and it is better to do this before or in parallel to developing the patch rather than having "you should have done it this way" type of feedback on the PR itself.
7+
It is appreciated if you raise an issue _before_ you start changing NodeMCU, discussing the proposed change; emphasizing that you are proposing to develop the patch yourself, and outlining the strategy for implementation. This type of discussion is what we should be doing on the issues list and it is better to do this before or in parallel to developing the patch rather than having "you should have done it this way" type of feedback on the PR itself.
88

99
### Table Of Contents
1010
* [General remarks](#general-remarks)
@@ -16,20 +16,20 @@ It is appreciated if you raise an issue _before_ you start changing NodeMCU, dis
1616
* [Commit messages](#commit-messages)
1717
* [For collaborators](#for-collaborators)
1818
* [Handling releases](#handling-releases)
19-
19+
2020
## General remarks
2121
We are a friendly and welcoming community and look forward to your contributions. Once your contribution is integrated into this repository we feel responsible for it. Therefore, be prepared for constructive feedback. Before we merge anything we need to ensure that it fits in and is consistent with the rest of NodeMCU.
22-
If you made something really cool but won't spend time to integrate it into this upstream project please still share it in your fork on GitHub. If you mention it in an issues we'll take a look at it anyway.
22+
If you made something really cool but won't spend the time to integrate it into this upstream project please still share it in your fork on GitHub. If you mention it in an issue we'll take a look at it anyway.
2323

2424
## Development environment setup
25-
Use the platform and tools you feel most comfortable with. There are no constraints imposed by this project. You have (at least) two options to set up the toolchain to build the NodeMCU firmware:
25+
Use the platform and tools you feel most comfortable with. There are no constraints imposed by this project. You have (at least) two options to set up the toolchain to build the NodeMCU firmware:
2626
- [Full-fledged Linux environment](http://www.esp8266.com/wiki/doku.php?id=toolchain#how_to_setup_a_vm_to_host_your_toolchain), either physical or virtual.
27-
- [Docker image](https://hub.docker.com/r/marcelstoer/nodemcu-build/) which allows to run the build inside the container as if you were running a build script on your local machine.
27+
- [Docker image](https://hub.docker.com/r/marcelstoer/nodemcu-build/) which allows running the build inside the container as if you were running a build script on your local machine.
2828

2929
## Writing Documentation
3030
The NodeMCU documentation is maintained within the same repository as the code. The primary reason is to keep the two in sync more easily. It's thus trivial for the NodeMCU team to verify that a PR includes the necessary documentation. Furthermore, the documentation is merged automatically with the code if it moves from branch X to Y.
3131

32-
The documentation consists of a collection of Markdown files (see note on Markdown syntax at end of chapter) stored in the [`/docs`](docs) directory. With every commit a human readable and browsable version is automatically built with [Read the Docs](https://readthedocs.io/) (RTD). The public NodeMCU documentation can be found at [nodemcu.readthedocs.io](http://nodemcu.readthedocs.io/).
32+
The documentation consists of a collection of Markdown files (see note on Markdown syntax at end of chapter) stored in the [`/docs`](docs) directory. With every commit, a human readable and browsable version is automatically built with [Read the Docs](https://readthedocs.io/) (RTD). The public NodeMCU documentation can be found at [nodemcu.readthedocs.io](http://nodemcu.readthedocs.io/).
3333

3434
There are essentially only two things to keep in mind if you're contributing a PR:
3535

@@ -61,7 +61,7 @@ Avoid intermediate merge commits. [Rebase](https://www.atlassian.com/git/tutoria
6161
1. Think about [squashing (some of) your commits](http://www.andrewconnell.com/blog/squash-multiple-git-commits-into-one). There are [several ways](http://stackoverflow.com/a/5201642/131929) to do this. There's no need to squash everything into a single commit as GitHub offers to do this when we merge your changes. However, you might want to trim your commit history to relevant chunks.
6262
1. Bring your fork up-to-date with the NodeMCU upstream repo ([see below](#keeping-your-fork-in-sync)). Then rebase your branch on `dev` running `git rebase dev`.
6363
1. `git push`
64-
1. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) (PR) on GitHub.
64+
1. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) (PR) on GitHub.
6565

6666
This is just one way of doing things. If you're proficient in Git matters you're free to choose your own. If you want to read more then the [GitHub chapter in the Git book](http://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project#The-GitHub-Flow) is a way to start. [GitHub's own documentation](https://help.github.com/categories/collaborating/) contains a wealth of information as well.
6767

@@ -100,13 +100,13 @@ Don't forget to [reference affected issues](https://help.github.com/articles/clo
100100
## For collaborators
101101

102102
### Handling releases
103-
- Create a [milestone](https://github.com/nodemcu/nodemcu-firmware/milestones) right after you cut a new release. Give it a meaningful name if you already have an idea what the scope of the upcoming release is going to be. Also set the due date to ~2 months in the future.
104-
- Add this milestone to every PR before you merge it. Also add the milestone to PRs you want to see land in this milestone.
103+
- Create a [milestone](https://github.com/nodemcu/nodemcu-firmware/milestones) right after you cut a new release. Give it a meaningful name if you already have an idea what the scope of the upcoming release is going to be. Set the due date to ~2 months in the future.
104+
- Add this milestone to every PR before you merge it. Also, add the milestone to PRs you want to see land in this milestone.
105105
- Add notes to the description of the milestone in the course of the ~2 months it lives.
106-
- Be careful and reluctant to merge PRs once we're past the 6-weeks mark of a milestone. Ideally we don't merge anything in the last 2 weeks.
106+
- Be careful and reluctant to merge PRs once we're past the 6-weeks mark of a milestone. Ideally, we don't merge anything in the last 2 weeks.
107107
- Cutting a release
108-
- Create a PR for the `master` branch for collaborators to approve.
109-
- Once approved merge it. :exclamation::boom::exclamation: Make sure you do NOT "squash and merge" but make a regular merge commit!
110-
- Fetch the changes into your local clone and create an annotated tag like so: `git tag -a <SDK-version>-master_<yyyyMMdd> -m ""`, `git push --tags`
111-
- Create a new [release](https://github.com/nodemcu/nodemcu-firmware/releases) based on the tag you just pushed. The version name is the same as the tag name.
112-
- Write release notes. Mention breaking changes explicitly. Since every PR that went into this release is linked to from the milestone it should be fairly easy to include important changes in the release notes.
108+
- Create a PR for the `master` branch for collaborators to approve.
109+
- Once approved merge it. :exclamation::boom::exclamation: Make sure you do NOT "squash and merge" but make a regular merge commit!
110+
- Fetch the changes into your local clone and create an annotated tag like so: `git tag -a <SDK-version>-master_<yyyyMMdd> -m ""`, `git push --tags`
111+
- Create a new [release](https://github.com/nodemcu/nodemcu-firmware/releases) based on the tag you just pushed. The version name is the same as the tag name.
112+
- Write release notes. Mention breaking changes explicitly. Since every PR that went into this release is linked to from the milestone it should be fairly easy to include important changes in the release notes.

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.NOTPARALLEL:
44

55
# SDK version NodeMCU is locked to
6-
SDK_VER:=2.0.0
6+
SDK_VER:=2.1.0
77

88
# no patch: SDK_BASE_VER equals SDK_VER and sdk dir depends on sdk_extracted
99
SDK_BASE_VER:=$(SDK_VER)
@@ -12,8 +12,8 @@ SDK_DIR_DEPENDS:=sdk_extracted
1212
#SDK_BASE_VER:=1.5.4
1313
#SDK_DIR_DEPENDS:=sdk_patched
1414

15-
SDK_FILE_VER:=$(SDK_BASE_VER)_16_08_10
16-
SDK_FILE_SHA1:=b0127a99b45b3778be4a752387ab8dc0f6dd7810
15+
SDK_FILE_VER:=$(SDK_BASE_VER)
16+
SDK_FILE_SHA1:=66a4272894dc1bcec19f5f8bf79fee80f60a021b
1717
#SDK_PATCH_VER:=$(SDK_VER)_patch_20160704
1818
#SDK_PATCH_SHA1:=388d9e91df74e3b49fca126da482cf822cf1ebf1
1919
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
@@ -203,10 +203,10 @@ all: $(SDK_DIR_DEPENDS) pre_build .subdirs $(OBJS) $(OLIBS) $(OIMAGES) $(OBINS)
203203
sdk_extracted: $(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER)
204204
sdk_patched: sdk_extracted $(TOP_DIR)/sdk/.patched-$(SDK_VER)
205205

206-
$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
206+
$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip
207207
mkdir -p "$(dir $@)"
208-
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK/lib/* ESP8266_NONOS_SDK/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK/include/* ESP8266_NONOS_SDK/bin/esp_init_data_default.bin)
209-
mv $(dir $@)/ESP8266_NONOS_SDK $(dir $@)/esp_iot_sdk_v$(SDK_VER)
208+
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK-$(SDK_VER) && unzip $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK-$(SDK_VER)/lib/* ESP8266_NONOS_SDK-$(SDK_VER)/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK-$(SDK_VER)/include/* ESP8266_NONOS_SDK-$(SDK_VER)/bin/esp_init_data_default.bin)
209+
mv $(dir $@)/ESP8266_NONOS_SDK-$(SDK_VER) $(dir $@)/esp_iot_sdk_v$(SDK_VER)
210210
rm -f $(SDK_DIR)/lib/liblwip.a
211211
touch $@
212212

@@ -217,9 +217,9 @@ $(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VE
217217
rm -f $(SDK_DIR)/lib/liblwip.a
218218
touch $@
219219

220-
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip:
220+
$(TOP_DIR)/cache/v$(SDK_FILE_VER).zip:
221221
mkdir -p "$(dir $@)"
222-
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused http://espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v$(SDK_FILE_VER).zip -O $@ || { rm -f "$@"; exit 1; }
222+
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused https://github.com/espressif/ESP8266_NONOS_SDK/archive/v$(SDK_FILE_VER).zip -O $@ || { rm -f "$@"; exit 1; }
223223
(echo "$(SDK_FILE_SHA1) $@" | sha1sum -c -) || { rm -f "$@"; exit 1; }
224224

225225
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER).zip:

README.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **NodeMCU 2.0.0** #
1+
# **NodeMCU 2.1.0** #
22

33
[![Join the chat at https://gitter.im/nodemcu/nodemcu-firmware](https://img.shields.io/gitter/room/badges/shields.svg)](https://gitter.im/nodemcu/nodemcu-firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/nodemcu/nodemcu-firmware.svg)](https://travis-ci.org/nodemcu/nodemcu-firmware)
@@ -7,7 +7,7 @@
77

88
### A Lua based firmware for ESP8266 WiFi SOC
99

10-
NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/). The firmware is based on the [Espressif NON-OS SDK 2.0.0](https://espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v2.0.0_16_08_10.zip) and uses a file system based on [spiffs](https://github.com/pellepl/spiffs). The code repository consists of 98.1% C-code that glues the thin Lua veneer to the SDK.
10+
NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/). The firmware is based on the [Espressif NON-OS SDK 2.1.0](https://github.com/espressif/ESP8266_NONOS_SDK/releases/tag/v2.1.0) and uses a file system based on [spiffs](https://github.com/pellepl/spiffs). The code repository consists of 98.1% C-code that glues the thin Lua veneer to the SDK.
1111

1212
The NodeMCU *firmware* is a companion project to the popular [NodeMCU dev kits](https://github.com/nodemcu/nodemcu-devkit-v1.0), ready-made open source development boards with ESP8266-12E chips.
1313

@@ -16,7 +16,7 @@ The NodeMCU *firmware* is a companion project to the popular [NodeMCU dev kits](
1616
- Easy to program wireless node and/or access point
1717
- Based on Lua 5.1.4 (without *debug, os* modules)
1818
- Asynchronous event-driven programming model
19-
- 40+ built-in modules
19+
- 55+ built-in modules
2020
- Firmware available with or without floating point support (integer-only uses less memory)
2121
- Up-to-date documentation at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io)
2222

@@ -43,10 +43,9 @@ wifi.sta.config("SSID", "password")
4343

4444
# Documentation
4545

46-
The entire [NodeMCU documentation](https://nodemcu.readthedocs.io) is maintained right in this repository at [/docs](docs). The fact that the API documentation is mainted in the same repository as the code that *provides* the API ensures consistency between the two. With every commit the documentation is rebuilt by Read the Docs and thus transformed from terse Markdown into a nicely browsable HTML site at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io).
46+
The entire [NodeMCU documentation](https://nodemcu.readthedocs.io) is maintained right in this repository at [/docs](docs). The fact that the API documentation is maintained in the same repository as the code that *provides* the API ensures consistency between the two. With every commit the documentation is rebuilt by Read the Docs and thus transformed from terse Markdown into a nicely browsable HTML site at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io).
4747

4848
- How to [build the firmware](https://nodemcu.readthedocs.io/en/master/en/build/)
49-
- How to [build the filesystem](https://nodemcu.readthedocs.io/en/master/en/spiffs/)
5049
- How to [flash the firmware](https://nodemcu.readthedocs.io/en/master/en/flash/)
5150
- How to [upload code and NodeMCU IDEs](https://nodemcu.readthedocs.io/en/master/en/upload/)
5251
- API documentation for every module
@@ -66,52 +65,3 @@ See [https://nodemcu.readthedocs.io/en/master/en/support/](https://nodemcu.readt
6665
# License
6766

6867
[MIT](https://github.com/nodemcu/nodemcu-firmware/blob/master/LICENSE) © [zeroday](https://github.com/NodeMCU)/[nodemcu.com](http://nodemcu.com/index_en.html)
69-
70-
# Build Options
71-
72-
The following sections explain some of the options you have if you want to [build your own NodeMCU firmware](http://nodemcu.readthedocs.io/en/master/en/build/).
73-
74-
### Select Modules
75-
76-
Disable modules you won't be using to reduce firmware size and free up some RAM. The ESP8266 is quite limited in available RAM and running out of memory can cause a system panic. The default configuration is designed to run on all ESP modules including the 512 KB modules like ESP-01 and only includes general purpose interface modules which require at most two GPIO pins.
77-
78-
Edit `app/include/user_modules.h` and comment-out the `#define` statement for modules you don't need. Example:
79-
80-
```c
81-
...
82-
#define LUA_USE_MODULES_MQTT
83-
// #define LUA_USE_MODULES_COAP
84-
// #define LUA_USE_MODULES_U8G
85-
...
86-
```
87-
88-
### Tag Your Build
89-
90-
Identify your firmware builds by editing `app/include/user_version.h`
91-
92-
```c
93-
#define NODE_VERSION "NodeMCU 2.0.0+myname"
94-
#ifndef BUILD_DATE
95-
#define BUILD_DATE "YYYYMMDD"
96-
#endif
97-
```
98-
99-
### Set UART Bit Rate
100-
101-
The initial baud rate at boot time is 115200bps. You can change this by
102-
editing `BIT_RATE_DEFAULT` in `app/include/user_config.h`:
103-
104-
```c
105-
#define BIT_RATE_DEFAULT BIT_RATE_115200
106-
```
107-
108-
Note that, by default, the firmware runs an auto-baudrate detection algorithm so that typing a few characters at boot time will cause
109-
the firmware to lock onto that baud rate (between 1200 and 230400).
110-
111-
### Debugging
112-
113-
To enable runtime debug messages to serial console edit `app/include/user_config.h`
114-
115-
```c
116-
#define DEVELOP_VERSION
117-
```

app/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@ SUBDIRS= \
3838
smart \
3939
modules \
4040
spiffs \
41-
cjson \
4241
crypto \
4342
dhtlib \
4443
tsl2561 \
4544
net \
4645
http \
4746
fatfs \
4847
esp-gdbstub \
49-
websocket
48+
websocket \
49+
swTimer \
50+
misc \
51+
pm \
52+
5053

5154
endif # } PDIR
5255

@@ -87,16 +90,19 @@ COMPONENTS_eagle.app.v6 = \
8790
smart/smart.a \
8891
spiffs/spiffs.a \
8992
fatfs/libfatfs.a \
90-
cjson/libcjson.a \
9193
crypto/libcrypto.a \
9294
dhtlib/libdhtlib.a \
9395
tsl2561/tsl2561lib.a \
9496
http/libhttp.a \
97+
pm/libpm.a \
9598
websocket/libwebsocket.a \
9699
esp-gdbstub/libgdbstub.a \
97100
net/libnodemcu_net.a \
98101
mbedtls/libmbedtls.a \
99102
modules/libmodules.a \
103+
swTimer/libswtimer.a \
104+
misc/libmisc.a \
105+
100106

101107
# Inspect the modules library and work out which modules need to be linked.
102108
# For each enabled module, a symbol name of the form XYZ_module_selected is

app/cjson/CMakeLists.txt

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)