static IP addres on ESP8266-12F

Posted on
  • Hi,

    Could you please help us to find the right answer:

    • how to set static IP address/mask/gateway? We are using Espruino WebIDE and testing ESP8266 ESP-12F.

    // over a weeks and on many forums we still not able to find this solution...

    Thank you! Michael

  • When used as an access point the IP is always 192.168.4.1. You can't change it AFAIK.

    When used as a station connected to an access point, I've found creating a reserved IP on the router, based on the MAC address, to be convenient. ESP8266 will always be assigned the same IP - efectively 'static' IP when it connects.

  • Here's another way Using Bonjour to find the IP dynamic address.
    It works with an ESP8266 connected via serial to a Pico or original Espruino.
    Does not currently work on an ESP8266 running Espruino, it would require a recompile of the firmware.
    http://forum.espruino.com/conversations/­293972/

  • hmm, in times of dhcp there is no need for a static ip - or is there something I am missing ?

    In station mode the ESPs use a host name like ESP_< last three octets of the mac >, so you can use that name to ping

    ping esp_113532
    PING esp_113532 (192.168.194.131): 56 data bytes
    64 bytes from 192.168.194.131: icmp_seq=0 ttl=128 time=2.189 ms
    
    

    or to connect with WEB IDE


    1 Attachment

    • Bildschirmfoto 2016-12-05 um 19.16.52.JPG
  • Thanks to everybody!

    Let me clarify our problem on the example with one ESP12F. Our device has active Access Point and we need just to set them IP = 192.168.5.1.

    To be more clear, every other device in our solution should have proprietary IP, for example 192.168.SN.1 (where SN is serial number of the device).

    How to get it?

  • PING esp_113532 (192.168.194.131): 56 data bytes

    it seems, we are near of what we need..

    • what is esp_113532? is it Access Point?

    • how did you reach .194. in the middle of IP address?

  • I use the ESP in station mode and 192.168.194.0 is my local network

    use this to get the full mac for ap and station:

    >var Wifi = require("Wifi");
    =function () { [native code] }
    >Wifi.getAPIP();
    ={
      "ip": "0.0.0.0",
      "netmask": "0.0.0.0",
      "gw": "0.0.0.0",
      "mac": "5e:cf:7f:11:35:32"
     }
    >Wifi.getIP();
    ={
      "ip": "192.168.194.131",
      "netmask": "255.255.255.0",
      "gw": "192.168.194.1",
      "mac": "5c:cf:7f:11:35:32"
     }
    > 
    

    as @Ollie said, in AP mode the ip is always 192.168.4.1 and the SSID is always ESP_< last three octets of the mac >

    >Wifi.getAPDetails();
    ={
      "status": "disabled",
      "authMode": "open",
      "hidden": false, "maxConn": 4,
      "ssid": "ESP_113532",
      "password": "",
      "savedSsid": null }
    
  • Thank you, I got it...

    finally, I have found ESP8266 AT Instruction, where AT+CIPAPSet IP address of ESP8266 softAP

    • I hope, here solution could be found... Isn't it?... What is Yours thoughts?

    I will try to set IP address in pure module and after that flash Espruino firmware...

  • I don't think that will help you. Your firmware flash of Espruino will likely replace the Expressif AT command set firmware, and even if it didn't, Espruino would not make reference to it.

    Maybe Espruino could be built to use a different AP IP address? I don't know if possible, but if it is possible, it will be in the espruino source code not the compiled binary. You should ask some questions in the Espruino gitter channel (https://gitter.im/espruino/Espruino) where the folk who know more about the ESP8266 port can often be found.

  • Thanks, Ollie. I saw gitter channel and spent several hours in there trying to fund something helpful. I will write there my question

    btw, I have found discussion about Static IP here. Unfortunately, I did not see result. Can your team re-open issue and release draft version? I would like to test it!

  • We're not a team as such, just a community who jump in and out as time permits. You're absolutely welcome to ask your question in Gitter - or jump on the Github issue you linked - both are for everyone. I'm sure the people familiar with the C aspects of Espruino and the ESP8266 port in particular (which I am not) will answer your question on current state and any likely future state re static IP addresses.

  • many thanks to everybody who gave me attention and answered to me! I need to learn technology how to build and flash firmware...

  • Great to hear you've found a way forwards. Please share your builds.

  • Would it be useful to set a DHCP hostname instead?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

static IP addres on ESP8266-12F

Posted by Avatar for MSol @MSol

Actions