Discover custom DIGI over the network

Hello,

We have developped our own application to discover DIGI over the network using UDP broadcast, even when the IP addresses of the PC and the DIGI don’t match.

The problem is that, when the IP addresses of the PC and the DIGI don’t match, the DIGI receive the packet but is unable to send the response (sendto() error = 0x72).

Is this a socket configuration/option problem? This should work as well as the DIGI Discovering tool…

Thanks!

Paul

What version of NET+OS are using here? With the release of 6.3 Digi provided an implementation of our ADDP (Advanced Device Discovery Protocol).

ADDP provided one the ability to discover all, so enabled devices, on the local subnet, regardless of its configured address.

Regarding this error 72; are you getting this error returned from getErrno() or some where else? If sendto() is returning a -1 (meaning failure) your applciation should next call getErrno() in order to obtain the specific error code. Do not use errno(), as this will not necessarily return the correct error code.

Cameron

Hello Cameron,

Thanks for reply. We are using NET+OS 6.0. Use the ADDP would be great, but we need our own protocol for specific configuration.

Indeed, I get this error from getErrno() just after the sendto(). I didn’t find what this 0x72 error is for.

As far as I know, the sendto() should watch the ARP table to retrieve and send to the MAC address? Can it be an ARP configuration problem?

Thanks,

Paul

Paul,

The core error codes are defined in c:\cygwin\usr\include\sys\errno.h. The error code 0x27 (decimal 114) is defined as ENETUNREACH, meaning that the network is unreachable.

As to what the problem is, that is going to difficult to deduce on this forum. I have attached a sample application written by one of my associates, some time ago. This example implements a mock discovery/configuration protcol. I would recommend that you compile, run and review this example, as it may give you clues as to the problem your appication is suffering.

If this example does not help then I would suggest that you contact our support group directly via the online support request form at http://www.digi.com/support/supportrequest.jsp.

Cameron

Hello Cameron,

Thanks for your exemple. I tried it but I am afraid that it doesn’t work better (no answer sent when not in the same subnet).

However, I changed the socket of my application to a Fast Ip handler, and then the responses are correctly sent, even when not in the same subnet. I assume that it is because the fast IP procedure doesn’t try to see wether the receiver is reachable or not…

Thanks,

Paul