• Latest Posts

    Subscribe my Youtube channel for mere videos

    Sunday 18 June 2017

    Access ESP8266 from any website by IP address - Simple HTML codes




    Now we go on some advance topic is how to access ESP8266 threw any website and send or get data. Such as we know that we can call our ESP Module by it's IP address from any browser, like this we can call ESP from any website also. Provided we need some HTML codes and need to add in your website.

    Fist we discuss about HTML codes and will know how it’s working. In the given HTML codes a input box will present, you can enter your ESP8266 IP address in input box and click on “Get Data” button. You should get a refreshed page and display data that sent by ESP8266.



    ---------------------------------------------------------------------------------------------------------

    <!DOCTYPE html>

    <html>
    <body>

    Enter your device's IP address: <input type="text" id="myText" value="xxx.xxx.xxx.xxx">
    <button onclick="myFunction()">Get Data</button>

    <script>
    function myFunction()
    {
                var x = document.getElementById("myText").value;
                window.location = "http://" + x;
    }
    </script>
    </body>
    </html>

    ---------------------------------------------------------------------------------------------------------



    You can copy codes and paste in Notepad and save as .html format. You can open .html file with your browser, web-page will look like above image in both cases (codes added in website or open .html file with browser).




    Referring to article "ESP8266 wifi module basic" for configuration of ESP8266 module as a server with "Terminal" or "ESP8266 User Program" application. You should follow all of the given AT command step by step except to data transmission AT commands. Data transmission commands will use when any request comes.






    Other Related Articles :-



                                            

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel