Chat about current Lua tools and IDEs

User avatar
By marcelstoer
#60625 TL;DR
There's a new GUI flashing tool for NodeMCU based on esptool.py aimed at Windows users. Self-contained executable (i.e. no installation) available at https://github.com/marcelstoer/nodemcu-pyflasher.

Image

Motivation
This is about an issue the NodeMCU community touched on several times in the past, most recently at
https://github.com/nodemcu/nodemcu-firm ... -247884981.

I stated that based on my experience doing NodeMCU user support it should be a lot simpler to flash NodeMCU for Windows users.
  • A number of flashing tools are available but only two are actively maintained: esptool-ck and esptool.py. Only one is endorsed by Espressif: esptool.py (they hired the developer(s)).
  • 70% of the users of my nodemcu-build.com service are on Windows.
  • BUT Windows doesn't come with Python installed - which is required for esptool.py.
  • BUT Windows users in general are more reluctant to use the CLI than Linux/Mac users - which is required for esptool.py.

To conclude: this is not a comfortable situation for NodeMCU's largest user group.

The plan
For quite a while I planned to write a self-contained GUI tool which would use esptool.py in the background. It should primarily target Windows users but since I'm on Mac it should be cross-platform. Even though I had never used Python before I felt confident to pull this off.

Implementation
  • Uses the cross-platform wxPython GUI framework. I also tried PyForms/PyQt4 but settled for wxPython.
  • Requires absolutely minimal user input.
  • The esptool.py "console" output is redirected to text control on the GUI.
  • Uses PyInstaller to create self-contained executable for Windows and Mac. The packaged app can run standalone i.e. without installing itself, a Python interpreter or any modules.
User avatar
By jankop
#60642 Here is log with wipes

Code: Select allConnecting...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Running Cesanta flasher stub...
Erasing flash (this may take a while)...
Erase took 9.7 seconds
Connecting...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...


Here is log without wipes
Code: Select allConnecting...
Couldn't connect. [<class 'esptool.FatalError'>; Timed out waiting for packet header]. Retrying...
Auto-detected Flash size: 32m
Running Cesanta flasher stub...
Flash params set to 0x0040
Writing 397312 @ 0x0...
Wrote 397312 bytes at 0x0 in 34.6 seconds (91.8 kbit/s)...
Leaving...
Verifying just-written flash...
Verifying 0x60c47 (396359) bytes @ 0x00000000 in flash against C:\DATA\FOR_BACKUP_!!!\COM\ESP8266\LUA\Lua_Firmware\161206_1_5_4_1_m11\nodemcu-master-11-modules-2016-12-06-16-22-27-integer.bin...
-- verify OK (digest matched)


Windows 7/64bit
esp8266 12f + FTDI (without DTR RTS control)
QIO 115200kb/s
integer lua
NodeMCU custom build by frightanic.com
branch: master
commit: ec265a6c21db22640795f190bdcb8a4f014cdced
SSL: false
modules: bit,file,gpio,net,node,pwm,rtcmem,sntp,tmr,uart,wifi
build built on: 2016-12-06 16:21
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
User avatar
By marcelstoer
#60665 @jankop, thanks for testing.

As for the disturbing debug output from esptool.py see https://github.com/marcelstoer/nodemcu-pyflasher#status.
I believe for your ESP8266 you should use DIO rather than QIO?

For serial connection issues my app is last in chain :( The driver and esptool.py do the heavy lifting, the PyFlasher just triggers them.