This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* No more python 2.7 * Targeting SDK 3.0 releases of NodeMCU
- Loading branch information
Showing
17 changed files
with
374 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,9 @@ themselves that are having issues. | |
Call for maintainers | ||
-------------------- | ||
Hi, | ||
This project is in need of maintenance and I (kmpm) do not have the time the project deserves. | ||
Look at https://github.com/kmpm/nodemcu-uploader/issues/90 for more information on what to do about it. | ||
This project is in need of maintenance and I (kmpm) do not have the time the | ||
project deserves. Look at https://github.com/kmpm/nodemcu-uploader/issues/90 | ||
for more information on what to do about it or email [email protected] | ||
|
||
|
||
Installation | ||
|
@@ -52,9 +53,11 @@ python easy_install pyserial | |
|
||
Usage | ||
----- | ||
Download NodeMCU firmware from http://nodemcu-build.com/ . | ||
|
||
Since version v0.4.0 of the tool you will need a recent (june/july 2016) version | ||
of the firmware for nodemcu. The default baudrate was changed in firmware from | ||
9600 to 115200 and this tool was changed as well. Download from http://nodemcu-build.com/ . | ||
9600 to 115200 and this tool was changed as well. | ||
|
||
If you are using an older firmware you MUST use the option `--start-baud 9600` | ||
to the device to be recognized. Otherwise you will get a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
# Copyright (C) 2015-2019 Peter Magnusson <[email protected]> | ||
# pylint: disable=C0301 | ||
# flake8: noqa | ||
|
||
|
||
LUA_FUNCTIONS = ['recv_block', 'recv_name', 'recv', 'shafile', 'send_block', 'send_file', 'send'] | ||
|
@@ -12,29 +13,27 @@ | |
|
||
PRINT_FILE = "file.open('{filename}') print('---{filename}---') print(file.read()) file.close() print('---')" | ||
|
||
INFO_GROUP = "for key,value in pairs(node.info('{group}')) do k=tostring(key) print(k .. string.rep(' ', 20 - #k), tostring(value)) end" | ||
|
||
LIST_FILES = 'for key,value in pairs(file.list()) do print(key,value) end' | ||
#NUL = \000, ACK = \006 | ||
# NUL = \000, ACK = \006 | ||
RECV_LUA = \ | ||
r""" | ||
function recv_block(d) | ||
if string.byte(d, 1) == 1 then | ||
size = string.byte(d, 2) | ||
uart.write(0,'\006') | ||
if size > 0 then | ||
file.write(string.sub(d, 3, 3+size-1)) | ||
else | ||
file.close() | ||
uart.on('data') | ||
function recv() | ||
local on,w,ack,nack=uart.on,uart.write,'\6','\21' | ||
local fd | ||
local function recv_block(d) | ||
local t,l = d:byte(1,2) | ||
if t ~= 1 then w(0, nack); fd:close(); return on('data') end | ||
if l >= 0 then fd:write(d:sub(3, l+2)); end | ||
if l == 0 then fd:close(); w(0, ack); return on('data') else w(0, ack) end | ||
end | ||
else | ||
uart.write(0, '\021' .. d) | ||
uart.on('data') | ||
local function recv_name(d) d = d:gsub('%z.*', '') file.remove(d) fd=file.open(d, 'w') on('data', 130, recv_block, 0) w(0, ack) end | ||
on('data', '\0', recv_name, 0) | ||
w(0, 'C') | ||
end | ||
end | ||
function recv_name(d) d = d:gsub('%z.*', '') file.remove(d) file.open(d, 'w') uart.on('data', 130, recv_block, 0) uart.write(0, '\006') end | ||
function recv() uart.on('data', '\000', recv_name, 0) uart.write(0, 'C') end | ||
function shafile(f) print(crypto.toHex(crypto.fhash('sha1', f))) end | ||
""" | ||
""" # noqa: E122 | ||
|
||
SEND_LUA = \ | ||
r""" | ||
|
@@ -49,3 +48,7 @@ | |
""" | ||
|
||
UART_SETUP = 'uart.setup(0,{baud},8,0,1,1)' | ||
|
||
REMOVE_ALL_FILES = r""" | ||
for key,value in pairs(file.list()) do file.remove(key) end | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.