-->
Page 1 of 2

Ip adress for AT+ CIPSERVER on arduino ide esp8266_01

PostPosted: Wed Nov 11, 2015 5:31 am
by Atlanta
Hello is there a way to set the ip adress, netmask and gateway manual for the CIPSERVER in the arduino ide.


In lua is it possible with this code:

wifi.setmode(wifi.STATION)
wifi.sta.config("id","pass")
wifi.sta.connect()
wifi.sta.setip({ip="192.168.0.120",netmask="255.255.255.0",gateway="192.168.0.1"})
print("ESP8266 mode is: " .. wifi.getmode())
print("The module MAC address is: " .. wifi.ap.getmac())
print("Config done, IP is "..wifi.sta.getip())

Thanks in advance
Gino

Re: Ip adres for AT+ CIPSERVER on arduino ide esp8266_01

PostPosted: Wed Nov 11, 2015 9:21 am
by martinayotte
Simply use the following functions :

Code: Select allvoid ESP8266WiFiClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet)
void ESP8266WiFiClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns)

Re: Ip adres for AT+ CIPSERVER on arduino ide esp8266_01

PostPosted: Fri Nov 13, 2015 4:50 am
by Atlanta
This code works only if i set the board to "generic esp8266 module" and not with the board "arduino uno r3".
And in my project the esp8266 is connected with the tx and rx to pin 10 and 11 on the arduino uno r3 board for communication.
Then I send the following command from the arduino ide to the esp8266.
AT+CWMODE=1
AT+CIPMUX=1
AT+CWJAP="Login","Pas"
AT+CWJAP?
AT+CIPSERVER=1,8091
AT+CIFSR

and if the esp server recieve the bytes then it send the bytes back to the arduino uno ide.

but sometimes the IP address changes by resetting the board.

Re: Ip adress for AT+ CIPSERVER on arduino ide esp8266_01

PostPosted: Fri Nov 13, 2015 10:37 am
by martinayotte
If you are using the AT firmware, then your question should have been asked in the other sub-forum. Here it is the ArduinoESP sub-forum.
Anyway, the way to set static IP address for AT firmware is using the following command :
Code: Select allAT+CIPSTA="192.168.6.100","192.168.6.1","255.255.255.0"