ItKindaWorks Forum

A forum for everything that Kinda Works YouTube.com/ItKindaWorks

You are not logged in.

Announcement

Welcome to the ItKindaWorks Forum

#1 2018-01-30 20:24:15

stuart
Member
Registered: 2018-01-28
Posts: 6

Relay Control Fixed IP

Hi,

can we Code fixed an ip address onto the ESP-01 instead of Obtain IP automatically? 

Thanks and best regards,

Stu tongue

Offline

#2 2018-01-30 21:32:21

cromer
Administrator
From: internet land
Registered: 2017-12-26
Posts: 89
Website

Re: Relay Control Fixed IP

At the moment ESPHelper doesn't support fixed IP addresses but I could take a look into it. I have a feeling though that the ESP wifi library doesn't have that built in (although that might be outdated info from a long time ago so I could be totally wrong).


Creator of ItKindaWorks

Offline

#3 2018-01-31 06:11:09

stuart
Member
Registered: 2018-01-28
Posts: 6

Re: Relay Control Fixed IP

Thank you so much for yr prompt replied.  I am thinking fixed that thru the router to fixed the IP for a particular ESP-01.  But how or code that we could easily retrieve the mac address on each individual ESP-01?

Offline

#4 2018-01-31 15:12:43

cromer
Administrator
From: internet land
Registered: 2017-12-26
Posts: 89
Website

Re: Relay Control Fixed IP

Ah ok yeah you can always do it via the router and DHCP. To get the MAC address of the ESP you can use "Serial.println(WiFi.macAddress());"

If you put that print statement in your setup code it will print out the MAC address which you can use to configure your router.


Creator of ItKindaWorks

Offline

#5 2018-01-31 20:55:01

refluxologist
Member
Registered: 2018-01-31
Posts: 7

Re: Relay Control Fixed IP

While you can issue a fixed IP from the dhcp server it will not be any gains from it aside from a fixed IP. the arduino is still needs to request and receive the IP even though it will be the same thus burning up cycles/time

The below works for me.

IPAddress ip(192, 168, 11, 23);
IPAddress gateway(192, 168, 11, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 11, 1);
WiFi.config(ip, dns, gateway, subnet);
WiFi.begin(WIFI_AP, WIFI_PASSWORD);

This works on a esp8266 on my network.

Offline

#6 2018-02-01 14:09:39

stuart
Member
Registered: 2018-01-28
Posts: 6

Re: Relay Control Fixed IP

Thanks a lot bro... it works fine for me now.... smile

Offline

Board footer

Powered by FluxBB