-->
Page 16 of 19

Re: lhttpd.lua Port to ESP8266

PostPosted: Mon Feb 16, 2015 4:14 pm
by andmpo
You can declare a global variable and use it like:
<?lua print(variable) ?>

Also you may want to call a external script:

<?lua dofile("script.lua") ?>

The variable declared inside the script will be avaible.

Re: lhttpd.lua Port to ESP8266

PostPosted: Fri Feb 27, 2015 10:47 am
by p_r
I made some modifications to the script to support NodeMCU 0.9.5 build 20150213.

New Features:
  • Multiline lua code support (with start-tag "<?lua" and end-tag "?>")
  • Url Parameter (url parameter are in a lua table "get". For example: get["gpio"])

I added some easy examples to the zip.

I have problems with random hard resets when the script is running.
Can anybody confirm that? (maybe there is a problem with my ESP8266 or power supply)

Re: lhttpd.lua Port to ESP8266

PostPosted: Sat Feb 28, 2015 9:29 am
by andmpo
p_r wrote:I made some modifications to the script to support NodeMCU 0.9.5 build 20150213.

New Features:
  • Multiline lua code support (with start-tag "<?lua" and end-tag "?>")
  • Url Parameter (url parameter are in a lua table "get". For example: get["gpio"])

I added some easy examples to the zip.

I have problems with random hard resets when the script is running.
Can anybody confirm that? (maybe there is a problem with my ESP8266 or power supply)


Working fine for me with latest firmware version, no random restarts so far.
Found two problems:
    Anything on the same line before and after <?lua ?> is not sent to the response
    If any query string is sent empty there is an error and a restart

Added code to github with a example form, where you can simulate both erros: https://github.com/andrempo/lhttpd

Re: lhttpd.lua Port to ESP8266

PostPosted: Tue Mar 10, 2015 9:39 am
by Artem Pastukhov
Not working for me with files, larger 2,5k.
https://github.com/nodemcu/nodemcu-firmware/issues/211