har-in-air/ESP32_IMU_BARO_GPS_VARIO

building error: conversion from 'const ip_addr_t* {aka const ip_addr*}' to non-scalar type 'ip_addr_t {aka ip_addr}'

qubolino opened this issue · 2 comments

i am trying to build the software and end up with:
arduino/libraries/WiFi/src/ETH.cpp:196:37: error: conversion from 'const ip_addr_t* {aka const ip_addr*}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested
i am running out of ideas.

so far i have done the following:
i) install esp-idf

git clone -b v3.3.2 --recursive https://github.com/espressif/esp-idf.git
export IDF_PATH=~/lab/esp-idf
cd esp-idf
python -m pip install --user -r $IDF_PATH/requirements.txt
./install.sh
. ./export.sh

after which i get

Adding ESP-IDF tools to PATH...
Checking if Python packages are up to date...
Python requirements from /Users/qubo/labs/esp-idf/requirements.txt are satisfied.
Added the following directories to PATH:
  /Users/qubo/labs/esp-idf/components/esptool_py/esptool
  /Users/qubo/labs/esp-idf/components/espcoredump
  /Users/qubo/labs/esp-idf/components/partition_table/
  /Users/qubo/.espressif/tools/xtensa-esp32-elf/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/bin
  /Users/qubo/.espressif/tools/esp32ulp-elf/2.28.51.20170517/esp32ulp-elf-binutils/bin
  /Users/qubo/.espressif/tools/openocd-esp32/v0.10.0-esp32-20190313/openocd-esp32/bin
  /Users/qubo/.espressif/python_env/idf3.3_py2.7_env/bin
  /Users/qubo/labs/esp-idf/tools
Done! You can now compile ESP-IDF projects.

ii) install ESP32_IMU_BARO_GPS_VARIO

git clone https://github.com/har-in-air/ESP32_IMU_BARO_GPS_VARIO esp32_imu_baro_gps_vario
cd esp32_imu_baro_gps_vario
make menuconfig  # no change
make

and that's where i get /Users/qubo/labs/esp32_imu_baro_gps_vario/components/arduino/libraries/WiFi/src/ETH.cpp:196:37: error: conversion from 'const ip_addr_t* {aka const ip_addr*}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested

partial make output (building on mac osx)

Toolchain path: /Users/qubo/.espressif/tools/xtensa-esp32-elf/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
Python requirements from /Users/qubo/labs/esp-idf/requirements.txt are satisfied.

apparently similar to espressif/arduino-esp32#3760

implemented the following changes and got one step further:

index 2ffea75..f84bc85 100644
--- a/components/arduino/libraries/WiFi/src/ETH.cpp
+++ b/components/arduino/libraries/WiFi/src/ETH.cpp
@@ -193,8 +193,10 @@ IPAddress ETHClass::gatewayIP()
 
 IPAddress ETHClass::dnsIP(uint8_t dns_no)
 {
-    ip_addr_t dns_ip = dns_getserver(dns_no);
-    return IPAddress(dns_ip.u_addr.ip4.addr);
+    // ip_addr_t dns_ip = dns_getserver(dns_no);
+    // return IPAddress(dns_ip.u_addr.ip4.addr);
+    const ip_addr_t * dns_ip = dns_getserver(dns_no);
+    return IPAddress(dns_ip->u_addr.ip4.addr);
 }
 
 IPAddress ETHClass::broadcastIP()
index db5e019..f10d69d 100644
--- a/components/arduino/libraries/WiFi/src/WiFiSTA.cpp
+++ b/components/arduino/libraries/WiFi/src/WiFiSTA.cpp
@@ -488,8 +488,10 @@ IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
     if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
         return IPAddress();
     }
-    ip_addr_t dns_ip = dns_getserver(dns_no);
-    return IPAddress(dns_ip.u_addr.ip4.addr);
+    // ip_addr_t dns_ip = dns_getserver(dns_no);
+    // return IPAddress(dns_ip.u_addr.ip4.addr);
+    const ip_addr_t * dns_ip = dns_getserver(dns_no);
+    return IPAddress(dns_ip->u_addr.ip4.addr);
 }

I'm using esp-idf v3.2.2, not v3.3.2