物联网:ESP模块Wifi Ip地址

Internet of Things : ESP module Wifi Ip address

正如您在标题中看到的那样,我正在制作一个超级简单的 IOT (不是真的)

使用 esp8266 并想让它连接到我的家庭 wifi 网络并在 android 应用程序和模块之间进行通信(android 应用程序连接到家庭 wifi)

注意:我正在使用 CODE VISION AVR

你可能会说:

Why not directly connect to ESP when its on Server Mode?

that's fine cause when ESP is server "he" can set ip for him self so ip will be always same BUT I want it to connect to home wifi

-

Why you wont connect with IP ?

you cant find the module ip easily because its given by Wifi

-

Find ESP ip using IP scanner

Its not possible cause it changes every time and user have to change IP every time in android app AND my app cant scann every time it want to connect to a single device its so dumb...

-

Do a Static Ip for ESP !

well that's not possible too because maybe that IP was taken by someone before ESP send static IP AT command ! + if IP wasent taken it may taken after Home Wifi Restarts !

抱歉英语不好:X

使用 mDNS 响应器:

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino

这样您就可以通过硬编码 url 连接到 ESP8266,例如 http://esp8266.local

您可以使用软件串口从arduino配置esp8266。您需要完全了解设置电路。请记住,esp8266 在 3.3V 下运行,而 arduino 提供 5V 输出。最重要的是给esp8266发送AT命令。您可以使用以下命令连接wifi。

AT+CWJAP="Your_WiFi","password"

如果需要查看esp8266的ip地址,可以使用这个命令

AT+CIFSR

如果你想设置静态ip为esp8266,那么你可以试试这个

AT+CIPSTA="ip module","ip gateway","subnet mask"