更改ESP8266相关路由信息
来源:互联网 发布:润和软件同花顺 编辑:程序博客网 时间:2024/06/06 05:40
前言
ESP8266上电的时候可以通过手机的WIFI看到ESP8266的SSID,但是因为加了密码而连接不上,用户可以通过对ESP8266编程来更改ESP8266的SSID以及密码。
相关数据类型介绍
一、softap_config
结构体原型
struct softap_config { uint8 ssid[32]; uint8 password[64]; uint8 ssid_len; // Note: Recommend to set it according to your ssid uint8 channel; // Note: support 1 ~ 13 AUTH_MODE authmode; // Note: Don't support AUTH_WEP in softAP mode. uint8 ssid_hidden; // Note: default 0 uint8 max_connection; // Note: default 4, max 4 uint16 beacon_interval; // Note: support 100 ~ 60000 ms, default 100};
相关API介绍
一、wifi_softap_get_config
二、wifi_softap_set_config
三、 wifi_softap_set_config_current
相关例程
#include "ets_sys.h"#include "osapi.h"#include "user_interface.h"#include "uart.h"#include "gpio.h"#include "app_socket.h"#include "string.h"void user_init( void ){ struct softap_config config; /** 初始化ESP8266工作模式 */ if ( wifi_get_opmode() != 0x03 ) { wifi_set_opmode( 0x03 ); } /** 获取当前soft-AP配置 */ wifi_softap_get_config( &config ); /** 清零参数 */ os_memset( config.ssid, 0, 32 ); os_memset( config.password, 0, 64 ); /** 写入数据 */ os_memcpy( config.ssid, "SMART_SOCKET_ID", os_strlen( "SMART_SOCKET_ID" ) ); os_memcpy( config.password, "12345678", os_strlen( "12345678" ) ); config.authmode = AUTH_WPA_WPA2_PSK; config.ssid_len = 0; // or its actual length config.beacon_interval = 100; config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most. /** 写入配置 */ wifi_softap_set_config( &config );}
参考资料
[1]. ESP8266Non-OS SDK API参考
0 0
- 更改ESP8266相关路由信息
- TP5 路由相关信息摘记
- esp8266 相关
- esp8266路由模式设置
- 配置ESP8266连上指定的路由
- WiFi-ESP8266入门开发(六)-路由系统
- 路由信息
- 路由相关
- 更改消息路由Command
- Mindmanager保存PDF文件时,作者更改及相关信息更改
- ESP8266
- ESP8266
- 路由信息协议(RIP)
- 路由信息协议(RIP)
- 测路由信息
- 查看路由表信息
- 【backtrack】路由信息收集
- RIP路由信息协议
- MATLAB模拟退火算法模板
- 389. Find the Difference
- wpf DependencyProperty
- 使用idea 搭建SpringMVC+Mybatis
- 2016数学建模国赛五天突击笔记
- 更改ESP8266相关路由信息
- Ubuntu系统下安装VMware
- android各种高级素材(整合)
- 剪草
- Android 中的android.content.Context的机制模式
- Android工作经验之开发技术分享
- iOS_视频后台播放+远程控制
- 【JavaScript】DOM基础
- 找不到或无法加载主类的原因之一