joeygbsn wrote:Here is some simple udp code to toggle a relay. Both of the esps set up udp servers.
[/code]
Thanks to joeygbsn, the code would be exactely what I need ... but it doesn't work for me.
At first, there is an error in the codebox. The Button-Command and the following two lines need to be written in one line, otherwise there would occur an error.
After correcting that, there was the need (no remember why) to write the if-then-else-endif in separate lines:
if data = 1 then
let data = 0
else
let data = 1
end if
But than there comes a new error in line 14: "Comparaison between string and number!"
Line 14 contains the command "let data = 0".
But also to write al commands related to "data" as a string doesn't work. E.g.:
let data ="1"
With the quotation marks for the value of "data" occurs no error, but the button doesn't do anything else than to become yellow, after pressing it.
No portpin is canging on one of the ESP-Modules.
The hint from Mmiscool in the last posting didn't fix it, but I'm not absolutely sure, where to place this command?
Maybe something in my settings on one ore both ESP's is wrong?
I tryed there many things. Actually I have there nothing else than the IP-adresses (192.168.0.102 for the Master and 192.168.0.109 for the Slave), the Subnet (255.255.255.0), the Gateway (255.255.255.0) and the "Server listening port" is 80.
Of course the Box "Run default.bas at startup" is enabled.
joeygbsn, could it be that the code was tested in not exactely this form?
Or do you have any ideas what may cause the problems?