Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Atlanta
#33687 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
Last edited by Atlanta on Fri Nov 13, 2015 6:21 am, edited 1 time in total.
User avatar
By Atlanta
#33837 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.
User avatar
By martinayotte
#33862 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"