A simple tool for uploading files to the filesystem of an ESP8266 running NodeMCU as well as some other useful commands.
master | next |
---|---|
Please note that these tests is not complete and it might be the tests themselves that are having issues.
It should work on Linux, and OS X; and with any type of file that fits the filesystem, binary or text. For windows see the notes below.
Should be installable by PyPI (prefered) but there might be packaging issues still.
pip install nodemcu-uploader
nodemcu-uploader
Otherwise clone from github and run directly from there
git clone https://github.com/kmpm/nodemcu-uploader
cd nodemcu-uploader
python ./nodemcu-uploader.py
Note that pip would install pyserial >= 2.7. The terminal command (using miniterm from pyserial) might not work depending on version used. This is a known issue.
There are some significant issues with Windows that might be related to serial port hardware but it can be things like complete hang (you have to kill the python.exe process) to random errors and/or corrupted file transfers.
Create a issue in github, https://github.com/kmpm/nodemcu-uploader/issues
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
###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. Might fail because of Issue #33 - ‘Upload verification breaks if file has «> » in it’
./nodemcu-uploader.py upload init.lua README.md nodemcu-uploader.py --verify=text
Uploading a number of files and verify successful uploading by doing a sha1 checksum. Requires crypto module on the device
./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
To solve «ImportError: No module named serial», install the pyserial module:
python easy_install pyserial
This is almost an implementation of xmodem protocol for the upload part.
SOH, size, data[128]
This gives a total 130 bytes per block.
The block size was decided for…