Current Lua downloadable firmware will be posted here

User avatar
By alonewolfx2
#2518 Can i write auto data send script on the web :)
cendev wrote:init.lua is running at the startup and you can edit that :) so yes, you can i guess :)

looks nice :) just gave it a small try and all looks fine :) looks like a piece of art since now :) haven't try the gpio :) timer also perfect :)

edit : Yes, you can create your own scripts and call them via dofile or use init.lua :)
User avatar
By cendev
#2519 you were the first person that came to my mind alonewolf :D

give me a few mins and i'll inform you but i'm pretty sure yep =)


Yes my friend we can :)

not exactly what i did but these may give an idea i guess :D don't laugh too hard for the codes , i was tryin to reach the end as fast as i could :D

first time connection to network is not included :) as you know the module remembers that after the first time and autoconnects to network.
the example below is the dumbest way to do that :D so try not to laugh or curse :D (it doesnt check for ip or connection but waits for 10 secs and creates the socket :D )

steps i remember :D

i created a file via :
file.open("name.lua","w+")
file.writeline([[sk=net.createConnection(net.TCP, false) sk:on("receive", function(sck, c) print(c) end ) sk:connect(15,"192.168.1.2") sk:send("l100")]])
file.close()


and then i edited my init.lua
file.open("init.lua","w+")
file.writeline([[tmr.alarm(10000, 0, function() dofile("name.lua") end )]])
file.close()

after restarting the node , 10 secs later it connected to my server and sent the message :)
User avatar
By scargill
#2521 I've only had a quick look so I cannot vouch for now well this works but I noted 2 things (yup, the BIN file blows onto an ESP-01 board no problem) - I can't see any way to change the baud rate.. and if I run the init or power up I firstly get some unintelligible stuf.. hten "lua: cannot open init.lua" - from there on in it seems ok. It's going to take some reading of the doc files to get to grips with this.