Chat about current Lua tools and IDEs

User avatar
By Markus Gritsch
#6446 ad 1:
* Stripping the indentation whitespace would not yield in a significantly increased speed.
* On the other hand readability when using cat() to list the program would suffer a lot.

ad 2:
* Place myNodeMcu.sublime-build into %APPDATA%\Sublime Text 3\Packages\User
* From the Sublime Text window menu select Tools->Build System->myNodeMcu
* Press F7 to upload.
User avatar
By yes8s
#6454
Markus Gritsch wrote:ad 1:
* Stripping the indentation whitespace would not yield in a significantly increased speed.
* On the other hand readability when using cat() to list the program would suffer a lot.

Ok, I didn't consider this as I previously used a different method to edit and then upload so the cat() would have been somewhat redundant.

Markus Gritsch wrote:ad 2:
* Place myNodeMcu.sublime-build into %APPDATA%\Sublime Text 3\Packages\User
* From the Sublime Text window menu select Tools->Build System->myNodeMcu
* Press F7 to upload.

Great. Thanks. Finally got it working. Had to get latest V3 build for it to work but all good now (was using V2).
User avatar
By 4refr0nt
#12643 Hi, Markus!

You can improve stability and add simple CRC check for uploading files (text and binaries). See my variant (used in latest ESPlorer version).

Code: Select all_uploadBlock=function(n,l,ll)
     local cs = 0
     local i = 0
     uart.on("data", l, function(b)
          i = i + 1
          file.open("test.bin",'a+')
          file.write(b)
          file.close()
          --tmr.wdclr()
          for j=1, l do
               cs = cs + (b:byte(j)*20)%19
          end
          uart.write(0,"~~~CRC-START~~~"..cs.."~~~CRC-END~~~")
          if i == n then
               uart.on("data")
          end
          if i == n-1 then
               _uploadBlock(1,ll,ll)
          end
          end,0)
end
file.remove("test.bin")
_uploadBlock(BlocksNum,BlockSize,LastBlockSize)


More info at ESPlorer source files