ESPlorer
ESPlorer copied to clipboard
Thread error when "Save to ESP"
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.)
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`
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.