I’m working on an AmebaPro2 project and want to enable mDNS so that devices on the same network can discover my board via hostname (e.g. my-device.local).
I tried enabling the lwIP mDNS responder by setting:
#define LWIP_MDNS_RESPONDER 1
#define LWIP_IGMP 1
and adding mdns.c from the official lwIP 2.1.2 source into my Arduino sketch. However, the build always fails at the link stage with:undefined reference to `netif_alloc_client_data_id’
It looks like the lwIP core library shipped with AmebaPro2 SDK 4.0.9 may not include this function, or the mDNS module is not fully integrated.
So I’d like to ask:
Is mDNS officially supported on AmebaPro2 / AMB82-Mini?
If yes, what is the correct way to enable it? Are there any example sketches or documentation?
If not, is there a recommended alternative for service discovery on AmebaPro2?
Any help or pointers would be greatly appreciated. Thanks!
The device can then be discovered on the local network using:
my-device.local
For your current test, we noticed that mdns.c was added directly to the Arduino project. We suggest testing this first with the AmebaPro2 FreeRTOS SDK. The reason is that some libraries used by the Arduino SDK are provided as prebuilt libraries. Therefore, modifying lwipopts.h or other lwIP header files in the Arduino SDK may not rebuild the underlying lwIP library, so the configuration changes may not take effect.
Recommend:
Test the lwIP mDNS responder using the AmebaPro2 FreeRTOS SDK first.
Enable the required lwIP configuration there and add mdns.c to the build (Add path to application.cmake).
Confirm that my-device.local can be resolved successfully.
After that, we can further check how to integrate the same functionality into the Arduino SDK.
Hope this helps.
Addtionally, we would like to invite you to fill in this Private User Form. This will help us better understand your project and company and allow us to support you more effectively.