B4R Question ESP8266 - wifi and socket

Discussion in 'B4R Questions' started by jarda, Jul 19, 2016.

  1. jarda

    jarda Member Licensed User

    Hi All

    I have WiFi ESP8266 modul and I need know:

    WiiFi
    1. How change ESP8266 on mode Wifi client only ?
    2. How change IP assigned DHCP on Static IP ?

    Socket
    3. How change WiífiSocket on Server mode ? /for read and write data/

    This is not in the library :( /ESP8266WiFi, WiFiSocket/

    Thank for ideas :)

    Jarek
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    1. Call ESP8266WiFi.Connect to connect to an existing wifi network.
    2. It is currently not possible.
    3. Not sure that I understand the question. WiFiSocket and WiFiServerSocket are exactly the same as EthernetSocket and EthernetServerSocket.
     
  3. jarda

    jarda Member Licensed User

    Hi Erel

    Thank for answer..

    1. I know how calling connect to ESP8266 STA.. I need switch module to STA only (STA only=6mA standby. This mode AP+STA have 80mA standby). Command in C is WiFi.mode(WIFI_STA);

    2. Ok

    3. I found in WiFIServer.bas example

    Jarek
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can use inline C to call it:
    Code:
    RunNative("SetSTA"Null'this line is inside a Sub

    #if C
    void SetSTA(B4R::Object* o) {
       WiFi.mode(WIFI_STA);
    }
    #end if
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice