How to control esp2866 using other wifi connection

That cannot possibly be all your code.

If it is then you will need to write some code in your loop(0 function that does the things you want done.

1 Like