HTTP Command to ESPEasy on Sonoff

I recently figured this out from a Photon to a smart switch with Tasmota.
I use TCPclient and start the connection with:
Client.connect(ClientAddress, Switches_PORT);

The on command looks like this:

Client.println("GET /cm?cmnd=Power%20on HTTP/1.1");
Client.println();

The ESPEasy command may be slightly different. The " /" after GET is important.
The blank linefeed makes the response faster. I don’t know enough to understand why.

Now I’m trying to figure out how to read the response from the switch.
I hope this helps.

PS: This post was useful to me.
PPS:
I learned the blank linefeed ends the request message and tells the server to process it.
There is more to it (body of request, etc.), but without that line the server has to wait for timeout before proceeding.

1 Like