Closed x-em closed 1 year ago
Looking at stacktrace it is a low level/transport issue. Can you tell if target device which causes issue is BTL certified or is it some kind of software?
It's an analog device.
I know that thing. Let me test it and see if it fails for me in similar way!
Thank you very much. I debugged the protocol bannet/ip for the first time, and then I used bacnet4j to read it directly.
I just did a scan with simulator and it seems to work:
Device id 9999
Fetching devices for x.y.z.w address with 5 second timeout
=> Device id 1294418
Metadata
Address: a.b.c.d:60601
Name: Room_FC_2014
Model: Room_FC_2014
Vendor:
=> Device id 1294418
Metadata
Address: [c0,a8,2,d0,ec,b9]
Name:
Model:
Vendor:
=> Type DEVICE id: 1294418
Metadata
Name: RoomController.Simulator
Units: errorClass=property, errorCode=unknown-property
Description: Free RoomController Simulator, F. Chaxel 2015
=> Type ANALOG_INPUT id: 0
Metadata
Name: Temperature.Indoor
Units: degrees-fahrenheit
Description: Indoor Temperature
Present value 69.8, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 1
Metadata
Name: Temperature.Water
Units: degrees-fahrenheit
Description: Glycol Water Temperature
Present value 94.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 2
Metadata
Name: Temperature.Outdoor
Units: degrees-fahrenheit
Description: Outdoor Temperature
Present value 53.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 0
Metadata
Name: SetPoint.Value
Units: degrees-fahrenheit
Description: Effective SetPoint
Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 1
Metadata
Name: Setpoint.1
Units: degrees-fahrenheit
Description: Setoint 1
Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 2
Metadata
Name: Setpoint.2
Units: degrees-fahrenheit
Description: Setpoint 2
Present value 66.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 3
Metadata
Name: Setpoint.3
Units: degrees-fahrenheit
Description: Setpoint 3
Present value 63.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type CHARACTER_STRING id: 1
Metadata
Name: TextSetpoint.1
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 1
Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 2
Metadata
Name: TextSetpoint.2
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 2
Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 3
Metadata
Name: TextSetpoint.3
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 3
Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type BINARY_VALUE id: 0
Metadata
Name: State.Heater
Units: errorClass=property, errorCode=unknown-property
Description: Heater Status
Present value active, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type BINARY_VALUE id: 1
Metadata
Name: State.Chiller
Units: errorClass=property, errorCode=unknown-property
Description: Chiller Status
Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type MULTISTATE_VALUE id: 0
Metadata
Name: State
Units: errorClass=property, errorCode=unknown-property
Description: Controler State Command
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type MULTISTATE_VALUE id: 1
Metadata
Name: State.VentilationLevel
Units: errorClass=property, errorCode=unknown-property
Description: Ventilation level
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type DEVICE id: 1294418
Metadata
Name: RoomController.Simulator
Units: errorClass=property, errorCode=unknown-property
Description: Free RoomController Simulator, F. Chaxel 2015
=> Type ANALOG_INPUT id: 0
Metadata
Name: Temperature.Indoor
Units: degrees-fahrenheit
Description: Indoor Temperature
Present value 69.8, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 1
Metadata
Name: Temperature.Water
Units: degrees-fahrenheit
Description: Glycol Water Temperature
Present value 94.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 2
Metadata
Name: Temperature.Outdoor
Units: degrees-fahrenheit
Description: Outdoor Temperature
Present value 53.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 0
Metadata
Name: SetPoint.Value
Units: degrees-fahrenheit
Description: Effective SetPoint
Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 1
Metadata
Name: Setpoint.1
Units: degrees-fahrenheit
Description: Setoint 1
Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 2
Metadata
Name: Setpoint.2
Units: degrees-fahrenheit
Description: Setpoint 2
Present value 66.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 3
Metadata
Name: Setpoint.3
Units: degrees-fahrenheit
Description: Setpoint 3
Present value 63.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type CHARACTER_STRING id: 1
Metadata
Name: TextSetpoint.1
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 1
Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 2
Metadata
Name: TextSetpoint.2
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 2
Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 3
Metadata
Name: TextSetpoint.3
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 3
Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type BINARY_VALUE id: 0
Metadata
Name: State.Heater
Units: errorClass=property, errorCode=unknown-property
Description: Heater Status
Present value active, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type BINARY_VALUE id: 1
Metadata
Name: State.Chiller
Units: errorClass=property, errorCode=unknown-property
Description: Chiller Status
Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type MULTISTATE_VALUE id: 0
Metadata
Name: State
Units: errorClass=property, errorCode=unknown-property
Description: Controler State Command
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type MULTISTATE_VALUE id: 1
Metadata
Name: State.VentilationLevel
Units: errorClass=property, errorCode=unknown-property
Description: Ventilation level
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
Discovery complete
Process finished with exit code 0
The errorClass=property, errorCode=unknown-property
messages are not relevant. You can see that BinaryPV
with heater status is fine:
=> Type BINARY_VALUE id: 0
Metadata
Name: State.Heater
Units: errorClass=property, errorCode=unknown-property
Description: Heater Status
Present value active, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
From code sample you posted I see you are on most recent release, hence we shall have the same bacnet4j binary.
There may be something wrong with my simulation device, or there may be something wrong with the code I use to debug, because the code hints in the readme file are out of date. So I made some changes. Let me try again.
public static void main(String[] args) {
//192.168.0.245 is the ip of my computer. 192.168.0.164 is the ip of device
BacNetClient client = new BacNetIpClient("192.168.0.245", "192.168.0.164", 32891);
client.start();
// given number is timeout in millis
Set<Device> devices = client.discoverDevices(10000);
for (Device device : devices) {
System.out.println(device);
List<BacNetObject> deviceObjects = client.getDeviceObjects(device);
for (BacNetObject property : deviceObjects) {
System.out.println(property.getName() + " " + client.getPresentValue(property,new BypassBacnetConverter()));
}
}
client.stop();
}
Sample code:
BacNetClient client = new BacNetIpClient("<bind ip>", "<broadcast ip>", <client device id>);
client.start();
Set<Device> devices = client.discoverDevices(5000); // given number is timeout in millis
for (Device device : devices) {
System.out.println(device);
for (Property property : client.getDeviceProperties(device)) {
System.out.println(property.getName() + " " + client.getPropertyValue(property));
}
}
client.stop();
Your code is perfectly fine. Sample from readme is still valid, but will be fading away due to naming alignment made in 1.3 release. Out of curiosity - does the lib fail with all objects or just binarypv? Can you try to run DiscoveryMain
which is part of project sources and see what it will print for you?
I debug the code and find that my debugging environment may cause errors for two reasons:
I think it's because of my environment.Thank you.
This is the result of running DiscoveryMain.
=> Device id 32891
Metadata
Address: 192.168.0.164:60322
Name: Room_FC_2014
Model: Room_FC_2014
Vendor:
Unable to fetch property description
=> Device id 32891
Metadata
Address: [c0,a8,0,a4,eb,a2]
Name:
Model:
Vendor:
Unable to fetch property description
=> Type DEVICE id: 32891
Metadata
Name: RoomController.Simulator
Units: errorClass=property, errorCode=unknown-property
Description: Free RoomController Simulator, F. Chaxel 2015
=> Type ANALOG_INPUT id: 0
Metadata
Name: Temperature.Indoor
Units: degrees-celsius
Description: Indoor Temperature
Present value 20.7, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 1
Metadata
Name: Temperature.Water
Units: degrees-celsius
Description: Glycol Water Temperature
Present value 35.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 2
Metadata
Name: Temperature.Outdoor
Units: degrees-celsius
Description: Outdoor Temperature
Present value 12.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 0
Metadata
Name: SetPoint.Value
Units: degrees-celsius
Description: Effective SetPoint
Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 1
Metadata
Name: Setpoint.1
Units: degrees-celsius
Description: Setoint 1
Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 2
Metadata
Name: Setpoint.2
Units: degrees-celsius
Description: Setpoint 2
Present value 19.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 3
Metadata
Name: Setpoint.3
Units: degrees-celsius
Description: Setpoint 3
Present value 17.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type CHARACTER_STRING id: 1
Metadata
Name: TextSetpoint.1
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 1
Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 2
Metadata
Name: TextSetpoint.2
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 2
Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 3
Metadata
Name: TextSetpoint.3
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 3
Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type BINARY_VALUE id: 1
Metadata
Name: State.Chiller
Units: errorClass=property, errorCode=unknown-property
Description: Chiller Status
Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type MULTISTATE_VALUE id: 0
Metadata
Name: State
Units: errorClass=property, errorCode=unknown-property
Description: Controler State Command
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type MULTISTATE_VALUE id: 1
Metadata
Name: State.VentilationLevel
Units: errorClass=property, errorCode=unknown-property
Description: Ventilation level
Present value 3, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type DEVICE id: 32891
Metadata
Name: RoomController.Simulator
Units: errorClass=property, errorCode=unknown-property
Description: Free RoomController Simulator, F. Chaxel 2015
=> Type ANALOG_INPUT id: 0
Metadata
Name: Temperature.Indoor
Units: degrees-celsius
Description: Indoor Temperature
Present value 20.7, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 1
Metadata
Name: Temperature.Water
Units: degrees-celsius
Description: Glycol Water Temperature
Present value 35.6, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_INPUT id: 2
Metadata
Name: Temperature.Outdoor
Units: degrees-celsius
Description: Outdoor Temperature
Present value 12.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 0
Metadata
Name: SetPoint.Value
Units: degrees-celsius
Description: Effective SetPoint
Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 1
Metadata
Name: Setpoint.1
Units: degrees-celsius
Description: Setoint 1
Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 2
Metadata
Name: Setpoint.2
Units: degrees-celsius
Description: Setpoint 2
Present value 19.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type ANALOG_VALUE id: 3
Metadata
Name: Setpoint.3
Units: degrees-celsius
Description: Setpoint 3
Present value 17.0, type: com.serotonin.bacnet4j.type.primitive.Real
=> Type CHARACTER_STRING id: 1
Metadata
Name: TextSetpoint.1
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 1
Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 2
Metadata
Name: TextSetpoint.2
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 2
Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type CHARACTER_STRING id: 3
Metadata
Name: TextSetpoint.3
Units: errorClass=property, errorCode=unknown-property
Description: Text for Setpoint 3
Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
=> Type BINARY_VALUE id: 1
Metadata
Name: State.Chiller
Units: errorClass=property, errorCode=unknown-property
Description: Chiller Status
Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
=> Type MULTISTATE_VALUE id: 0
Metadata
Name: State
Units: errorClass=property, errorCode=unknown-property
Description: Controler State Command
Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
=> Type MULTISTATE_VALUE id: 1
Metadata
Name: State.VentilationLevel
Units: errorClass=property, errorCode=unknown-property
Description: Ventilation level
Present value 3, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
Discovery complete
I can just speculate about possible reason for failure, since I can't reproduce issue. I recall that bacnet4j (underlying library which handles transport) once had troubles with Japanese characters and related charset. Not sure if that's same for you since simulator, as far I know, does not have any user controllable labels.
If you still struggle you can try to capture a wireshark pcap which will include failed operation. I will compare it with the same operation on my end and see if we have any difference on the wire level. I suppose we do, but do not know what kind of trouble we deal with.
Thanks. I am following the apache plc4x project. You are also the submitter of the plc4x project. I look forward to more exchanges in the future.
Unable to fetch property description
error message