Using Zeroconf module

Technical questions regarding the XTC tools and programming with XMOS.
Redeye
XCore Addict
Posts: 131
Joined: Wed Aug 03, 2011 9:13 am

Using Zeroconf module

Post by Redeye »

I'm trying to use the zeroconf module in the xtcp project on Github, but not having much success. The xtcp thread is up and running fine on an XC-2 board. I've then used the following code from the app_xr_avb_lc_demo application in the AVB project to setup the mdns info :

Code: Select all

	// Initialize Zeroconf
	mdns_init(tcp_svr);

	// Register all the zeroconf names
	mdns_register_canonical_name("xmos_attero_endpoint");
	mdns_register_service("XMOS/Attero AVB", "_attero-cfg._udp",
			ATTERO_CFG_PORT, "");
I was then expecting to be able to see the service available in a Bonjour browser on my Mac, but I don't. Am I missing something blindingly obvious/dumb?


User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

Hi Redeye,

What is the 'Bonjour browser' you refer to?

If you open up a terminal and do:

Code: Select all

dns-sd -B _attero-cfg._udp
You should see the registered endpoint:

Code: Select all

Browsing for _attero-cfg._udp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
16:50:57.209  Add     2 15 local.                    _attero-cfg._udp.         XMOS/Attero AVB
Redeye
XCore Addict
Posts: 131
Joined: Wed Aug 03, 2011 9:13 am

Post by Redeye »

You're absolutely right, thanks. It looks like my ignorance of knowing how to search for the device is the problem. I've got a few Mac and iPhone apps which search for Bonjour services which I'd assumed would find the XMOS device once it was on the network, but I was obviously wrong. I'll go and do my homework properly now...
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

Hi board,

im trying to get mdns running without success.

it doesnt matter what i do mdns always broadcasts the same names and services.

attached is a screenshot of the wireshark capture.
it shows the default mdns values, but my code is the following:

Code: Select all

        // Initialize Zeroconf
	mdns_init(tcp_svr);

	// Register all the zeroconf names
	mdns_register_canonical_name("xmos_avb_talker_station");
	//mdns_register_name("xmos_avb_talker_station");
	//mdns_send()
	mdns_register_service("XMOS AVB Talker", "_attero-cfg._udp",
			ATTERO_CFG_PORT, "");
thanks in advance
regards CK
You do not have the required permissions to view the files attached to this post.
Redeye
XCore Addict
Posts: 131
Joined: Wed Aug 03, 2011 9:13 am

Post by Redeye »

I'm not an expert on this, but I've had similar problems myself. I think it's to do with the mdns daemon on your machine cacheing the initial names and them not getting updated because you've changed the service name on the XMOS but not unregistered the old one. I think the solution is either to get the daemon to refresh its cache, or my brute force method was simply to restart my machine.

If someone knows a better explanation than this, please share!!
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

Hi,

thanks for your advice Redeye,
but after a reboot its the same.

any other ideas?

its the output of wireshark, so its not the cache but the incoming packets...
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

I've spent 4hours with debugging now and the only thing i figured out, is that the input parameter "char name[]" of

Code: Select all

void mdns_register_canonical_name(char name[])
is empty.
could anyone point me in some direction, where i have to look at?
voodoosound
Active Member
Posts: 63
Joined: Sat Oct 15, 2011 8:53 pm

Post by voodoosound »

Hello again,

it just turned out, it has been a big miss understanding of the toolchain that made me think it doesnt work.
but it does!