I have implemented a custom device module, so which resources or examples should I look at to enable computers on the same local network (running the openDAQ client_discovery program) to discover and connect to this device? Specifically, how can I integrate both a server and a device simultaneously?
First of all i see that you are setting the root device twice on instance builder. The actual root device will be the last you set (miniaudio).
Now lets go to discovery. I see that you did enabling discovery correct. the device should be broadcasted with connection string daq://[manufacture]_[serial_number] where manufacture and serial_number are bring from device info of your device.
Creation device Info of device is happening in the method onGetInfo() of the device implementation. If you have not set serial number or manufacture, the device would be visible as daq.nd://[ip]:[port].
If everything set correctly, you will see in terminal info message [info] Server "OpenDAQNativeStreaming" registered with the discovery service
I did find the fact that root device had been added twice and I’d removed the last one.
Now I can connect to the server in a LAN network using connection string: daq.nd://[ip]:[port], but discovery between two computers is not working.
And I have another two questions:
Q1: Assuming a computer has multiple network interfaces, how does openDAQ select a specific network interface for the external service connection string (daq.nd://[ip]:[port])?
Q2: If the root device is a ref device module, then RefFBModuleRenderer added in a client on another connected computer will show signal; but if the root device is a miniaudio device module, then RefFBModuleRenderer added in a client on another connected computer will not show signal, and a reader read nothing from the server. What’s the difference?
Happy New Year! I’m sorry for the delayed response. We had holidays
I’m happy that you managed to solve Q2. Regarding Q1, openDAQ is using the open-source mDNS library.
On the server side, it iterates through all available network interfaces to find one IPv4 and one IPv6 interfaces that support multicasting. Loopback interfaces are excluded.
The client side uses up to 32 available sockets that support IPv4/IPv6 and multicasting.