# ### author: O.Artz ### #
# ### ### #
# ### ### #
-# ### UPDATE 2020-07-22 ### #
+# ### UPDATE 2022-19-07 ### #
# ### ### #
#####################################################
ETH MAC: 24:6F:28:1E:C5:57
-IPv4: 192.168.8.64
-Telnet: 192.168.8.64 2323
+IPv4: 192.168.8.NN NN = Labelnumber w/o 2 f.e. 268 -> 68
+Telnet: 192.168.8.68 2323
Visual Status via Board LEDs:
ETH Start -> Green LED blink for 1 sec
//load needed Libaries
#include <ETH.h>
-//#include <WiFi.h>
-//how many clients should be able to telnet to this ESP32
+//number of clients for this telnet server
#define MAX_SRV_CLIENTS 10
WiFiServer server(2323);
//used to check the number every time, cause could changed
volatile static bool eth_connected = false;
-void WiFiEvent(WiFiEvent_t event)
-{
+void WiFiEvent(WiFiEvent_t event) {
switch (event){
case SYSTEM_EVENT_ETH_START:
Serial.println("ETH Started");
}
}
-void setup()
-{
+void setup() {
pinMode(2, OUTPUT); // yellow LED
pinMode(15, OUTPUT); // green LED
Serial.begin(57600);
Serial.println("\nConnecting");
WiFi.onEvent(WiFiEvent);
delay(1000);
- //start UART and the server
+ //start UART and the telnet server
ETH.begin(1,17,23,18,ETH_PHY_LAN8720,ETH_CLOCK_GPIO0_IN);
server.begin();
server.setNoDelay(true);
digitalWrite(15,HIGH);
}
-void loop()
-{
+void loop() {
uint8_t i;
if (eth_connected == true) {
//check if there are any new clients
}
}
}
- /*
- else {
- Serial.println("WiFi not connected!");
- for(i = 0; i < MAX_SRV_CLIENTS; i++) {
- if (serverClients[i]) serverClients[i].stop();
- }
- setup();
- }*/
}