Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WiFiClient example #4088

Closed
igrr opened this issue Jan 4, 2018 · 6 comments · Fixed by #5197
Closed

Update WiFiClient example #4088

igrr opened this issue Jan 4, 2018 · 6 comments · Fixed by #5197

Comments

@igrr
Copy link
Member

igrr commented Jan 4, 2018

WiFiClient example shows how to send an HTTP request to Sparkfun Data service. However, this service has been discontinued. Some users attempt to use WiFiClient example as a base when implementing HTTP client functionality, which is suboptimal because there are better libraries for that purpose (ESP8266HTTPClient).

Need to develop a new WiFiClient example which will not use a discontinued service, and would not demonstrate something that is not considered best practice.

One possible solution might be to replace WiFiClient example with WiFiClientBasic. In this case, it has to be extended with instructions on setting up a TCP server (e.g. using a GUI tool like Processing and using something like nc for command line).

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 7, 2018

Why not just making a Quine by reading and printing a small page that we know will live not shorter than the sketch ? This one:

http://raw.githubusercontent.com/esp8266/Arduino/master/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino

...The bad news is github serving https only 😞

@igrr
Copy link
Member Author

igrr commented Jan 7, 2018

That would be a nice example for HTTPClient library.

@dragondaud
Copy link
Contributor

http://www.iana.org/ will always be there... they're the root of DNS. :)

@yoursunny
Copy link
Contributor

Without asking the user to setup a TCP server (it's hard in Windows), there are limited choices for non-HTTP TCP servers.

A drawback is that the ESP8266 cannot send anything, but is receive-only.

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 8, 2018

Then what about a WiFiClientBasic example:

  • sending "hello"
  • reading back data
  • using by default quote of the day (only once, we want the service to stay alive :)
  • having some included comments explaining how to use nc for the sent "hello" to be displayed, for windows and unix

@tablatronix
Copy link
Contributor

Some kind of loopback might be nice then you can see the http in the same code file as you expect to receive from client.

yoursunny added a commit to yoursunny/ESP8266-Arduino that referenced this issue Oct 2, 2018
WiFiClient no longer depends on now-defunct data.sparkfun.com
service, but uses a TCP "quote of the day" service instead.

fixes esp8266#4088
devyte pushed a commit that referenced this issue Oct 11, 2018
WiFiClient no longer depends on now-defunct data.sparkfun.com
service, but uses a TCP "quote of the day" service instead.

fixes #4088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants