Azrideus
Azrideus

Reputation: 85

Internet of Things : ESP module Wifi Ip address

as you can read in title I'm making a super simple IOT (Not really)

and

using a esp8266 and want to make it connect to my home wifi network and make a communication between a android app and the module (android app connects to home wifi)

Note : Iam Using CODE VISION AVR

you may say :

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 !

Sorry for bad English :X

Upvotes: 1

Views: 805

Answers (2)

Abdul Alim Shakir
Abdul Alim Shakir

Reputation: 1227

You can use software serial to configure esp8266 from arduino. You need to know the setup circuit perfectly. Keep it in mind that esp8266 operates on 3.3V where arduino gives 5V output. The most important thing is to send AT commands to esp8266. You can use the following command to connect with your wifi.

AT+CWJAP="Your_WiFi","password"

If you need to see the ip address of esp8266, you can use this command.

AT+CIFSR

If you want to set static ip to esp8266 , then you can try this one.

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

Upvotes: 2

Defozo
Defozo

Reputation: 3092

Use mDNS responder:

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

This way you would be able to connect to ESP8266 via hardcoded url like http://esp8266.local.

Upvotes: 0

Related Questions