- fchao-Sinus-Wechselrichter AliExpress         
Ergebnis 1 bis 10 von 15

Thema: ESP8266 Taucht in DHCP Liste nicht auf?

Baum-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #3
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    45
    Beiträge
    230
    Das Program ist das Beispilprogram WiFiTelnetToSerial
    aber egal weches ich neme wen ich w-lan nutze nicht als AP natürlich

    und verbunden hat er sich ja, ich sehe ihn nur nicht, ich kan daten hin und her senden

    Code:
    /*
      WiFiTelnetToSerial - Example Transparent UART to Telnet Server for ESP8266
    
      Copyright (c) 2015 Hristo Gochkov. All rights reserved.
      This file is part of the ESP8266WiFi library for Arduino environment.
    
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License as published by the Free Software Foundation; either
      version 2.1 of the License, or (at your option) any later version.
    
      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Lesser General Public License for more details.
    
      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    */
    #include <ESP8266WiFi.h>
    
    //how many clients should be able to telnet to this ESP8266
    #define MAX_SRV_CLIENTS 1
    const char* ssid = "mein_wlan_router";
    const char* password = "mein_passwort";
    
    WiFiServer server(23);
    WiFiClient serverClients[MAX_SRV_CLIENTS];
    
    void setup() {
      Serial1.begin(115200);
      WiFi.mode(WIFI_STA);
      WiFi.begin(ssid, password);
      Serial1.print("\nConnecting to "); Serial1.println(ssid);
      uint8_t i = 0;
      while (WiFi.status() != WL_CONNECTED && i++ < 20) {
        delay(500);
      }
      if (i == 21) {
        Serial1.print("Could not connect to"); Serial1.println(ssid);
        while (1) {
          delay(500);
        }
      }
      //start UART and the server
      Serial.begin(115200);
      server.begin();
      server.setNoDelay(true);
    
      Serial1.print("Ready! Use 'telnet ");
      Serial1.print(WiFi.localIP());
      Serial1.println(" 23' to connect");
    }
    
    void loop() {
      uint8_t i;
      //check if there are any new clients
      if (server.hasClient()) {
        for (i = 0; i < MAX_SRV_CLIENTS; i++) {
          //find free/disconnected spot
          if (!serverClients[i] || !serverClients[i].connected()) {
            if (serverClients[i]) {
              serverClients[i].stop();
            }
            serverClients[i] = server.available();
            Serial1.print("New client: "); Serial1.print(i);
            break;
          }
        }
        //no free/disconnected spot so reject
        if (i == MAX_SRV_CLIENTS) {
          WiFiClient serverClient = server.available();
          serverClient.stop();
          Serial1.println("Connection rejected ");
        }
      }
      //check clients for data
      for (i = 0; i < MAX_SRV_CLIENTS; i++) {
        if (serverClients[i] && serverClients[i].connected()) {
          if (serverClients[i].available()) {
            //get data from the telnet client and push it to the UART
            while (serverClients[i].available()) {
              Serial.write(serverClients[i].read());
            }
          }
        }
      }
      //check UART for data
      if (Serial.available()) {
        size_t len = Serial.available();
        uint8_t sbuf[len];
        Serial.readBytes(sbuf, len);
        //push UART data to all connected telnet clients
        for (i = 0; i < MAX_SRV_CLIENTS; i++) {
          if (serverClients[i] && serverClients[i].connected()) {
            serverClients[i].write(sbuf, len);
            delay(1);
          }
        }
      }
    }

    versions nummer 2.4.2 die aktuellste

    Klicke auf die Grafik für eine größere Ansicht

Name:	Neue Bitmap2.jpg
Hits:	8
Größe:	37,1 KB
ID:	33569

    - - - Aktualisiert - - -

    ich benutze das ganz einfache esp01

    Klicke auf die Grafik für eine größere Ansicht

Name:	Unbenannt.jpg
Hits:	4
Größe:	18,7 KB
ID:	33570
    Geändert von Ferdinand (12.08.2018 um 18:06 Uhr)
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

Ähnliche Themen

  1. ESP8266 NodeMcu V3 von Lolin läuft nicht, trotz vieler Versuche
    Von stepbystep im Forum NodeMCU-Board und ESP8266, ESP32-Serie
    Antworten: 2
    Letzter Beitrag: 01.03.2018, 22:45
  2. Liste Elektronikversand
    Von ihle im Forum Suche bestimmtes Bauteil bzw. Empfehlung
    Antworten: 3
    Letzter Beitrag: 10.06.2014, 00:17
  3. Roboter: Open-Source-Roboter Open ROV taucht bis in 100 Meter Tiefe
    Von Roboternetz-News im Forum Neuigkeiten / Technik-News / Nachrichten / Aktuelles
    Antworten: 0
    Letzter Beitrag: 02.07.2012, 13:20
  4. Pinbelegungs Liste
    Von Da_Vinci13 im Forum Microcontroller allgemeine Fragen/Andere Microcontroller
    Antworten: 5
    Letzter Beitrag: 17.01.2009, 16:44
  5. Vierkant taucht in Vierkant ein und kippelt dabei.
    Von konservator im Forum Mechanik
    Antworten: 32
    Letzter Beitrag: 11.12.2007, 09:50

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

fchao-Sinus-Wechselrichter AliExpress