I wanted to upload code to my arduino wt32 eth01 but there is an error. I don’t know why it’s showing. Is there more bugs in the code or the rest is fine ? I don’t know if there has to be void main and loop function. The problem is this error nothin else so far. I don’t know what else I should add to this question.
The error:
LocalArduino15packagesesp32hardwareesp322.0.11coresesp32/main.cpp:42: undefined reference to `setup()'
the code:
#ifdef SUPLA_WT32_ETH01_LAN8720
#include "SuplaGuiWt32_eth01.h"
#include "../../SuplaDeviceGUI.h"
namespace Supla {
GUI_WT32_ETH01::GUI_WT32_ETH01(uint8_t ethmode, unsigned char *ip) :
Supla::WT32_ETH01(ethmode, ip) {
}
void GUI_WT32_ETH01::setup() {
if (!ethConfigured) {
ethConfigured = true;
WiFiEventId_t event_gotIP = WiFi.onEvent(
[](WiFiEvent_t event, WiFiEventInfo_t info) {
Serial.print(F("local IP: "));
Serial.println(ETH.localIP());
Serial.print(F("subnetMask: "));
Serial.println(ETH.subnetMask());
Serial.print(F("gatewayIP: "));
Serial.println(ETH.gatewayIP());
Serial.print(F("ETH MAC: "));
Serial.println(ETH.macAddress());
if (ETH.fullDuplex()) {
Serial.print(F("FULL_DUPLEX , "));
}
Serial.print(ETH.linkSpeed());
Serial.println(F("Mbps"));
eth_connected = true;
},
WiFiEvent_t::ARDUINO_EVENT_ETH_GOT_IP); // ESP core 2.0.2
(void)(event_gotIP);
WiFiEventId_t event_disconnected = WiFi.onEvent(
[](WiFiEvent_t event, WiFiEventInfo_t info) {
Serial.println(F("Station disconnected"));
eth_connected = false;
},
WiFiEvent_t::ARDUINO_EVENT_ETH_DISCONNECTED); // ESP core 2.0.2
(void)(event_disconnected);
Serial.println(F("establishing Lan connection"));
ETH.begin(ETH_ADDRESS, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
}
if (mode == Supla::DEVICE_MODE_CONFIG) {
uint8_t mac[6] = {};
WiFi.macAddress(mac);
char macStr[12 + 6] = {};
generateHexString(mac, macStr, 6);
String cstr = "SUPLA-GUI-Generic-";
cstr.reserve(32);
cstr += macStr;
SUPLA_LOG_INFO("WiFi: enter config mode with SSID: "%s"", cstr.c_str());
WiFi.mode(WIFI_MODE_AP);
WiFi.softAP(cstr.c_str(), "", 6);
Supla::GUI::crateWebServer();
}
else if (ConfigManager->get(KEY_ENABLE_GUI)->getValueInt()) {
Supla::GUI::crateWebServer();
}
delay(0);
}
};
#endif