OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware Reply To: ESP32 port of 2.1.9 firmware

#76002

usydow
Participant

I have a few hardware questions?
I have tested a LAN connection.
Since I still had a board with the LAN8720, this was no problem. The drivers are already present by default. Like in the example code:
https://github.com/espressif/arduino-esp32/blob/f1b06d2a74acdef190ac16e83d48ab619f557e73/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino
Runs without problems! (Testcode)
byte OpenSprinkler::start_network() {
lcd_print_line_clear_pgm(PSTR(“Starting…”), 1);
uint16_t httpport = (uint16_t)(iopts[IOPT_HTTPPORT_1]<<8) + (uint16_t)iopts[IOPT_HTTPPORT_0];

#ifdef ENABLE_DEBUG
#if defined(ESP32)
//DEBUG_PRINTLN(F(“SPIFFS dir:”));
//SPIFFS_list_dir();
DEBUG_PRINTLN(F(“Starting network”));
useEth = false;
WiFi.onEvent(WiFiEvent);
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
delay(1000);
#endif //ESP32
#endif

#if defined(ESP8266) || defined(ESP32)

DEBUG_PRINT(“ETH enabled: “);
DEBUG_PRINTLN(useEth);
DEBUG_PRINT(“Wifi mode: “);
DEBUG_PRINTLN(( get_wifi_mode() == WIFI_MODE_STA ) ? F(“STA”) : F(“AP”));
//start_network_sta(“myssid”,”mypassword”);
// FIXME, just for testing
//::start_server_ap();
Since now relatively many GPIOs are needed for the LAN connection I would control the portexpander via I2C. Or does the 74HC595 have advantages?
What is the encoder needed for?