ESPT66的WiFi盾牌版本由WangTongze连接到arduino UNO

问题描述 投票:1回答:1

对不起,我的英语不好。

我和Shield和Arduino UNO之间的通信有问题。这些是图像:

Arduino UNO

Wifi Shield

FTDI FT232RL

Wifi shield使用FTDI程序员与Arduino IDE进行通信。引脚已正确连接。当我想在屏蔽上添加代码时,“红色小盒子”上的引脚分别是1-DOWN,2-DOWN,3-UP,4-UP,所以一切都还好。当我使用Arduino IDE中的Wifi AP示例(文件 - >示例 - > ESP8266WiFi - > WifiAccesPoint)并将其上传到WiFiShield时,我可以在手机上看到WiFi网络。这是代码:

/*
 * Copyright (c) 2015, Majenko Technologies
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 * 
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 * 
 * * Redistributions in binary form must reproduce the above copyright notice, this
 *   list of conditions and the following disclaimer in the documentation and/or
 *   other materials provided with the distribution.
 * 
 * * Neither the name of Majenko Technologies nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* Create a WiFi access point and provide a web server on it. */

#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>

/* Set these to your desired credentials. */
const char *ssid = "WiFiName";
const char *password = "WiFiPassword";

ESP8266WebServer server(80);

/* Just a little test message.  Go to http://192.168.4.1 in a web browser
 * connected to this access point to see it.
 */
void handleRoot() {
    server.send(200, "text/html", "<h1>Hello world!</h1>");
}

void toggle()
{
  Serial.println("Click");
  server.send(200, "text/html", "<button><a href=\"toggle\" button style=\"height:200px;width:200px\">Button Text</a></button>");
}

void setup() {
    delay(1000);
    Serial.begin(115200);
    Serial.println();
    Serial.print("Configuring access point...");
    /* You can remove the password parameter if you want the AP to be open. */
    WiFi.softAP(ssid, password);

    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);
    server.on("/", handleRoot);
  server.on("/toggle",toggle);
    server.begin();
    Serial.println("HTTP server started");
}

void loop() {
    server.handleClient();
}

有一张照片来自手机:enter image description here

当我按下按钮时,我可以从Arduino IDE的串行监视器中看到来自WebPage的消息,说明:“点击”

enter image description here

现在,存在大问题。当我将屏蔽连接到Arduino时,wifi网络仍然可见,我可以按下按钮,因为FTDI始终与USB COM10通信(在我的情况下)。

enter image description here

然后,当我将Arduino UNO连接到USB端口时,wifi网络仍处于活动状态。

enter image description here

但是当我使用FTDI与USB断开使用Wifishield通信时,仍然连接了Arduino UNO电缆,WiFi网络消失了。

enter image description here

所以,我只想将Arduino UNO连接到usb Arduino IDE,我想看到用wifi屏蔽创建的wifi网络可见。然后它将始终可见(同样当wifishield断开连接时,只连接UNO)我希望它发送消息,在这种情况下消息“Click”到Arduino UNO串行监视器。有任何想法吗?非常感谢你!

wifi arduino-uno arduino-esp8266
1个回答
1
投票

我想你应该检查你的电缆,两个端口:ard Tx,Rx - usb Tx,Rx

© www.soinside.com 2019 - 2024. All rights reserved.