Open Alv3s opened 4 years ago
Does the request reach all the clients? Should be easy to verify by checking the logs for multiple devices.
Do all the clients' responses reach the computer where the client is running? Easiest way to verify is probably to run wireshark on the computer.
@mfalkvidd Thank your for the reply. I did verify and checked the multicast request reached both devices and both devices response reach CoAP.NET. I could verify this with Wireshark and also via logs generated on the console by CoAP.NET.
The issue seems to be the Discover method is only expecting one response (which usually it is fine). I guess a method called "DiscoverAll" could be created and return an IEnumerable of Devices with weblinks. If that seems fine to you, I could implement it and open a merge request for you.
I don't have control over this repository, and I don't use multicast myself, but your suggestion sounds good.
I'm not sure anyone is maintaining this repo anymore. I submitted a pull request quite a while ago: https://github.com/smeshlink/CoAP.NET/pull/64
I would prefer that this repo remained the "true" source for the project, but you are welcome to submit a pull request to my fork if you have no luck here.
There are a few other forks as well: https://github.com/smeshlink/CoAP.NET/network
I have been playing with this library to discover CoAP devices using my own library on the microcontroller (ESP8266): https://github.com/Alv3s/Thing.CoAP
It seems CoAP.NET is not ready for this feature. Microcontroller is configured to respond to CoAP multicast address (224.0.1.187), I am opening a client to this coap endpoint "coap://224.0.1.187/" and I was expecting to discover all the resources of all available CoAP devices on the network. But it seems I am only getting the first one.
I tried to do as follows:
The code above only returns the first device replying to the request. I also tried as follows:
I was expecting function "Request_Respond" to print twice the "Here", but I can see on the logs that the second response is being ignored.
Any tips? Maybe I could help you with this one.