获取192.168.4.1的请求永远在等待

时间:2016-05-22 10:03:00

标签: get arduino led esp8266

我有这个代码与我

<html>
    <head>
        <title>ESP8266 LED Control</title>
    </head>
    <body>
    <script src="jquery.min.js"></script>
    <!-- in the <button> tags below the ID attribute is the value sent to the arduino -->

    <button id="11" class="led">Toggle Pin 11</button> <!-- button for pin 11 -->
    <button id="12" class="led">Toggle Pin 12</button> <!-- button for pin 12 -->
    <button id="13" class="led" >Toggle Pin 13</button> <!-- button for pin 13 -->


    <script type="text/javascript">


            $(".led").click(function(){
                alert('click fn working');
                var p = $(this).attr('id'); 
                //alert(p);
                // get id value (i.e. pin13, pin12, or pin11)
                // send HTTP GET request to the IP address with the parameter "pin" and value "p", then execute the function
                alert($.get("http://192.168.43.217:80?pin=" + p)); // execute get request
                alert('done')
            });

    </script>
    </body>
</html>

在IP 192.168.4.1的服务器上发送get请求。我有一个设备ARDUINO与ESP8266。

Image link

但是当我点击按钮,并在控制台上看到输出时,它显示待处理

Image link

这可能是背后的原因。我该如何解决这个问题。请帮我。提前谢谢。

0 个答案:

没有答案
相关问题