Post your best Lua script examples here

User avatar
By gerardwr
#4373
Erni wrote:
can you share your version?


Sure here you go.
I realy think we need some kind of version numbering :geek:


I think you are using the 1st version that was shared by adamjp.

AFAIK the latest version is here, that's the one I am using, and the one that's published (as an update) in the 1st message of this topic:
https://github.com/MrAPierce/esp8266/bl ... s/init.lua
User avatar
By yes8s
#4377 More issues... Anybody got any ideas what is causing this?

I can reliably serve a html file (no embedded lua code) over a local network @ 192.168.1.x.

I configured my router to port forwarding to the esp. Now, When I try to access the same page over the web from my mobile network, the browser hangs - it displays nothing.

If I reduce the textual content in the html file from approx 2700 characters to about 1700 chars, it works every time.

There is nothing fancy in this test html file just basic headers, paragraphs and a table. It really appears to be a html file size thing when over the web.

I put debug prints in the web server code and I confirmed that both with local and remote connection I am getting to the end of the conn receive having transmitted all html file text but under remote connection I don't get to the conn sent for some reason.

Baffling...
User avatar
By ThomasW
#4400
yes8s wrote:More issues... Anybody got any ideas what is causing this?

I can reliably serve a html file (no embedded lua code) over a local network @ 192.168.1.x.

I configured my router to port forwarding to the esp. Now, When I try to access the same page over the web from my mobile network, the browser hangs - it displays nothing.

If I reduce the textual content in the html file from approx 2700 characters to about 1700 chars, it works every time.

There is nothing fancy in this test html file just basic headers, paragraphs and a table. It really appears to be a html file size thing when over the web.

I put debug prints in the web server code and I confirmed that both with local and remote connection I am getting to the end of the conn receive having transmitted all html file text but under remote connection I don't get to the conn sent for some reason.

Baffling...

Hi,
Maybe you get different network settings on the forwarded path than locally and the module's tcp buffer overflows (see viewtopic.php?f=18&t=642 - with slightly different symptoms). I tried your code with different filesizes - worked up to ~ 2800 btyes (which results in about 2 packets at the standard MTU of 1500) then the result was garbled. Lowering the MTU to 900 resulted in exactly what you described - no output at all (couldn't even see a response with tcpdump on the wire). I don't see a solution here besides rewriting the code to send packets line by line at the moment :(

Thomas