- Wed May 04, 2016 1:09 pm
#46883
I'm not the best person to be giving such advice, but going on the assumption that for the moment perhaps anything is better than nothing, I'll stick my neck out...
When you are sending info back to the browser, it doesn't usually get sent until the next 'wait' instruction gathers it all up and sends it back. So if you're stuck 'waiting' for something to happen, nothing will actually get sent back until you trigger something like a button event.
I've seen it mentioned somewhere about triggering screen refresh to update dynamic variables, but I found a different simple way around that problem for myself, and perhaps it might also work for your situation.
Basically, set up something like a [screen] branch that the program drops down through after initiallising all the variables etc, and only after that, do any screen writes (html, buttons, textboxes etc), and then the program drops on down to 1 single solitary lone wait instruction where it will inevitably end up waiting. The idea is that any and all program branches don't have their own waits, but instead terminate their subroutine branches with goto [screen], so the program jumps up above all your html and web components which can then be updated with any new data each time after doing a cls, before dropping down to the common wait again. Something along these lines...
let data = "empty"
[screen]
cls
button data [get_new_data]
html "display changing data here " & data
wait
[get_new_data]
let data = "new data"
goto [screen]
If you have a look at the button example I posted here,
http://www.esp8266.com/viewtopic.php?f=45&t=9701you can see that the screen (button) keeps being updated with changing data.
Don't know if it can be adapted to help you, but I don't see why your serial branches shouldn't do similar, so at least it's something you can be trying until you can be better advised by someone with more experience.