-
Notifications
You must be signed in to change notification settings - Fork 13
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
'inet_addr_to_ipaddr' was not declared in this scope [SOLVED] #8
Comments
Tried very dumb solution by adding these lines:
in Ping.cpp. No compiler error and able upload the sketch into ESP32. But ping doesn't work because it didn't find inet_addr_from_ipaddr and inet_addr_to_ipaddr functions. How to fix this? Please help... |
Done this steps:
Then.... compile my sketch. And now.... it WORKS.... :) :) :) My previous mistake is not installing ESP32 Core version 1.0.0. I did it by installing version 1.0.1 - the Boards Manager default version - which didn't work. It seems some change in ESP32 Core version 1.0.1 broke ESP32 Ping library connection. |
Ping.cpp does not include the header that defines this function, you can alter the library to add the following to fix this likely:
|
I added #include <lwip/inet.h> to Ping.cpp.. Compilation with Core 1.0.1 resulted in the same error. |
The "function" is defined in that file, additional code may be required but I don't have this library setup on my system but I do use this function in my own code without issues. |
a fix for this: PotatoX@4b8688e |
@atanisoft That works, thanks! I use ping to test for a live internet connection. |
When will PotatoX fix be merged to mater? I am getting the same issue with ESP core 1.0.1 right now. |
Found another bug, typo... In Ping.cpp... free() call is malformed, missing ";"... throws errors on compile.
|
to make this work for v1.01 just change inet_addr_from_ipaddr to inet_addr_from_ip4addr in file Ping.cpp in your library path Thats it |
The solution that works for me is changing the following lines: to.sin_addr = *(in_addr *) addr; // inet_addr_from_ipaddr (&to.sin_addr, addr); fromaddr = *(ip4_addr_t *) &from.sin_addr; // inet_addr_to_ipaddr (&fromaddr, &from.sin_addr); |
I'm using ESP 1.0.4 and could not easily get any of the above methods to work, but I have gotten it to work using Please test with my fork at https://github.com/pvint/ESP32_ping and let me know if it works with your version(s) |
Thanks @pvint, that totally worked for me (using ESP 1.0.4 here). |
Good to hear @zyklone92 (and thanks for the feedback!) Cheers |
https://github.com/marian-craciunescu/ESP32Ping not abandoned input may is welcomed |
See: pvint commented on Dec 5, 2019 pbecchi/ESP32_ping#8
Thanks a lot for excellent library.
It works fine on ESP32, no compiler error.
Because something wrong on my PC, I did fresh install Windows 10 and Arduino IDE 1.8.8.
But after fresh install, ESP32 Ping doesn't work anymore.
Arduino IDE Compiler error in Ping.cpp line:
inet_addr_from_ipaddr(&to.sin_addr, addr);
The error message: 'inet_addr_to_ipaddr' was not declared in this scope
It seems this error cause by broken lwip library.
ESP32 Ping use 2 separate lwip libraries (Arduino library in C:\Program Files (x86)\Arduino and ESP32 library in C:\Users\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\tools\sdk\include\lwip\lwip folder).
But somehow the library connection is broken and cause 'inet_addr_to_ipaddr' was not declared in this scope error
Instead using Board Manager to install ESP32 package, also tried install ESP32 package by using git, but didn't help either. Still 'inet_addr_to_ipaddr' was not declared in this scope error
How to fix this error?
Please help...
The text was updated successfully, but these errors were encountered: