How to combine device and server into one device

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?

my code is as follow:


what’s the problem with it?

Hello!

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

If you have any question, feel free to ask :slight_smile:

Thanks for your help.

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?

Hello!
Can you please provide on which os you have server and client?

both are on Windows 10+

I’ve solved Q2 problem. We should also send related timedomain signal.

Hello!

Happy New Year! I’m sorry for the delayed response. We had holidays :slight_smile:
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.

Happy New Year!
I found it necessary to add an opcua server before mdns can take effect?

Discovery service is only registered in opcua_server_module.

it should work with native streaming and websocket servers as well. can you show your client code?

The code is above shown in the picture of my question. Anything missing?

In the same local area network, the client is unable to discover this server device.

Im sorry, but i see the code only for the server side

I use the Python openDAQ demo software to search for devices, not my own code

w