diff --git a/.github/workflows/target-test.yml b/.github/workflows/target-test.yml index a56c22b47..448add800 100644 --- a/.github/workflows/target-test.yml +++ b/.github/workflows/target-test.yml @@ -56,16 +56,23 @@ jobs: run: | . ${IDF_PATH}/export.sh cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/ - idf.py set-target ${{ matrix.idf_target }} + idf.py set-target ${{ matrix.idf_target }} + echo "Building for default configuration" + idf.py build + rm sdkconfig + echo "Building for sdkconfig.ci.eth_def" cat sdkconfig.ci.eth_def >> sdkconfig.defaults idf.py build - rm sdkconfig.defaults + rm sdkconfig sdkconfig.defaults + echo "Building for sdkconfig.ci.eth_custom_netif" cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults idf.py build - rm sdkconfig.defaults + rm sdkconfig sdkconfig.defaults + echo "Building for sdkconfig.ci.eth_socket" cat sdkconfig.ci.eth_socket >> sdkconfig.defaults idf.py build - rm sdkconfig.defaults + rm sdkconfig sdkconfig.defaults + echo "Building for sdkconfig.ci.eth_no_ipv6" cat sdkconfig.ci.eth_no_ipv6 >> sdkconfig.defaults idf.py build cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/ @@ -154,10 +161,8 @@ jobs: name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} path: components/esp_websocket_client/examples/build/ - name: Install Python packages - env: - PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple" run: | - pip install -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt + pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt - name: Download Example Test to target run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin - name: Run Example Test on target diff --git a/common_components/protocol_examples_common/connect.c b/common_components/protocol_examples_common/connect.c index 85878d78b..08cc348d1 100644 --- a/common_components/protocol_examples_common/connect.c +++ b/common_components/protocol_examples_common/connect.c @@ -396,7 +396,9 @@ static esp_netif_t *eth_start(void) #endif #elif CONFIG_EXAMPLE_USE_SPI_ETHERNET gpio_install_isr_service(0); +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) spi_device_handle_t spi_handle = NULL; +#endif spi_bus_config_t buscfg = { .miso_io_num = CONFIG_EXAMPLE_ETH_SPI_MISO_GPIO, .mosi_io_num = CONFIG_EXAMPLE_ETH_SPI_MOSI_GPIO, @@ -414,9 +416,14 @@ static esp_netif_t *eth_start(void) .spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO, .queue_size = 20 }; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle)); /* dm9051 ethernet driver is based on spi driver */ eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(spi_handle); +#else + eth_dm9051_config_t dm9051_config = ETH_DM9051_DEFAULT_CONFIG(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg); +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) + dm9051_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO; s_mac = esp_eth_mac_new_dm9051(&dm9051_config, &mac_config); s_phy = esp_eth_phy_new_dm9051(&phy_config); @@ -429,9 +436,13 @@ static esp_netif_t *eth_start(void) .spics_io_num = CONFIG_EXAMPLE_ETH_SPI_CS_GPIO, .queue_size = 20 }; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) ESP_ERROR_CHECK(spi_bus_add_device(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg, &spi_handle)); /* w5500 ethernet driver is based on spi driver */ eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(spi_handle); +#else + eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(CONFIG_EXAMPLE_ETH_SPI_HOST, &devcfg); +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) w5500_config.int_gpio_num = CONFIG_EXAMPLE_ETH_SPI_INT_GPIO; s_mac = esp_eth_mac_new_w5500(&w5500_config, &mac_config); s_phy = esp_eth_phy_new_w5500(&phy_config); diff --git a/components/mdns/examples/main/mdns_example_main.c b/components/mdns/examples/main/mdns_example_main.c index da0cbe53b..a3f2cb272 100644 --- a/components/mdns/examples/main/mdns_example_main.c +++ b/components/mdns/examples/main/mdns_example_main.c @@ -332,10 +332,15 @@ static void query_mdns_host_with_getaddrinfo(char * host) if (!getaddrinfo(host, NULL, &hints, &res)) { while (res) { - ESP_LOGI(TAG, "getaddrinfo: %s resolved to: %s", host, - res->ai_family == AF_INET? - inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr): - inet_ntoa(((struct sockaddr_in6 *) res->ai_addr)->sin6_addr)); + char *resolved_addr; +#if CONFIG_LWIP_IPV6 + resolved_addr = res->ai_family == AF_INET ? + inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr) : + inet_ntoa(((struct sockaddr_in6 *) res->ai_addr)->sin6_addr); +#else + resolved_addr = inet_ntoa(((struct sockaddr_in *) res->ai_addr)->sin_addr); +#endif // CONFIG_LWIP_IPV6 + ESP_LOGI(TAG, "getaddrinfo: %s resolved to: %s", host, resolved_addr); res = res->ai_next; } } diff --git a/components/mdns/examples/sdkconfig.ci.eth_no_ipv6 b/components/mdns/examples/sdkconfig.ci.eth_no_ipv6 index 42f26f6ba..d669ec075 100644 --- a/components/mdns/examples/sdkconfig.ci.eth_no_ipv6 +++ b/components/mdns/examples/sdkconfig.ci.eth_no_ipv6 @@ -4,6 +4,7 @@ CONFIG_MDNS_ADD_MAC_TO_HOSTNAME=y CONFIG_MDNS_PUBLISH_DELEGATE_HOST=y CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y CONFIG_LWIP_IPV6=n +CONFIG_EXAMPLE_CONNECT_IPV6=n CONFIG_EXAMPLE_CONNECT_ETHERNET=y CONFIG_EXAMPLE_CONNECT_WIFI=n CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y diff --git a/components/mdns/idf_component.yml b/components/mdns/idf_component.yml index 53538f8d3..8e00d840c 100644 --- a/components/mdns/idf_component.yml +++ b/components/mdns/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.6" +version: "1.0.7" description: mDNS dependencies: idf: diff --git a/components/mdns/mdns_networking_lwip.c b/components/mdns/mdns_networking_lwip.c index f600ada25..dbbc11bb9 100644 --- a/components/mdns/mdns_networking_lwip.c +++ b/components/mdns/mdns_networking_lwip.c @@ -343,7 +343,7 @@ size_t _mdns_udp_pcb_write(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, c ip_add_copy.type = ip->type; memcpy(&(ip_add_copy.u_addr), &(ip->u_addr), sizeof(ip_add_copy.u_addr)); #else - memcpy(&(ip_add_copy.addr), &(ip->u_addr), sizeof(ip_addr_copy.addr)); + memcpy(&(ip_add_copy.addr), &(ip->u_addr), sizeof(ip_add_copy.addr)); #endif // CONFIG_LWIP_IPV6 mdns_api_call_t msg = {