GithubHelp home page GithubHelp logo

Comments (6)

FatherPrime avatar FatherPrime commented on June 16, 2024

你的DEMO中为什么设成STA模式之后,esp8266还可以向连接他的设备发送数据呢?
system_restart,好像不是马上就执行,打印信息显示应该是在发送完第三个网页才重启。
实验中我还发现,在user_main中执行完wifi_station_set_auto_connect 之后,打印os_printf("%d",wifi_station_get_connect_status()) 结果返回了255,
QQ图片20190320195314

from makingfunxyz-esp8266.

FatherPrime avatar FatherPrime commented on June 16, 2024

还有一个问题是,B站视频里你的网页是有图片的,不过工程里的html文件好像没体现这点。需要把图片也写到flash里去吗?不过这样读出来好像也没和网页在一起呀。问题有点多, 多多包涵
QQ图片20190320200541

from makingfunxyz-esp8266.

imliubo avatar imliubo commented on June 16, 2024

Hi,
其实这个Demo只是一个简单的Demo,只是演示如何通过网页配置Wi-Fi密码,一些相关的逻辑并没有处理,只写到了获取密码这一步,视频中演示时其实没有让设备重启,这样才可以跳转到第三个网页,望了解(貌似视频中也有说只是简单的获取密码,并没有写获取密码后的处理逻辑)。
可优化点:
1.上电应该先检查是否保存了Wi-Fi名称和密码,如果没有则进入网页配置,有灯提示。(适用于设备第一次上电)
2.按键进入网页配网模式,比如设备更改网络,可以有按键选择进入网页配置模式。(适用于设备更改网络)

整个流程:
上电进入STA模式,尝试连接Wi-Fi,多次或者多少时间连接不成功,进入AP模式开始网页配网,收到密码后保存密码信息,重启,此时还是进入STA模式。

<<<<我昨天直接刷了你github里的的固件之后,可以跳转到第三个页面。但是wifi没连接成功,不知道是不是我连接的是手机热点的问题>>>>
至于您说的Wi-Fi没有连接成功,应该是上电后默认进入了AP模式,可以尝试STA+AP模式,我在Demo中初始化Web Server时,是AP模式,由于上来就是Web Server初始化,所以就进入了AP模式,这就可能导致获取到了密码也没有连接成功,另外那个固件可能不是你看到的代码编译出来的。

<<<<还有个问题是action这里,在电脑上实验的时候,填wifidone.html才会跳转到wifidone,填webconfig.html的话。>>>>
这个你的理解是没错的,其实关系并不大,因为是我们自己在代码中去决定发送哪一个网页,所以都一样。

<<<<你的DEMO中为什么设成STA模式之后,esp8266还可以向连接他的设备发送数据呢?
system_restart,好像不是马上就执行,打印信息显示应该是在发送完第三个网页才重启。>>>>
其实仔细看视频是发现没有重启的,视频中没有说明白,给您造成了困扰不好意思,我这边把视频先下架,修改后再传一下。

<<<<还有一个问题是,B站视频里你的网页是有图片的,不过工程里的html文件好像没体现这点。需要把图片也写到flash里去吗?不过这样读出来好像也没和网页在一起呀。>>>>
这个有机会在细说。

from makingfunxyz-esp8266.

FatherPrime avatar FatherPrime commented on June 16, 2024

感谢博主的认真解答,我再试试获取账号密码之后的处理。

from makingfunxyz-esp8266.

FatherPrime avatar FatherPrime commented on June 16, 2024

不过我感觉wifi_station_auto_connection这个API不太好用。不过只是我的感觉hhh我会继续尝试。
目前我的想法是获取到SSID和PASSWORD之后,发送第三个网页,再进入STA模式,尝试connect,接着重启。在user_init中一开始就进入STA,判断WIFI连接状态,不是成功连接的话就再进入webserver,不过在AP STA间来回切换的时候,手机上已经打开的页面会不会有问题呢?就是跳到别的地方去了之类的。一直保持AP+STA是否可行呢? 再次感谢博主的回复

from makingfunxyz-esp8266.

imliubo avatar imliubo commented on June 16, 2024

Hi,很高兴能帮助到你,您可以参考其它同类功能的产品是如何处理的,其实现在网页配置用的相对少一点,不过您可以继续努力优化。
如果您把这个优化完成了可以提交PR到此仓库,以帮助更多人,如果暂时没有其它问题我这边先Close了。
Have a nice day.

from makingfunxyz-esp8266.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.