ESPlorer icon indicating copy to clipboard operation
ESPlorer copied to clipboard

Thread error when "Save to ESP"

Open tobyliu415 opened this issue 7 years ago • 2 comments

My simple test program in Lua: -------begin--------------- print('tobytest.lua ver 1.0') wifi.setmode(wifi.STATION) -------end-------------------

Termial window displays somthing like following: --------begin---------------------------------------

file.remove("tobytest.lua"); file.open("tobytest.lua","w+"); w = file.writeline; w([==[pr>> int('tobytest.lua ver 1.0')]==]); w([==[wifi.setmode(wifi.STATION)]==]); file.flush();file.close(); dofile("tobytest.lua"); tobytest.lua:2: '=' expected near 'int' stack traceback: [C]: in function 'dofile' stdin:1: in main chunk --------end-------------------------------------------

More information of the problem: in ESPlorer.java line 12994 ------- original code --------------- delay = LineDelay.getValue(); ------- original code end ---------- I found delay is 0 after this line. If I increases delay, the problem will lessen, but won't solved . (Still similar error if the program saving has a very long line.)

tobyliu415 avatar Aug 11 '17 02:08 tobyliu415

Same problem: `> file.remove("i2c_scan.lua");

file.open("i2c_scan.lua","w+"); ).." "]==]); w([==[ else]==]); w([==[ row = row.."-- "]==]); w([==[ end]==]); w([==[ end]==]); w([==[ print(row)]==]); w([==[end]==]); w([==[ ]==]); w([==[return scanner]==]); file.close(); dofile("i2c_scan.lua"); stdin:1: unexpected symbol near ')'`

Source: `local scanner = {}

scanner.pins = { sda = 1, scl = 2 }

scanner.port = 0

scanner.scan = function() print(" 0 1 2 3 4 5 6 7 8 9 a b c d e f")
i2c.setup(scanner.port, scanner.pins['sda'], scanner.pins['scl'], i2c.SLOW)
for addr = 0, 127 do
if addr == 0 or addr % 16 == 0 then if addr ~= 0 then print(row) end row = string.format("%02X", addr)..": " end
i2c.start(scanner.port) c = i2c.address(scanner.port, addr, i2c.TRANSMITTER) i2c.stop(scanner.port) if c == true then row = row..string.format("%02X", addr).." " else row = row.."-- " end end print(row) end

return scanner`

EnochTheWise avatar Sep 27 '17 11:09 EnochTheWise

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 23 '20 16:08 stale[bot]