-->
Page 2 of 19

Re: lhttpd.lua Port to ESP8266

PostPosted: Wed Dec 03, 2014 4:47 am
by alonewolfx2
thank you for sharing. I did some test. firstly it's working with lua request like this :D
Code: Select all<?lua print("Free Ram: "..node.heap().."<br>") print("Chip Id: "..node.chipid()) ?>
or
Code: Select all<?lua if (gpio.read(0) == 1) then print("high"); else print("low"); end ?><br>
   <?lua if (gpio.read(1) == 1) then print("high"); else print("low"); end ?>

but post request not working. and its crashing when wrong file request like " test.html". we need some change.

Re: lhttpd.lua Port to ESP8266

PostPosted: Wed Dec 03, 2014 4:51 am
by gerardwr
alonewolfx2 wrote:thank you for sharing. I did some test. firstly it's working with lua request like this :D
Code: Select all<?lua print("Free Ram: "..node.heap().."<br>") print("Chip Id: "..node.chipid()) ?>
or
Code: Select all<?lua if (gpio.read(0) == 1) then print("high"); else print("low"); end ?><br>
   <?lua if (gpio.read(1) == 1) then print("high"); else print("low"); end ?>

but post request not working. and its crashing when wrong file request like " test.html". we need some change.


That's excellent news!

Will test later today. If this works as expected I will stop development on my own webserver, and continue with the migrated elua code.

How about you?

Re: lhttpd.lua Port to ESP8266

PostPosted: Wed Dec 03, 2014 5:06 am
by alonewolfx2
gerardwr wrote:
alonewolfx2 wrote:thank you for sharing. I did some test. firstly it's working with lua request like this :D
Code: Select all<?lua print("Free Ram: "..node.heap().."<br>") print("Chip Id: "..node.chipid()) ?>
or
Code: Select all<?lua if (gpio.read(0) == 1) then print("high"); else print("low"); end ?><br>
   <?lua if (gpio.read(1) == 1) then print("high"); else print("low"); end ?>

but post request not working. and its crashing when wrong file request like " test.html". we need some change.


That's excellent news!

Will test later today. If this works as expected I will stop development on my own webserver, and continue with the migrated elua code.

How about you?


Agree. My favorite part of the elua webserver is just filename sending to the uart.and can be turned off.
Code: Select all.v,...ZbRS JzD@JStbgz
NodeMcu 0.9.2 build 20141202  powered by Lua 5.1.4
> index.html
index.pht

i think we could continue from elua. Here is to do list
1- Get or Post request handling
2- Adding some security
..

Re: lhttpd.lua Port to ESP8266

PostPosted: Wed Dec 03, 2014 6:13 am
by alonewolfx2
Some more test.
Code: Select all--startup heap and after every request
> @xSG.1.~.LC.   Jzbgf.hbcz
NodeMcu 0.9.2 build 20141202  powered by Lua 5.1.4
> print(node.heap())
9720
> index.pht
print(node.heap())
8912
> index.pht
print(node.heap())
8864
> index.pht
index.pht
print(node.heap())
8720
> index.pht
print(node.heap())
9256
>
--- after a couple file not found
> index.tpl
index.tpl
print(node.heap())
8680
> index.tpl
print(node.heap())
7464
> index.tpl
index.tpl
index.tpl
print(node.heap())
7408
> print(node.heap())
7840
> print(node.heap())
8592
>


it seems heap recovering to fast. and i tried pc with android same time,same page request. but it seems not working with multiple request.