More UDP woes
Posted: Sat May 21, 2016 8:39 am
I'm trying to understand the exchange of simple data over UDP. I'm running a UDP sender on my Android, and manually send random strings thru it.
On the ESP, I have this minimal code running:
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?
On the ESP, I have this minimal code running:
Code: Select all
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?