[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Errors when attempting to read  XML
Forum Index » BACnet4J general discussion
Author Message
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

When running the following bit of code:

My Main class:



My Read property method:


I get the following error:



error being thrown by this method (encodable):


In wireshark, the packet is sent fine, and received fine (wireshark shows the correct present value i'm trying to read). However, for some reason, bacnet4j won't parse it properly.

Here are the captured backnet packets if it helps:
http://www.megaupload.com/?d=FOIBLUPA


Any help would be greatly appreciated!

This message was edited 1 time. Last update was at 25/08/2009 17:09:26

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi Randy,

That problem has probably already been fixed. The version of the Encodable.read method that you included is old. Updates have been checked into CVS, but the jar file is still the old code.

Can you build your own jar file?

Best regards,
Matthew Lohbihler
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi Randy,

Since there were a number of code updates - albeit small - i've uploaded a new release, 1.03. Latest jar file is there.

Best regards,
Matthew Lohbihler
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

mlohbihler wrote:Hi Randy,

Since there were a number of code updates - albeit small - i've uploaded a new release, 1.03. Latest jar file is there.


Thanks!

I'll grab it now, and test it tomorow
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

Unfortunately I am getting the same error when running the new code:


Thrown by:

Any ideas?
Thanks in advance!
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi Randy,

The data in the response doesn't appear to make sense for the context. The object type is Analog Value, which has a present value property of type Real. A real is always a 4 byte value plus a length. For example, 1.23 gets serialized to [44,3f,9d,70,a4]. Also, the first "4" of the "44" says explicitly that the value is a Real.

The response data is [31,5], which says that the type is Signed Integer of length 1 and value 5. This is odd because the only property of this type is the "utc offset" of a "device".

Best regards,
Matthew Lohbihler
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

So the problem lies with the way my bacnet device is replying to the request, not the code itself?

Would it be possible just to dump (println) the hex value instead of parsing it into an encodable? And if so, how could I do this?
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

The code is written to be as automatic as possible, so there would be effort involved in preventing full parsing of the data. Besides, the hex value would be encoded BACnet data, and might not make a lot of sense.

What is the actual object type configured in your remote device? The BACnet specification clearly says that an Analog Value object has a Real as its present value. Using a Signed Integer is non-compliant.

Best regards,
Matthew Lohbihler
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

You were correct, this was an error in the way my hardware was responding. The new build fixes that issue.

I am now however having an issue that keeps happening randomly (but this time simply won't fix itself after many attempts). Bacnet4j sends the packet correctly, and the bacnet device responds, but for some reason bacnet4j won't acknowledge the fact that it received an awk packet. There errors are as following:


Write property:






read property:




The captured packets are here:
http://www.filebox.com/hzrynxyfz9zx

Another bacnet client that I have does not have this issue with the hardware I am using.
And help would be greatly appreciated ?

PS. I know that I am writing 3.3 but it is returning 3.0000. Though this should have nothing to do with this issue.
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

If the app had actually received the response and for some reason misinterpreted it, you would see an exception like, "No waiting recipient for message: peer=...". Were there other messages, or just the timeouts?

Best regards,
Matthew Lohbihler
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

Just the timeout. If you look at the packets in wireshark, bacnet4j sends the request 3 times and gets a reply back each time. For some reason it is refusing to read the awk packet. The packet bacnet4j is sending is identical to the one bacbeat sends out. However, bacbeat recognizes the awk packet and displays the value, while bacnet4j does not, so it shouldn't be a hardware problem.

The code running those 2 methods are here:

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Do you know how to add System.out statements to the code and build the jar? It seems as if BACnet4J isn't getting the response at all, since any other possibility should cause an exception to be thrown.

If so, add the following line in IpMessageControl at line 424:



If the packet is being received, then we can go down the BACnet4J road. If not, there must be something else preventing its proper routing.

Best regards,
Matthew Lohbihler
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

Added the line, and complied.

When running the line, nothing changed (did not display the "packet received message").

The question is however, why is bacbeat able to receive the packet while bacnet4j is not?

I have a few computers here, do you think I should try executing on another one?
craig

Initiate

Joined: 06/08/2007 16:50:46
Messages: 163
Offline

The question is however, why is bacbeat able to receive the packet while bacnet4j is not?


running as root vs. usual user?
windows firewall?
port in use by other program?
Randy

Initiate

Joined: 25/08/2009 15:27:11
Messages: 8
Offline

craig wrote:
The question is however, why is bacbeat able to receive the packet while bacnet4j is not?


running as root vs. usual user?
windows firewall?
port in use by other program?


- Running as administrator (windows)
-I'll shut off windows firewall and test that theory in a bit, though it was working last week with windows firewall on.
- Happens directly after a fresh bootup. Before, when my program didn't exit properly I had to restart it to get it working again (thus the port was in use). On a fresh bootup however, I have doubts the bacnet port (4780 would be in use. I will however try to test for this.

Thanks for the tips
 
Forum Index » BACnet4J general discussion
Go to:   
Powered by JForum 2.1.9 © JForum Team