-->
Page 2 of 4

Re: Newbee: Very general question wrt iot usage of the esp

PostPosted: Thu Jan 07, 2016 4:27 pm
by martinayotte
I think the nearest skeleton to start with would be the WifiClient example found in libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
The main difference would be that you send you TCP shell commands (since it is some kind of Telnet) instead of sending an URL like it is currently in the example.
On your server, you would have some python scripts which will play role of TCP Server. Such example can be found at https://docs.python.org/2/library/socketserver.html , section "20.17.4.1. SocketServer.TCPServer Example"

Re: Newbee: Very general question wrt iot usage of the esp

PostPosted: Fri Jan 08, 2016 4:29 am
by Arduolli
Hi martinayotte;
thanks again for your hints and help.
I found your quoted resources - still a lot to learn ...
(I have some experience with Arduino programming, but the entire network stuff is new to me.)

Can you lead me further?
Which TCP shell / Telnet commands are you referring to which could be used within the ESP8266WiFi library?
In the github docs they refer to the WiFi library for the instruction set. In there I do not see specific TCP commands.
Would I use something like 'client.write(data)' or 'client.print(data)'?

Thanks again,
Heiner

P.S. I am still waiting for my ordered ESP's, so I can not just try it out as of now.....

Re: Newbee: Very general question wrt iot usage of the esp

PostPosted: Fri Jan 08, 2016 9:44 am
by martinayotte
Since I was suggesting to replace URL by a TCP shell commands, I mean commands dedicated to you application, so you need to define the protocol by yourself.
It can be for example :
Code: Select allsensor1=75F
switch4=true

Then, you TCP server will react according to those ...

Re: Newbee: Very general question wrt iot usage of the esp

PostPosted: Fri Jan 08, 2016 4:26 pm
by Arduolli
martinayotte wrote:Since I was suggesting to replace URL by a TCP shell commands, I mean commands dedicated to you application, so you need to define the protocol by yourself.
It can be for example :
Code: Select allsensor1=75F
switch4=true

Then, you TCP server will react according to those ...


Thanks again for your reply.
First, I though I don't get it: How would I make the system 'send' these states (i.e. switch4=true) to the server?
But now I see that
Code: Select allclient.print()
is used in the example and your above code is in fact an example on what to send....
Thanks again!
Now I eagerly await my ESPs to see, if I can get this working....