Browse Source

Update USAGE.md

* more details about the changes in default speed
* list more commands
* show how to use SERIALPORT environment variable
Peter Magnusson 4 years ago
parent
commit
947e9cfbf8
1 changed files with 42 additions and 1 deletions
  1. 42 1
      doc/USAGE.md

+ 42 - 1
doc/USAGE.md

@@ -12,6 +12,12 @@ This document is by no means complete.
   __/dev/tty.SLAB_USBtoUART__ if on Mac and __COM1__ on Windows
 * the environment variable __SERIALPORT__ will override any default port
 
+
+Since version v0.4.0 of the tool you will need a recent (june/july 2016) 
+version or later of the firmware for nodemcu. The default baudrate was changed in 
+firmware from 9600 to 115200 and this tool was changed as well. 
+Download a recent firmware from http://nodemcu-build.com/ .
+
 Since v0.2.1 the program works with 2 possible speeds. It connects at a default
 (--start_baud) of 115200 baud which is what the default firmware uses. Earlier
 versions of the firmware and this tool used 9600 as start baudrate.
@@ -21,9 +27,10 @@ to 115200. This allows all communication to happen much faster without having to
 recompile the firmware or do any manual changes to the speed.
 When done and before it closes the port it changes the speed back to normal
 if it was changed.
+
 Since v0.4.0 of nodemcu-uploader it tries to use the auto-baudrate feature
 build in to the firmware by sending a character repetedly when initiating
-communication.
+communication. This requires a firmware from june/july 2016 or later.
 
 ## Commands
 ### Upload
@@ -81,18 +88,52 @@ nodemcu-uploader download init.lua:new_init.lua README.md:new_README.md
 ```
 
 ### List files
+Listing files, using serial port com1 on Windows
 ```
 nodemcu-uploader --port com1 file list
 ```
 
+### Do (execute) a file
+`nodemcu-uploader file do runme.lua`
+
+This file has to exist on the device before, otherwise you will get an error.
+
+### Print a file
+This will show the contents of an existing file.
+
+`nodemcu-uploader file print init.lua`
+
+
+### Listing heap memory size
+`nodemcu-uploader node heap`
+
+
+### Restarting the device
+`nodemcu-uploader node restart`
+
+
 ### Format filesystem
 ```
 nodemcu-uploader file format
 ```
+Note that this can take a long time depending on size of flash on the device.
+Even if the tool timeout waiting for response from the device it might have 
+worked. The tool was just not waiting long enough.
 
 ### Remove specific files
 ```
 nodemcu-uploader file remove foo.lua
 ```
 
+## Misc
+### Setting default serial-port
+Using the environment variable `SERIALPORT` you can avoid having to 
+type the `--port` option every time you use the tool.
+
+On Windows, if your devices was connected to COM3 this could be done like this.
+```batch
+set SERIALPORT=com3
+REM on all subsequent commands the default port `com3`would be assumed
 
+nodemcu-uploader file list
+```