Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Janos250

    őstag

    válasz choco01 #8793 üzenetére

    Így?

    #define WEBport yyyyy


    ESP8266WebServer WEBserver ( WEBport );
    vagy ESP32WebServer WEBserver ( WEBport );


    uint8_t ServerIPlocal[4] {192,168,1,140} ; //Node static IP kinek mi
    uint8_t gatewayIPlocal[4] {192,168,1,1} ; // ami neked
    uint8_t subnetIPlocal[4] {255,255,255,0} ;
    const char* ssid = "mySSID";
    const char* password = "1234567890";




    void setup(void) {


    WiFi.begin(ssid, password );
    delay(1000); // min 1000

    WiFi.config(ServerIPlocal, gatewayIPlocal, subnetIPlocal) ;

    delay(1000);


    WEBserver.on("/", handle_index);

    WEBserver.begin();
    } ;

    void handle_index() {

    String s = "<html>\r\n";

    s += "<!DOCTYPE HTML>\r\n";
    s += "<head>\r\n";
    s += "<meta charset=\"UTF-8\">\r\n";
    s += "<title>minta</title>\r\n" ;
    s += "</head>\r\n";
    s += "<body>\r\n";

    .
    .
    .
    .
    .

    s += "</body>\r\n";
    s += "</html>\n";

    WEBserver.send(200, "text/html", s);

    } ;

Új hozzászólás Aktív témák