USAGE.md 2.7 KB

Usage

This document is by no means complete.

Common options

  • –help will show some help
  • –start_baud set at a default of 115200 (the speed of the nodemcu at boot in later versions of the firmware)
  • –baud are set at a default of 115200
  • –port is by default /dev/ttyUSB0, /dev/tty.SLAB_USBtoUART if on Mac and COM1 on Windows
  • the environment variable SERIALPORT will override any default port

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. Immediately after first established communication it changes to a higher (–baud) speed, if neccesary, which defaults 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.

Commands

Upload

Uploading a number of files. Supports multiple files. If you want an alternate destination name, just add a colon «:» and the new destination filename.

./nodemcu-uploader.py upload init.lua README.md nodemcu-uploader.py [--compile] [--restart]

Uploading a number of files, but saving with a different file name.

./nodemcu-uploader.py upload init.lua:new_init.lua README.md:new_README.md [--compile] [--restart]

Uploading a number of files and verify successful uploading by downloading the file and comparing contents.

./nodemcu-uploader.py upload init.lua README.md nodemcu-uploader.py --verify=raw

Uploading a number of files and verify successful uploading by doing a sha1 checksum. Requires crypto module on the device and currently files not to big (~1000 bytes)

./nodemcu-uploader.py upload init.lua README.md nodemcu-uploader.py --verify=sha1

###Download Downloading a number of files. Supports multiple files. If you want an alternate destination name, just add a colon «:» and the new destination filename.

./nodemcu-uploader.py download init.lua README.md nodemcu-uploader.py

Downloading a number of files, but saving with a different file name.

./nodemcu-uploader.py download init.lua:new_init.lua README.md:new_README.md

List files

./nodemcu-uploader.py --port com1 file list

Format filesystem

./nodemcu-uploader.py file format

Remove specific files

./nodemcu-uploader.py file remove foo.lua