Przeglądaj źródła

Add Getting Started page (#2487)

-  Added Marcel's Getting Started page
-  Added reference to getting-started.md
-  Incorporated review findings
Marcel Stör 5 lat temu
rodzic
commit
9d8246fe52
9 zmienionych plików z 501 dodań i 153 usunięć
  1. 42 1
      docs/css/extra.css
  2. 0 6
      docs/de/index.md
  3. 2 2
      docs/en/flash.md
  4. 328 0
      docs/en/getting-started.md
  5. 0 53
      docs/en/index.md
  6. 0 0
      docs/en/lfs.md
  7. 0 0
      docs/en/lua-developer-faq.md
  8. 49 9
      docs/index.md
  9. 80 82
      mkdocs.yml

Plik diff jest za duży
+ 42 - 1
docs/css/extra.css


+ 0 - 6
docs/de/index.md

@@ -1,6 +0,0 @@
-# NodeMCU Dokumentation
-
-NodeMCU ist eine [eLua](http://www.eluaproject.net/)-basierende firmware für den [ESP8266 WiFi SOC von Espressif](http://espressif.com/en/products/esp8266/). Dies ist ein Partnerprojekt für die beliebten [NodeMCU dev kits](https://github.com/nodemcu/nodemcu-devkit-v1.0) - open source NodeMCU boards mit ESP8266-12E chips.
-
-Diese firmware nutzt das Espressif NON-OS SDK, das Dateisystem basiert auf [spiffs](https://github.com/pellepl/spiffs).
-

+ 2 - 2
docs/en/flash.md

@@ -22,9 +22,9 @@ Supported platforms: OS X, Linux, Windows, anything that runs Python
 
 Run the following command to flash an *aggregated* binary as is produced for example by the [cloud build service](build.md#cloud-build-service) or the [Docker image](build.md#docker-image).
 
-`esptool.py --port <serial-port-of-ESP8266> write_flash -fm <mode> 0x00000 <nodemcu-firmware>.bin`
+`esptool.py --port <serial-port-of-ESP8266> write_flash -fm <flash-mode> 0x00000 <nodemcu-firmware>.bin`
 
-[`mode`](https://github.com/espressif/esptool/#flash-modes) is `qio` for most ESP8266 ESP-01/07 (512&nbsp;kByte modules) and `dio` for most ESP32 and ESP8266 ESP-12 (>=4&nbsp;MByte modules). ESP8285 requires `dout`.
+[`flash-mode`](https://github.com/espressif/esptool/#flash-modes) is `qio` for most ESP8266 ESP-01/07 (512&nbsp;kByte modules) and `dio` for most ESP32 and ESP8266 ESP-12 (>=4&nbsp;MByte modules). ESP8285 requires `dout`.
 
 **Gotchas**
 

+ 328 - 0
docs/en/getting-started.md

@@ -0,0 +1,328 @@
+# Getting Started aka NodeMCU Quick Start
+
+The basic process to get started with NodeMCU consists of the following three steps.
+
+1.  [Build the firmware](build.md) with the modules you need
+1.  [Flash the firmware](flash.md) to the chip
+1.  [Upload code](upload.md) to the device.
+
+You will typically do steps 1 and 2 only once, but then repeat step 3 as you develop your application. If your application outgrows the limited on-chip RAM then you can use the [Lua Flash Store](lfs.md) (LFS) to move your Lua code into flash memory, freeing a lot more RAM for variable data. This is why it is a good idea to enable LFS for step 1 if you are developing a larger application. As documented below there is a different approach to uploading Lua code. 
+ 
+
+!!! caution
+	There's more than one way to skin a cat. For each of the tasks you have a number of choices with regards to tooling. The colored boxes represent an opinionated path to start your journey - the quickest way to success so to speak. Feel free to follow the links above to get more detailed information.
+
+### Task / OS selector
+
+<table id="gs">
+  <tr>
+    <!--th >Task ↓ \ OS →</th-->
+    <th>Task \ OS</th>
+    <th>Windows<div class="icon windowsIcon"></span></th>
+    <th>macOS<div class="icon appleIcon"></th>
+    <th>Linux<div class="icon linuxIcon"></th>
+  </tr>
+  <tr>
+    <th rowspan="3">Build firmware</th>
+    <td class="select"><a href="#cloud-builder">cloud builder</a></td>
+    <td class="select"><a href="#cloud-builder">cloud builder</a></td>
+    <td class="select"><a href="#cloud-builder">cloud builder</a></td>
+  </tr>
+  <tr>
+    <td><a href="#docker">Docker</a></td>
+    <td><a href="#docker">Docker</a></td>
+    <td><a href="#docker">Docker</a></td>
+  </tr>
+  <tr>
+    <td></td>
+    <td></td>
+    <td>native</td>
+  </tr>
+  <tr>
+    <th rowspan="2">Flash firmware</th>
+    <td class="select"><a href="#nodemcu-pyflasher">NodeMCU PyFlasher</a></td>
+    <td class="select"><a href="#nodemcu-pyflasher">NodeMCU PyFlasher</a></td>
+    <td></td>
+  </tr>
+  <tr>
+    <td><a href="#esptoolpy">esptool.py</a></td>
+    <td><a href="#esptoolpy">esptool.py</a></td>
+    <td class="select"><a href="#esptoolpy">esptool.py</a></td>
+  </tr>  
+  <tr>
+    <th rowspan="2">Upload code</th>
+    <td class="select"><a href="#esplorer">ESPlorer (Java)</a></td>
+    <td><a href="#esplorer">ESPlorer (Java)</a></td>
+    <td><a href="#esplorer">ESPlorer (Java)</a></td>
+  </tr>
+  <tr>
+    <td><a href="#nodemcu-tool">NodeMCU-Tool (Node.js)</a></td>
+    <td class="select"><a href="#nodemcu-tool">NodeMCU-Tool (Node.js)</a></td>
+    <td class="select"><a href="#nodemcu-tool">NodeMCU-Tool (Node.js)</a></td>
+  </tr> 
+  <t>
+    <th colspan="4">LFS tasks below</th>
+  </tr>
+  <tr>
+    <th rowspan="3">Build LFS<br>enabled firmware</th>
+    <td class="select"><a href="#for-lfs">cloud builder</a></td>
+    <td class="select"><a href="#for-lfs">cloud builder</a></td>
+    <td class="select"><a href="#for-lfs">cloud builder</a></td>
+  </tr>
+  <tr>
+    <td><a href="#for-lfs_1">Docker</a></td>
+    <td><a href="#for-lfs_1">Docker</a></td>
+    <td><a href="#for-lfs_1">Docker</a></td>
+  </tr>
+  <tr>
+    <td></td>
+    <td></td>
+    <td>native</td>
+  </tr>
+  <tr>
+    <th rowspan="2">Build luac.cross</th>
+    <td>not needed if you use Terry's webservice or Docker to later compile LFS image</td>
+    <td>not needed if you use Terry's webservice or Docker to later compile LFS image</td>
+    <td>not needed if you use Terry's webservice or Docker to later compile LFS image</td>
+  </tr>
+  <tr>
+    <td><a href="#windows">native</a></td>
+    <td><a href="#macos">native</a></td>
+    <td><a href="#linux">native</a></td>
+  </tr>
+  <tr>
+    <th rowspan="3">Compile Lua into<br>LFS image</th>
+    <td class="select"><a href="#terrys-lfs-lua-cross-compile-web-service">webservice</a></td>
+    <td><a href="#terrys-lfs-lua-cross-compile-web-service">webservice</a></td>
+    <td><a href="#terrys-lfs-lua-cross-compile-web-service">webservice</a></td>
+  </tr>
+  <tr>
+    <td><a href="#docker_1">Docker</a></td>
+    <td><a href="#docker_1">Docker</a></td>
+    <td><a href="#docker_1">Docker</a></td>
+  </tr>
+  <tr>
+    <td><a href="#native-on-os">native</a></td>
+    <td><a href="#native-on-os">native</a></td>
+    <td><a href="#native-on-os">native</a></td>
+  </tr>
+  <tr>
+    <th>Upload LFS image</th>
+    <td class="select"><a href="#upload-lfs-image">generic</a></td>
+    <td class="select"><a href="#upload-lfs-image">generic</a></td>
+    <td class="select"><a href="#upload-lfs-image">generic</a></td>
+  </tr>  
+</table>
+
+**How to read this**
+
+Use case: you're just starting with NodeMCU and your OS of choice is Windows (and you are not using LFS), then the blue boxes in the 'Windows' column are your guideline. You:
+
+- build the firmware on the cloud builder
+- download and run the NodeMCU PyFlasher to transfer the firmware to the device
+- download and run ESPlorer, which requires Java, to transfer Lua files from your system to the device
+
+**Missing tools?**
+
+Our intention is to introduce you to programming in Lua on the ESP8266 as quickly as possible, so we have kept the number of tools mentioned here to a minimum; [frightanic.com: Tools and IDEs](https://frightanic.com/iot/tools-ides-nodemcu/) discusses other tools and options.
+
+!!! caution
+	The below chapters are not meant to be followed one-by-one. Pick a task from the matrix above and it will take you to the relevant chapter.
+
+## Cloud Builder
+
+The cloud builder at [https://nodemcu-build.com](https://nodemcu-build.com) allows to pick NodeMCU branch, modules and a few other configuration options (e.g. SSL yes/no). After the build is completed you will receive an email with two links to download your custom firmware: 
+
+- one for NodeMCU with floating support
+- one for NodeMCU *without* floating support i.e. an integer-only binary
+
+We recommend using the floating point build, even though the integer variant uses less RAM for storing variables, as there is little runtime difference between the two variants. Furthermore, the floating point variant handles non-integer values properly and this greatly simplifies numeric calculations.
+
+For everything else the cloud builder GUI is self-explanatory. Hence, no need for further explanations here.
+
+### For LFS
+
+1. Expand the "LFS options" panel
+1. Select an LFS size, 64KB is likely going to be large enough
+1. Select other options and build
+
+[↑ back to matrix](#task-os-selector)
+
+_Note that this service is not maintained by the NodeMCU team. It's run by a NodeMCU team member as an individual, though._
+
+## NodeMCU PyFlasher
+
+[Self-contained NodeMCU flasher](https://github.com/marcelstoer/nodemcu-pyflasher) with GUI based on Python, esptool.py (see below) and wxPython. A runnable .exe is available for Windows and a .dmg for macOS.
+
+**No installation required on Windows and macOS!** Instructions how to run it on other platforms are available on the project site.
+
+![](https://github.com/marcelstoer/nodemcu-pyflasher/raw/master/images/gui.png)
+
+1. [Install drivers for USB-to-serial](https://docs.thingpulse.com/how-tos/install-drivers/). Which driver you need depends on the ESP8266 module or USB-to-serial converter you use.
+1. Connect USB cable to device and computer.
+1. [Download](https://github.com/marcelstoer/nodemcu-pyflasher) then start PyFlasher
+1. Select serial port, browse for firmware binary and set the flash options.
+
+[↑ back to matrix](#task-os-selector)
+
+_Note that this tool is not an official NodeMCU offering. It's maintained by a NodeMCU team member as an individual, though._
+
+## esptool.py
+
+[esptool.py](https://github.com/espressif/esptool) was started as a ESP8266 community effort but has since been adopted by Espressif. It's their officially recommended way to flash firmware to ESPxxx chips.
+
+1. [Install drivers for USB-to-serial](https://docs.thingpulse.com/how-tos/install-drivers/). Which driver you need depends on the ESP8266 module or USB-to-serial converter you use.
+1. Install [either Python 2.7 or Python >=3.4](https://www.python.org/downloads/) on your system if it's not available yet.
+1. Connect USB cable to device and computer.
+1. `$ pip install esptool` (also installs pySerial)
+1. `$ esptool.py --port <serial-port-of-ESP8266> --baud <baud-rate> write_flash -fm <flash-mode> 0x00000 <nodemcu-firmware>.bin`
+
+[`flash-mode`](https://github.com/espressif/esptool/#flash-modes) is `qio` for most ESP8266 ESP-01/07 (512&nbsp;kByte modules) and `dio` for most ESP32 and ESP8266 ESP-12 (>=4&nbsp;MByte modules). ESP8285 requires `dout`.
+
+The [default baud rate](https://github.com/espressif/esptool#baud-rate) is 115200. Most hardware configurations should work with 230400 dependent on OS, driver, and module. NodeMCU and WeMos modules are usually ok with 921600.
+
+More details available on esptool.py GitHub repo.
+
+[↑ back to matrix](#task-os-selector)
+
+## ESPlorer
+
+TBD [https://github.com/4refr0nt/ESPlorer](https://github.com/4refr0nt/ESPlorer)
+
+[↑ back to matrix](#task-os-selector)
+
+## NodeMCU-Tool
+
+Arguably [NodeMCU-Tool](https://github.com/andidittrich/NodeMCU-Tool), which requires Node.js, is the better code upload & execution tool than ESPlorer. Also, in contrast to the former it is very well maintained. However, we also understand that Windows users in general prefer GUI over command line.
+
+The [list of features](https://github.com/andidittrich/NodeMCU-Tool#tool-summary) is quite long but essentially NodeMCU-Tool offers:
+
+- upload (Lua) files from your host system to the device
+- manage the device file system (delete, up-/download, etc.)
+- run files on NodeMCU and display the output over UART/serial
+
+Quick start:
+
+1. [Install Node.js and NPM](https://nodejs.org/en/download/) if not available yet
+1. Install NodeMCU-Tool globally `$ npm install nodemcu-tool -g`
+1. Verify installation by runnin `$ nodemcu-tool --version`
+1. Upload a Lua file `$ nodemcu-tool upload --port=/dev/ttyUSB0 helloworld.lua`
+1. Run it `$ nodemcu-tool run helloworld.lua`
+
+Note that you may need to use the `sudo` prefix to install the tool at step 2, and also possibly add the `–unsafe-perm` flag after the install command.
+
+[↑ back to matrix](#task-os-selector)
+
+## Docker
+
+The [Docker NodeMCU build image](https://github.com/marcelstoer/docker-nodemcu-build) is the easiest method to build NodeMCU related components locally on your preferred platform.
+
+Offering:
+
+- build NodeMCU firmware based on locally cloned sources and configuration
+- cross-compile Lua files into LFS image locally
+
+Detailed instructions available in the image's README. As for available config options [check the documentation](build.md#build-options) and study the comments in `app/include/user_config.h`.
+
+### For LFS
+
+1. In `app/include/user_config.h` uncomment `#define LUA_FLASH_STORE 0x10000` and adjust the size if necessary.
+2. Build as you would otherwise build with this image (i.e. see its README)
+
+[↑ back to matrix](#task-os-selector)
+
+_Note that this Docker image is not an official NodeMCU offering. It's maintained by a NodeMCU team member as an individual, though._
+
+## Build `luac.cross`
+
+A local copy of `luac.cross` is only needed if you want to compile the Lua files into an LFS image yourself and you are _not_ using Docker.
+
+### Windows
+Windows 10 users can install and use the Windows Subsystem for Linux (WSL). Alternatively all Windows users can [install Cygwin](https://www.cygwin.com/install.html) (only Cygwin core + **gcc-core** + **gnu make**). Either way, you will need a copy of the `luac.cross` compiler:
+
+-  You can either download this from Terry's fileserver.  The [ELF variant](http://files.ellisons.org.uk/esp8266/luac.cross) is used for all recent Linux and WSL flavours, or the [cygwin binary](http://files.ellisons.org.uk/esp8266/luac.cross.cygwin)) for the Cygwin environment.
+-  Or you can compile it yourself by downloading the current NodeMCU sources (this [ZIPfile](https://github.com/nodemcu/nodemcu-firmware/archive/master.zip)); edit the `app/includes/user_config.h` file and then `cd` to the `app/lua/luac_cross` and run make to build the compiler in the NodeMCU firmware root directory.  Note that the `luac.cross` make only needs the host toolchain which is installed by default.
+
+### macOS
+
+TBD
+
+1. `$ cd app/lua/luac_cross`
+2. `$ make` 
+
+### Linux
+
+TBD
+
+1. `$ cd app/lua/luac_cross`
+2. `$ make`
+
+[↑ back to matrix](#task-os-selector)
+
+## Compile Lua into LFS image
+
+### Select Lua files to be run from LFS
+
+The easiest approach is to maintain all the Lua files for your project in a single directory on your host. (These files will be compiled by `luac.cross` to build the LFS image in next step.)
+    
+For example to run the Telnet and FTP servers from LFS, put the following files in your project directory:
+	
+* [lua_examples/lfs/_init.lua](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_examples/lfs/_init.lua).  LFS helper routines and functions.
+* [lua_examples/lfs/dummy_strings.lua](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_examples/lfs/dummy_strings.lua).  Moving common strings into LFS.
+* [lua_examples/telnet/telnet.lua](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_examples/telnet/telnet.lua).  A simple **telnet** server.
+* [lua_modules/ftp/ftpserver.lua](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_modules/ftp/ftpserver.lua).  A simple **FTP** server.
+
+You should always include the first two modules, but the remaining files would normally be replaced by your own project files.  Also remember that these are examples and that you are entirely free to modify or to replace them for your own application needs.
+
+### Terry's LFS Lua Cross-Compile Web Service
+
+[https://blog.ellisons.org.uk/article/nodemcu/a-lua-cross-compile-web-service/](https://blog.ellisons.org.uk/article/nodemcu/a-lua-cross-compile-web-service/)
+
+Note: read up on [selecting Lua files](#select-lua-files-to-be-run-from-lfs) first
+
+Upload a ZIP file with all your Lua files ready for LFS. The webservice will cross-compile them into a `.img` ready to be uploaded to the device. It supports LFS images for both floating point and integer firmware variants.
+
+Further details available on the service site.
+
+_Note that this service is not maintained by the NodeMCU team. It's run by a NodeMCU team member as an individual, though._
+
+### Docker
+
+Note: read up on [selecting Lua files](#select-lua-files-to-be-run-from-lfs) first
+
+The same Docker image you used to build the NodeMCU firmware can be used to [compile Lua files into an LFS image](https://github.com/marcelstoer/docker-nodemcu-build#run-this-image-with-docker-to-create-an-lfs-image).
+
+1. `$ cd <your-nodemcu-firmware-folder>`
+1. `$ docker run --rm -ti -v `pwd`:/opt/nodemcu-firmware -v {PathToLuaSourceFolder}:/opt/lua marcelstoer/nodemcu-build lfs-image`
+
+### Native on OS
+
+Note: read up on [selecting Lua files](#select-lua-files-to-be-run-from-lfs) first
+
+For Windows you will do this from within the WSL / Cygwin command window, both of which use the `bash` shell.
+
+1. `$ cd <project-dir>`
+1. `$ luac.cross -o lfs.img -f *.lua`
+
+You will need to adjust the `img` and `lua` paths according to their location, and ensure that `luac.cross` is in your `$PATH` search list.  For example if you are using WSL and your project files are in `D:\myproject` then the Lua path would be `/mnt/d/myproject/*.lua` (For cygwin replace `mnt` by `cygwin`).  This will create the `lfs.img` file if there are no Lua compile errors (again specify an explicit directory path if needed).
+
+You might also want to add a simple one-line script file to your `~/bin` directory to wrap this command up.
+
+[↑ back to matrix](#task-os-selector)
+
+## Upload LFS image
+
+The compiled LFS image file (e.g. `lfs.img`) is uploaded as a regular file to the device file system (SPIFFS). You do this just like with Lua files with e.g. [ESPlorer](#esplorer) or [NodeMCU-Tool](#nodemcu-tool). There is also a new example, [HTTP_OTA.lua](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_examples/lfs/HTTP_OTA.lua), in `lua_examples` that can retrieve images from a standard web service.
+  
+Once the LFS image file is on SPIFFS, you can execute the [node.flashreload()](../modules/node/#nodeflashreload) command and the loader will then load it into flash and immediately restart the ESP module with the new LFS loaded, if the image file is valid. However, the call will return with an error _if_ the file is found to be invalid, so your reflash code should include logic to handle such an error return.
+
+### Edit your `init.lua` file
+
+`init.lua` is the file that is first executed by the NodeMCU firmware. Usually it setups the WiFi connection and executes the main Lua application.  Assuming that you have included the `_init` file discussed above, then executing this will add a simple API for LFS module access:
+
+-  Individual functions can be executed directly, e.g. `LFS.myfunc(a,b)`
+-  LFS is now in the require path, so `require 'myModule'` works as expected.
+
+Do a protected call of this `_init` code: `pcall(node.flashindex("_init"))` and check the error status.  See [Programming Techniques and Approachs](lfs.md#programming-techniques-and-approachs) in the LFS whitepaper for a more detailed description. 
+
+[↑ back to matrix](#task-os-selector)

+ 0 - 53
docs/en/index.md

@@ -1,53 +0,0 @@
-# NodeMCU Documentation
-
-NodeMCU is an open source [Lua](https://www.lua.org/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/) and uses an on-module flash-based [SPIFFS](https://github.com/pellepl/spiffs) file system. NodeMCU is implemented in C and is layered on the [Espressif NON-OS SDK](https://github.com/espressif/ESP8266_NONOS_SDK).
-
-The firmware was initially developed as is a companion project to the popular ESP8266-based [NodeMCU development modules](https://github.com/nodemcu/nodemcu-devkit-v1.0), but the project is now community-supported, and the firmware can now be run on _any_ ESP module.
-
-## Programming Model
-The NodeMCU programming model is similar to that of [Node.js](https://en.wikipedia.org/wiki/Node.js), only in Lua. It is asynchronous and event-driven. Many functions, therefore, have parameters for callback functions. To give you an idea what a NodeMCU program looks like study the short snippets below. For more extensive examples have a look at the `/lua_examples` folder in the repository on GitHub.
-
-```lua
--- a simple HTTP server
-srv = net.createServer(net.TCP)
-srv:listen(80, function(conn)
-	conn:on("receive", function(sck, payload)
-		print(payload)
-		sck:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n<h1> Hello, NodeMCU.</h1>")
-	end)
-	conn:on("sent", function(sck) sck:close() end)
-end)
-```
-```lua
--- connect to WiFi access point
-wifi.setmode(wifi.STATION)
-wifi.sta.config("SSID", "password")
-```
-
-```lua
--- register event callbacks for WiFi events
-wifi.sta.eventMonReg(wifi.STA_CONNECTING, function(previous_state)
-	if(previous_state==wifi.STA_GOTIP) then 
-	    print("Station lost connection with access point. Attempting to reconnect...")
-	else
-	    print("STATION_CONNECTING")
-	end
-end)
-```
-
-```lua
--- manipulate hardware like with Arduino
-pin = 1
-gpio.mode(pin, gpio.OUTPUT)
-gpio.write(pin, gpio.HIGH)
-print(gpio.read(pin))
-```
-### Lua Flash Store (LFS)
-In July 2018 support for a [Lua Flash Store (LFS)](lfs.md) was introduced. LFS allows Lua code and its associated constant data to be executed directly out of flash-memory; just as the firmware itself is executed. This now enables NodeMCU developers to create Lua applications with up to 256Kb Lua code and read-only constants executing out of flash. All of the RAM is available for read-write data!
-
-## Getting Started
-1. [Build the firmware](build.md) with the modules you need.
-1. [Flash the firmware](flash.md) to the chip.
-1. [Upload code](upload.md) to the firmware.
-
-

Plik diff jest za duży
+ 0 - 0
docs/en/lfs.md


Plik diff jest za duży
+ 0 - 0
docs/en/lua-developer-faq.md


+ 49 - 9
docs/index.md

@@ -1,15 +1,55 @@
 # NodeMCU Documentation
 
-NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/).  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.
+NodeMCU is an open source [Lua](https://www.lua.org/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/) and uses an on-module flash-based [SPIFFS](https://github.com/pellepl/spiffs) file system. NodeMCU is implemented in C and is layered on the [Espressif NON-OS SDK](https://github.com/espressif/ESP8266_NONOS_SDK).
 
-## Up-To-Date Documentation
-At the moment the only up-to-date documentation maintained by the current NodeMCU team is in [English](en/index.md). It is part of the source code repository (`/docs` subfolder) and kept in sync with the code.
+The firmware was initially developed as is a companion project to the popular ESP8266-based [NodeMCU development modules]((https://github.com/nodemcu/nodemcu-devkit-v1.0)), but the project is now community-supported, and the firmware can now be run on _any_ ESP module.
+
+## Programming Model
+The NodeMCU programming model is similar to that of [Node.js](https://en.wikipedia.org/wiki/Node.js), only in Lua. It is asynchronous and event-driven. Many functions, therefore, have parameters for callback functions. To give you an idea what a NodeMCU program looks like study the short snippets below. For more extensive examples have a look at the [`/lua_examples`](https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_examples) folder in the repository on GitHub.
+
+```lua
+-- a simple HTTP server
+srv = net.createServer(net.TCP)
+srv:listen(80, function(conn)
+	conn:on("receive", function(sck, payload)
+		print(payload)
+		sck:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n<h1> Hello, NodeMCU.</h1>")
+	end)
+	conn:on("sent", function(sck) sck:close() end)
+end)
+```
+```lua
+-- connect to WiFi access point
+wifi.setmode(wifi.STATION)
+wifi.sta.config("SSID", "password")
+```
+
+```lua
+-- register event callbacks for WiFi events
+wifi.sta.eventMonReg(wifi.STA_CONNECTING, function(previous_state)
+	if(previous_state==wifi.STA_GOTIP) then 
+	    print("Station lost connection with access point. Attempting to reconnect...")
+	else
+	    print("STATION_CONNECTING")
+	end
+end)
+```
 
-We encourage you to help transferring the outdated translations (see below) into the repository.
+```lua
+-- manipulate hardware like with Arduino
+pin = 1
+gpio.mode(pin, gpio.OUTPUT)
+gpio.write(pin, gpio.HIGH)
+print(gpio.read(pin))
+```
+## Lua Flash Store (LFS)
+In September 2018 support for a [Lua Flash Store (LFS)](en/lfs.md) was introduced. LFS allows Lua code and its associated constant data to be executed directly out of flash-memory; just as the firmware itself is executed. This now enables NodeMCU developers to create Lua applications with up to 256Kb Lua code and read-only constants executing out of flash. All of the RAM is available for read-write data!
 
-## Outdated And Sparse Documentation
-The following translations are based on outdated documentation, use them with caution. The links point to the [NodeMCU wiki on GitHub](https://github.com/nodemcu/nodemcu-firmware/wiki).
+## Releases
 
-- Chinese, [中文](https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_cn)
-- Russian, [русский](https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_ru)
-- Spanish, [español](https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_es)
+This project uses two main branches, `master` and `dev`. `dev` is actively worked on and it's also where PRs should be created against. `master` thus can be considered "stable" even though there are no automated regression tests. The goal is to merge back to `master` roughly every 2 months. Depending on the current "heat" (issues, PRs) we accept changes to `dev` for 5-6 weeks and then hold back for 2-3 weeks before the next snap is completed.
+
+A new tag is created every time `dev` is merged back to `master`. They are listed in the [releases section on GitHub](https://github.com/nodemcu/nodemcu-firmware/releases). Tag names follow the `<SDK-version>-master_yyyymmdd` pattern.
+
+## Up-To-Date Documentation
+At the moment the only up-to-date documentation maintained by the current NodeMCU team is in [English](en/index.md). It is part of the source code repository (`/docs` subfolder) and kept in sync with the code.

+ 80 - 82
mkdocs.yml

@@ -21,89 +21,87 @@ extra_javascript:
 
 pages:
 - Overview: 'index.md'
-- English:
-    - Home: 'en/index.md'
+- Basics:
+    - Getting started: 'en/getting-started.md'
     - Building the firmware: 'en/build.md'
     - Flashing the firmware: 'en/flash.md'
     - Uploading code: 'en/upload.md'
     - Support: 'en/support.md'
-    - FAQs:
-        - Lua Developer FAQ: 'en/lua-developer-faq.md'
-        - Extension Developer FAQ: 'en/extn-developer-faq.md'
-        - Hardware FAQ: 'en/hardware-faq.md'
-    - Whitepapers:
-        - Filesystem on SD card: 'en/sdcard.md'
-        - Internal filesystem: 'en/spiffs.md'
-        - Lua Compact Debug (LCD): 'en/lcd.md'
-        - Lua Flash Store (LFS): 'en/lfs.md'
-    - Modules:
-        - 'adc': 'en/modules/adc.md'
-        - 'ads1115' : 'en/modules/ads1115.md'
-        - 'adxl345': 'en/modules/adxl345.md'
-        - 'am2320': 'en/modules/am2320.md'
-        - 'apa102': 'en/modules/apa102.md'
-        - 'bit': 'en/modules/bit.md'
-        - 'bloom' : 'en/modules/bloom.md'
-        - 'bme280': 'en/modules/bme280.md'
-        - 'bme680': 'en/modules/bme680.md'
-        - 'bmp085': 'en/modules/bmp085.md'
-        - 'cjson': 'en/modules/cjson.md'
-        - 'coap': 'en/modules/coap.md'
-        - 'color-utils': 'en/modules/color-utils.md'
-        - 'cron': 'en/modules/cron.md'
-        - 'crypto': 'en/modules/crypto.md'
-        - 'dht': 'en/modules/dht.md'
-        - 'ds18b20': 'en/modules/ds18b20.md'
-        - 'encoder': 'en/modules/encoder.md'
-        - 'enduser setup': 'en/modules/enduser-setup.md'
-        - 'file': 'en/modules/file.md'
-        - 'gdbstub': 'en/modules/gdbstub.md'
-        - 'gpio': 'en/modules/gpio.md'
-        - 'hdc1080': 'en/modules/hdc1080.md'
-        - 'hmc5883l': 'en/modules/hmc5883l.md'
-        - 'http': 'en/modules/http.md'
-        - 'hx711' : 'en/modules/hx711.md'
-        - 'i2c' : 'en/modules/i2c.md'
-        - 'l3g4200d' : 'en/modules/l3g4200d.md'
-        - 'mcp4725': 'en/modules/mcp4725.md'
-        - 'mdns': 'en/modules/mdns.md'
-        - 'mqtt': 'en/modules/mqtt.md'
-        - 'net': 'en/modules/net.md'
-        - 'node': 'en/modules/node.md'
-        - 'ow (1-Wire)': 'en/modules/ow.md'
-        - 'pcm' : 'en/modules/pcm.md'
-        - 'perf': 'en/modules/perf.md'
-        - 'pwm' : 'en/modules/pwm.md'
-        - 'rc' : 'en/modules/rc.md'
-        - 'rfswitch' : 'en/modules/rfswitch.md'
-        - 'rotary' : 'en/modules/rotary.md'
-        - 'rtcfifo': 'en/modules/rtcfifo.md'
-        - 'rtcmem': 'en/modules/rtcmem.md'
-        - 'rtctime': 'en/modules/rtctime.md'
-        - 'si7021' : 'en/modules/si7021.md'
-        - 'sigma delta': 'en/modules/sigma-delta.md'
-        - 'sjson': 'en/modules/sjson.md'
-        - 'sntp': 'en/modules/sntp.md'
-        - 'somfy': 'en/modules/somfy.md'
-        - 'spi': 'en/modules/spi.md'
-        - 'sqlite3': 'en/modules/sqlite3.md'
-        - 'struct': 'en/modules/struct.md'
-        - 'switec': 'en/modules/switec.md'
-        - 'tcs34725': 'en/modules/tcs34725.md'
-        - 'tls': 'en/modules/tls.md'
-        - 'tm1829': 'en/modules/tm1829.md'
-        - 'tmr': 'en/modules/tmr.md'
-        - 'tsl2561': 'en/modules/tsl2561.md'
-        - 'u8g2': 'en/modules/u8g2.md'
-        - 'uart': 'en/modules/uart.md'
-        - 'ucg': 'en/modules/ucg.md'
-        - 'websocket': 'en/modules/websocket.md'
-        - 'wifi': 'en/modules/wifi.md'
-        - 'wifi.monitor': 'en/modules/wifi_monitor.md'
-        - 'wps': 'en/modules/wps.md'
-        - 'ws2801': 'en/modules/ws2801.md'
-        - 'ws2812': 'en/modules/ws2812.md'
-        - 'ws2812-effects': 'en/modules/ws2812-effects.md'
-        - 'xpt2046': 'en/modules/xpt2046.md'
-#- Deutsch:
-#    - Home: 'de/index.md'
+- FAQs:
+    - Lua Developer FAQ: 'en/lua-developer-faq.md'
+    - Extension Developer FAQ: 'en/extn-developer-faq.md'
+    - Hardware FAQ: 'en/hardware-faq.md'
+- Whitepapers:
+    - Filesystem on SD card: 'en/sdcard.md'
+    - Internal filesystem: 'en/spiffs.md'
+    - Lua Compact Debug (LCD): 'en/lcd.md'
+    - Lua Flash Store (LFS): 'en/lfs.md'
+- Modules:
+    - 'adc': 'en/modules/adc.md'
+    - 'ads1115' : 'en/modules/ads1115.md'
+    - 'adxl345': 'en/modules/adxl345.md'
+    - 'am2320': 'en/modules/am2320.md'
+    - 'apa102': 'en/modules/apa102.md'
+    - 'bit': 'en/modules/bit.md'
+    - 'bloom' : 'en/modules/bloom.md'
+    - 'bme280': 'en/modules/bme280.md'
+    - 'bme680': 'en/modules/bme680.md'
+    - 'bmp085': 'en/modules/bmp085.md'
+    - 'cjson': 'en/modules/cjson.md'
+    - 'coap': 'en/modules/coap.md'
+    - 'color-utils': 'en/modules/color-utils.md'
+    - 'cron': 'en/modules/cron.md'
+    - 'crypto': 'en/modules/crypto.md'
+    - 'dht': 'en/modules/dht.md'
+    - 'ds18b20': 'en/modules/ds18b20.md'
+    - 'encoder': 'en/modules/encoder.md'
+    - 'enduser setup': 'en/modules/enduser-setup.md'
+    - 'file': 'en/modules/file.md'
+    - 'gdbstub': 'en/modules/gdbstub.md'
+    - 'gpio': 'en/modules/gpio.md'
+    - 'hdc1080': 'en/modules/hdc1080.md'
+    - 'hmc5883l': 'en/modules/hmc5883l.md'
+    - 'http': 'en/modules/http.md'
+    - 'hx711' : 'en/modules/hx711.md'
+    - 'i2c' : 'en/modules/i2c.md'
+    - 'l3g4200d' : 'en/modules/l3g4200d.md'
+    - 'mcp4725': 'en/modules/mcp4725.md'
+    - 'mdns': 'en/modules/mdns.md'
+    - 'mqtt': 'en/modules/mqtt.md'
+    - 'net': 'en/modules/net.md'
+    - 'node': 'en/modules/node.md'
+    - 'ow (1-Wire)': 'en/modules/ow.md'
+    - 'pcm' : 'en/modules/pcm.md'
+    - 'perf': 'en/modules/perf.md'
+    - 'pwm' : 'en/modules/pwm.md'
+    - 'rc' : 'en/modules/rc.md'
+    - 'rfswitch' : 'en/modules/rfswitch.md'
+    - 'rotary' : 'en/modules/rotary.md'
+    - 'rtcfifo': 'en/modules/rtcfifo.md'
+    - 'rtcmem': 'en/modules/rtcmem.md'
+    - 'rtctime': 'en/modules/rtctime.md'
+    - 'si7021' : 'en/modules/si7021.md'
+    - 'sigma delta': 'en/modules/sigma-delta.md'
+    - 'sjson': 'en/modules/sjson.md'
+    - 'sntp': 'en/modules/sntp.md'
+    - 'somfy': 'en/modules/somfy.md'
+    - 'spi': 'en/modules/spi.md'
+    - 'sqlite3': 'en/modules/sqlite3.md'
+    - 'struct': 'en/modules/struct.md'
+    - 'switec': 'en/modules/switec.md'
+    - 'tcs34725': 'en/modules/tcs34725.md'
+    - 'tls': 'en/modules/tls.md'
+    - 'tm1829': 'en/modules/tm1829.md'
+    - 'tmr': 'en/modules/tmr.md'
+    - 'tsl2561': 'en/modules/tsl2561.md'
+    - 'u8g2': 'en/modules/u8g2.md'
+    - 'uart': 'en/modules/uart.md'
+    - 'ucg': 'en/modules/ucg.md'
+    - 'websocket': 'en/modules/websocket.md'
+    - 'wifi': 'en/modules/wifi.md'
+    - 'wifi.monitor': 'en/modules/wifi_monitor.md'
+    - 'wps': 'en/modules/wps.md'
+    - 'ws2801': 'en/modules/ws2801.md'
+    - 'ws2812': 'en/modules/ws2812.md'
+    - 'ws2812-effects': 'en/modules/ws2812-effects.md'
+    - 'xpt2046': 'en/modules/xpt2046.md'

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików