Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mrburnette
#40626
kdfjslkdfjlkfdj wrote:Thanks!

I just tried out the example, are there any online tutorials explaining the main functions of the example code (or more broadly, the libraries themselves)?


A good place to start: https://github.com/esp8266/Arduino#documentation

Note here:
WiFiServer, WiFiClient, and WiFiUDP behave mostly the same way as with WiFi shield library. Four samples are provided for this library. You can see more commands here: http://www.arduino.cc/en/Reference/WiFi
User avatar
By kdfjslkdfjlkfdj
#40965 Hi,

Thanks for the help! I'm only having slight difficulty interpreting what this section of the code does (I'm under the impression that it generates a new server and writes HTML code to it and reads it back as a test- if so, could I just replace the"192.168..." IP address with a website URL of my choice?):
Code: Select allif((WiFiMulti.run() == WL_CONNECTED)) {

        HTTPClient http;

        USE_SERIAL.print("[HTTP] begin...\n");
        // configure traged server and url
        //http.begin("192.168.1.12", 443, "/test.html", true, "7a 9c f4 db 40 d3 62 5a 6e 21 bc 5c cc 66 c8 3e a1 45 59 38"); //HTTPS
        http.begin("192.168.1.12", 80, "/test.html"); //HTTP
     

        USE_SERIAL.print("[HTTP] GET...\n");
        // start connection and send HTTP header
        int httpCode = http.GET();
        if(httpCode) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == 200) {
                String payload = http.getString();
                USE_SERIAL.println(payload);