On the ESP, I have this minimal code running:
udpbegin 1234
[init]
let x = udpread()
serialprintln x
if x == "x" then goto [getMeOutOfHere]
goto [init]
[getMeOutOfHere]
wprint "<a href='/'>Menu</a>"
udpstop
end
Now, 2 inexplicable (to me) things happen.
1) The string that I transmit keeps repeating on serial the terminal, till I transmit a new one. At which point the new string keeps repeating.
2) 'x', which I was hoping to act like a terminator, does indeed exit the program. BUT, when I re-run the program, it immediately comes out of the loop having received an 'x', from somewhere. This behavior ceases only after a reset of the ESP. I wonder where it gets the last 'x' from?
I imagine its a matter of flushing variables, but I have no idea how, or where.
Any ideas, guys?