Current Lua downloadable firmware will be posted here

User avatar
By Trickuncle
#36535 Ok, you can ignore this topic as far as comments go - I must have failed to reset the module and/or failed to reload the webpage after making comment changes in the past.

Just made a slew of comments with the multi-line syntax and it all just works.

Bottom line: operator error.

Now as far as flashing new code goes, I'm still working on that topic but will post elsewhere if I have any news...
User avatar
By xtal
#36576 the sdk 1.4.0 -- you must use the callback xxx:on("sent", funx)
The SEND function has been changed [ie] fixed.. :o
you do the first send on the xxx:on("receive",funy) c:send ----> will cause 1st call back [CB]
the remainder of c:send thru funx,, you issue the close on the last send ....

>c:on( rcv) ------> 1st c:send (buffer) will generate --> 1st CB
>c:on(sent) ----> 1st CB of several c:send , return --> 2nd of many CB [return exits the function]
>c:on(sent) ----> last CB csend last buffer, c:close()

Getting this working should get the sdk1.4.0 going.......
User avatar
By Trickuncle
#36591 This morning the flashing of a custom bin file worked; I'm at work on a different PC so will try again at home later.

My code still eats the heap however. You had quite a few comments the send function being changed - do I need to change my code to make use of it now?
User avatar
By Trickuncle
#36601 Looks like I found the solution to my heap loss problem. I was sending HTML and javascript from the server and based on sample code I found on the net and closing the connection improperly. My code simply had this line at the bottom:
conn:close()

Apparently, the connection must be queried looking for the 'sent' event and only then close.

Code: Select allconn:on("sent",function(conn) conn:close() end)
conn = nil



Still digging...