MangoAutomation / BACnet4J

BACnet/IP stack written in Java. Forked from http://sourceforge.net/projects/bacnet4j/
GNU General Public License v3.0
183 stars 110 forks source link

No response when execute RequestUtils.readProperties #99

Open yangshuyi opened 2 months ago

yangshuyi commented 2 months ago

I'm now using Polling way to fetch the value from device. Sometime when executing RequestUtils.readProperties, it will not come back any response (more than 30 seconds no response). Normally, it will give back the value within 1second.

I have to wrap the invocation with a Future and set a timeout exception logic. But actually, I don't want to get any failure.

Can someone kindly show me what's the reason.

    <dependency>
        <groupId>com.infiniteautomation</groupId>
        <artifactId>bacnet4j</artifactId>
        <version>6.0.0</version>
    </dependency>
yangshuyi commented 2 months ago

I attached the log screenshot

image

From it, you can see the normal request will have a matched NPDU, but the timeout request do not have. That means cannot receive the response from server.

Anyone knows what's the reason?

kishorevenki commented 2 months ago

Which is the device having address 192.168.30.255? This address looks like broadcast address. So any device that receives with the broadcast address would discard the packets, if the those mesages are not a valid broadcast message. RP, WP, requests are unicast message and Who-Is, I-Am, Who-Has, I-have etc. are broadcast messages.

yangshuyi commented 2 months ago

Which is the device having address 192.168.30.255? This address looks like broadcast address. So any device that receives with the broadcast address would discard the packets, if the those mesages are not a valid broadcast message. RP, WP, requests are unicast message and Who-Is, I-Am, Who-Has, I-have etc. are broadcast messages.

Thank you for answering the question.

The 192.168.30.255 is a boardcast address. I can get devices list by sending WhoIs Request. After that I can get a list of devices.

The question is that why sometimes can get the packets, sometimes cannot? Does the bad network issue?

I try to read only one PropertyIdentifier, sometimes also get timeout. So I guess it is not related with the side of request.

kishorevenki commented 2 months ago

Can you please share the wireshark logs?