Re: lhttpd.lua Port to ESP8266
![Post Post](./styles/FLATBOOTS/imageset/icon_post_target.gif)
Erni wrote:I am wondering it it would be possible to output a variable to serial.
As it is I get the name of the requested page on serial.
I see no possibility in the current code to print a variable to the console.
PRINT statements in embedded Lua scripts are now "printed" to the browser page only. For "printing" to console, you would have to change the server code.
For instance: If you want EVERYTHING that is "printed" to the browser ALSO to print on the console, add "print" lines after lines 48 and 50 in the adamjp source of init.lua, something like this:
Code: Select all
if type == "pht" then
conn:send(line:gsub(tags, docode));
print(line:gsub(tags, docode));
else
conn:send(line);
print(line);
end
NOTE 1 : This might give you more output to the console than you would like!!.
NOTE 2 : Now you will have your own version of init.lua, when adamjp publishes new versions, you will have to adapt to your local changes again.
NOTE 3 : This is GREAT for debugging output to the browser!