2015年4月8日 星期三

NodeMCU - uploader and file module





file module

file.remove
file.open
file.close
file.readline
file.writeline
file.read
file.write
file.flush
file.seek
file.list
file.format
file.rename


nodemcu-uploader.py

A simple tool for uploading files to the filesystem of an ESP8266 running NodeMCU as well as some other useful commands.

Usage


--port and --baud are set to default /dev/ttyUSB0 and 9600 respectively.


mark@mark-laptop:~/nodemcu-uploader-master$ sudo ./nodemcu-uploader.py --port /dev/ttyUSB3 file format
Formating...
file.format()

mark@mark-laptop:~/nodemcu-uploader-master$ sudo ./nodemcu-uploader.py --port /dev/ttyUSB3 upload init.lua
Preparing esp for transfer.
Transfering init.lua as init.lua
All done!

mark@mark-laptop:~/nodemcu-uploader-master$ sudo ./nodemcu-uploader.py --port /dev/ttyUSB3 file list
Listing files
for key,value in pairs(file.list()) do print(key,value) end
init.lua    32
> 

mark@mark-laptop:~/nodemcu-uploader-master$ sudo ./nodemcu-uploader.py --port /dev/ttyUSB3 download init.lua:new.lua
Transfering init.lua to new.lua
All done!


註: 燒錄新版 Firmware後 ,先前所放入的lua file會依然存在,不會被覆蓋,僅nodemcu firmware
被更新....

mark@mark-laptop:~/esptool$ sudo ./esptool.py --port /dev/ttyUSB0 read_mac
Connecting...
MAC: 18:fe:34:9e:99:29
mark@mark-laptop:~/esptool$ sudo ./esptool.py --port /dev/ttyUSB0 flash_id
Connecting...
Manufacturer: ef
Device: 4016

沒有留言:

張貼留言