Current Lua downloadable firmware will be posted here

User avatar
By AdrianM
#41027
xtal wrote:if using nodemcu after 0.9.6 use the Call Back's
Send 1
CB send 2
CB send x
CB close


I think this is meant to show how the "on sent" callback (CB in xtal's shorthand) can be used to continue the outgoing message, be that the content of a webpage that's being sent or (maybe?)any POST, GET etc. header that's more convenient to break into pieces.

Of course this means keeping track of where in your message you are. I think it makes sense for sending relatively large amounts of data e.g. static webpages from file in chunks (where a file pointer is maintained). But for sending requests or small dynamic web pages created on the fly, I'd suggest just doing LUA string concatenation and sending a single string.
User avatar
By xtal
#41031 A single send with a max of 1459 char, I think 1460 gives error or crashes with no info.....
you may still need to wait for Callback to send.close()

I just us a simple counter which is incremented after each send...

I put my webpage into flash to save RAM,,this works great , However it introduce a serial Rx problem for me , I need to Rx a 700 byte block of data , and now drop data, this did not happen when wpage was in RAM, slowing baud from 38400 to 9600 helped, but still fails, the serial buffer is apparently 256 bytes and cannot be changed , unless you build your own firmware. Blocks less than 256 work fine......
This is for FirmWare after 0.9.6 ? 1.4.0 and 1.5.x

The code I previously has the Wpage in FLASH the counter is Scnt
The 1st send is sent as a result of Recieve , the remaing sends are a result of Call backs