Chat freely about anything...

User avatar
By picstart1
#2272 I'm working with a PIC MCU and interfacing via the AT commands. The esp connects to the AP and gets assigned an IP. The server a PC program receives via the PIC MCU esp8266 interface a unique device ID and a list of capabilities switches leds the PIC is controlling. The server maintains a cross reference table between the PIC MCU devices and the IP's they were assigned by the IP.
The other way of assigning at the AP a fixed IP based on the unique MAC each esp chip has is also another work around. It was more obvious in my case to have the PIC MCU send a couple of bytes describing what it can do and the current state of leds and switches. It isn't the best of solutions...the server normally is the slave and the esp the client is master...here the client reports its data to the server and obeys commands sent from the server. The server allows an android to connect and will relay data about device (PIC MCU) states to it and also relay commands.
Using the esp as a server didn't look like a good fit since that would mean multiple 10 or more servers each with their own switches leds to control.
The human readable and async AT commands have been a real pain with several hundred lines of code and several timers just to turn the AT into a bullet proof interface. As soon as a synchronous interface is working for the esp8266 ;the AT commands will be in the rear view mirror. Further once the esp8266 MCU tool chain is working cutting out the AT stuff at the source and replacing it with a synchronous interface with robust commands that are Acked or Nacked by any attached CPU.
User avatar
By phil31
#2279
saper_2 wrote:Unfortunately there is no way to set static IP on original firmware, you can get ip by DHCP only (you can set-up your router/dhcp server to assign always same ip for esp mac - to get mac, check in your router for assigned ip).

At this moment, even adding custom AT command to setup static IP is practically impossible, because ESP sdk does not have even routines to do it.

Edit: fixed some typos


i've got a reply from Espressif support : we can assign a static IP only by recompiling the firmware ! :(

The IP of the module come from my DHCP server. But I would like to set up a static IP.

Code: Select all  wifi_set_ip_info, please call it in user_init.

Example:

    {
struct ip_info info;

IP4_ADDR(&info.ip, 10, 10, 10, 1);
IP4_ADDR(&info.gw, 10, 10, 10, 1);
IP4_ADDR(&info.netmask, 255, 255, 255, 0);
wifi_set_ip_info(SOFTAP_IF, &info);
}
User avatar
By alonewolfx2
#2294 Can you ask one question. does esp8266 has any ssid hide options or functions?

phil31 wrote:i've got a reply from Espressif support : we can assign a static IP only by recompiling the firmware ! :(