wiced hostname

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Geva_2134536
Level 3
Level 3
First like received First like given

Hello,

Is it possible to configure my device with a hostname through wiced?

So I can reach it with for example "http://wiced-device" instead of "http://192.168.1.1" ?

I found the following snippet in LWIP source code twice in wwd_network.c and ethernetif.c

#if LWIP_NETIF_HOSTNAME

  /* Initialize interface hostname */

  netif->hostname = "lwip";

#endif /* LWIP_NETIF_HOSTNAME */

I've changed LWIP_NETIF_HOSTNAME to 1 in opt.h

While compiling it complaind in the wwd_network.c I couldn't assign a const.

So I changed to:

char acHostname[5] = { 'l','w','i','p','\0' };

netif->hostname = acHostname;

It then compiles but it doesn't seem to set it properly, I get unknown host back.

Anyone a pointer on how to accomplish this?

Cheers,

Gerard

2 Replies
VikramR_26
Employee
Employee
25 sign-ins 10 sign-ins 10 comments on KBA

Hi Gerard,

We have our Gedday implementation in which we provide an option for hostname. You can find this in gedday.h.

Let us know if this helps you

thnx

vik86

0 Likes

Hi Vik86,

Thanks for your suggestion.

I added the following piece of code:

    gedday_init( WICED_AP_INTERFACE, "wiceddevice" );

    gedday_add_service( "Wiced Home Webpage", "_http._tcp.local", 80, 300, "" );

On an Apple or Linux device it works and can surf to:

http://wiceddevice.local

However on a windows machine it is not working, is it possible to get it working on a windows machine this way?

Cheers,

Gerard

0 Likes