Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By anakod
#13807 Debug connection with switching to serial is really very good idea.
TCPServer is abstract class, so you should make you own derived class, and override single method createClient, wich will return single connection instance. Example:
https://github.com/anakod/Sming/blob/ma ... er.cpp#L33

For request time you can use HTTP request and ask it from Google, please look at MeteoControl example, it's very simple:
https://github.com/anakod/Sming/blob/ma ... n.cpp#L159

This example contains web-syncronized clock with web configuration interface (to adjust timezone).
User avatar
By Lawrence_jeff
#13819 That will certainly work for time but it introduces a requirement for internet access your device might not have, whereas NTP is a standard protocol and can run on your internal router or system with very low overhead.

Just something to think about .
User avatar
By hreintke
#13873 LS,
The framework has (for me) a steep initial learning curve : I have trouble getting the "bare tcpserver" working.
Is there (or can someone make) a simple example in wich
- one can initiate by TServer.listen(port).
- accept an incoming tcprequest
- have an onreceive (maybe just call debugf() with the incoming data)
- have an send
- closes when the other side closes the connection
Herman