Skip to content

Build error: conversion from 'const ip_addr_t {aka const ip_addr}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested #3760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GianCann opened this issue Feb 22, 2020 · 4 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@GianCann
Copy link

What you are trying to do? Compile my esp32-arduino library with sdkconfig custom value (i need more of 3 BLE Max Connection)
Describe your system: PC with Ubuntu desktop
Describe what is failing.

I try to compiling esp32-arduino library following this guide:
https://github.com/espressif/arduino-esp32/blob/master/docs/lib_builder.md

I get this error:

/home/gianluca/esp32-arduino-lib-builder/components/arduino/libraries/WiFi/src/WiFiSTA.cpp: In member function 'IPAddress WiFiSTAClass::dnsIP(uint8_t)':
/home/gianluca/esp32-arduino-lib-builder/components/arduino/libraries/WiFi/src/WiFiSTA.cpp:491:37: error: conversion from 'const ip_addr_t {aka const ip_addr}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested **
ip_addr_t dns_ip = dns_getserver(dns_no);
^
/home/gianluca/esp32-arduino-lib-builder/components/arduino/libraries/WiFi/src/ETH.cpp: In member function 'IPAddress ETHClass::dnsIP(uint8_t)':
/home/gianluca/esp32-arduino-lib-builder/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**
ip_addr_t dns_ip = dns_getserver(dns_no);

Where is the problem?

@GianCann GianCann changed the title Compilation error: conversion from 'const ip_addr_t {aka const ip_addr}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested Build error: conversion from 'const ip_addr_t {aka const ip_addr}' to non-scalar type 'ip_addr_t {aka ip_addr}' requested Feb 23, 2020
@pivan76
Copy link

pivan76 commented Feb 25, 2020

Ciao :-)

Try this:

In file:
/home/..../components/arduino/libraries/WiFi/src/WiFiSTA.cpp:491

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);
const ip_addr_t * dns_ip = dns_getserver(dns_no);
return IPAddress(dns_ip->u_addr.ip4.addr);
}

In file:
/home/..../components/arduino/libraries/WiFi/src/ETH.cpp:196

IPAddress ETHClass::dnsIP(uint8_t dns_no)
{
//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);
}

This fix is from version 4.0 of the arduino-esp32 found here:
https://github.com/espressif/arduino-esp32/blob/idf-release/v4.0/libraries/WiFi/src/WiFiSTA.cpp

If you get the error "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least the path in menuconfig is:

component config > mbedTLS > TLS key exchange method > enable pre-shared keys & enable psk

Ivan

elliottkember added a commit to elliottkember/arduino-esp32 that referenced this issue Apr 11, 2020
Incorporates a patch from @IvanPorro:
espressif#3760 (comment)

I don't know whether this will compile with <3.3.2, as the API has changed.
@stale
Copy link

stale bot commented Apr 26, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Apr 26, 2020
@stale
Copy link

stale bot commented May 10, 2020

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed May 10, 2020
@copercini
Copy link
Contributor

copercini commented Jun 16, 2020

@me-no-dev I think this fix should be included in master, because it generates a build error when using arduino as component of IDF 3.3.2 without it
EDIT: this is already implemented in 3.3 branch 3da04ce

elliottkember added a commit to elliottkember/arduino-esp32 that referenced this issue Sep 8, 2020
Incorporates a patch from @IvanPorro:
espressif#3760 (comment)

I don't know whether this will compile with <3.3.2, as the API has changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

3 participants