Post your best Lua script examples here

User avatar
By gerardwr
#3385
alonewolfx2 wrote:its cool :) I did not know we could send html files directly. i think we can gpio operations or pwm on the webserver. right?


Most likely.

Reading the GPIO's is in the "homepage", so that's no problem. Setting GPIO's and PWM should also be no problem when the execution of the .lua files is implemented.

Re. the missing header file. I'm lazy, I use Safari on Mac, that Works. You have tested on IE, that works too!?
I know that I send only minimal HTML, maybe I'll correct that when I have much time, or when there is more interest in the web server.

Keep the comments coming, please!
User avatar
By alonewolfx2
#3387 firstly i tested on the chrome. first page worked but i saw black backround when i click other pages. and i tried ie :)
i attached edited webserver.lua file :)
Attachments
(2.01 KiB) Downloaded 667 times
User avatar
By alonewolfx2
#3394 tadaa :) it crashed with tcp request :D

Code: Select allGET / TCP\r\n\r\n

PANIC: unprotected error in call to Lua API (webserver.lua:23: attempt to concatenate global 's' (a nil value))
PANIC: unprotected error in call to Lua API (attempt to concatenate a userdata value)
PANIC: unprotected error in call to Lua API (attempt to call a string value)
L(Ccd...D.Krh!
K^@bcz. ].;QaHN|.K@`. <kS.C.6Zb