查看: 1000|回复: 0

【LinkNode D1试用】连接WIFI

[复制链接]
  • TA的每日心情
    奋斗
    2023-7-6 08:48
  • 签到天数: 169 天

    连续签到: 1 天

    [LV.7]常住居民III

    发表于 2016-10-11 14:23:24 | 显示全部楼层 |阅读模式
    分享到:
    上一篇开发板的本地开发环境搭建完成。
    但是这是一个物联网开发板,联网功能是首要的。
    安装wifimanager库

    file:///C:UsersADMINI~1AppDataLocalTempmsohtml11clip_image002.jpg输入如下和程序。
    #include <esp8266wifi.h>          //<a href="https://github.com/esp8266/Arduino">https://github.com/esp8266/Arduino</a>  //needed for library#include <dnsserver.h>#include <esp8266webserver.h>#include <wifimanager.h>         //<a href="https://github.com/tzapu/WiFiManager">https://github.com/tzapu/WiFiManager</a>   void setup() {    // put your setup code here, to run once:    Serial.begin(115200);     //WiFiManager    //Local intialization. Once its business is done, there is no need to keep it around    WiFiManager wifiManager;    //reset saved settings    //wifiManager.resetSettings();     //set custom ip for portal    wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));     //fetches ssid and pass from eeprom and tries to connect    //if it does not connect it starts an access point with the specified name    //here  "AutoConnectAP"    //and goes into a blocking loop awaiting configuration    wifiManager.autoConnect("LinkNodeAP");    //or use this for auto generated name ESP + ChipID    //wifiManager.autoConnect();     //if you get here you have connected to the WiFi    Serial.println("connected... ");} void loop() {    // put your main code here, to run repeatedly:}</wifimanager.h></esp8266webserver.h></dnsserver.h></esp8266wifi.h>下载的开发板
    串口输出

    使用手机登录到开发板产生的热点。

    输入网络地址:10.0.1.1

    选择Configure WiFi,选择一个无线进行连接。
    连接后会有如下的网页

    此时,网络的密码也已经保存了,再次会自动连接上的。
    如果打开发串口,串口会输出你开发板的IP地址的。
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-5-7 23:53 , Processed in 0.119638 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.