• K
    kishorevenki

    Please set the protocol services supported property of device object accordingly. This property is string of bits, setting 1 in any position indicates that the service in the corresponding position is supported.

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hi,

    When tried to write Present_Value of AV, BV, MSV objects and High_Limit, Low_Limit, etc we are getting write-access-denied error response? In fact for the above three commandable mixin is added.

    So how to make a property writeable and how to make a property not writeable?

    Regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hi phildunlap,

    Based on your suggestion I did debugging.

    • UTC_Offset is getting updated when localDevice.writePropertyInternal(pid, value) during the initialize time. ;. After the analysis, I noticed that at 622nd line in BACnetObject.java ( l.propertyChange(pid, oldValue,, value) the value is right;y updated.

    • But when from 3rd property client ReadProprty (Device Object. UTC_Offset) is sent, the local device is returning the value of the timeZone and not with set value of UTC_Offset.. I could not debug using break point when asked from external device.with ReadProperty or other services. Please guide me where to set the break point, which will help me to debug and furnish you with more information.

    • Further I believe there is error in the value of UTC_Offset as per the time zone. For example if the time zone is - 7 hours, then the value of the UTC_Offset should be +420 and not -420. This is because as per BACnet local date / time is calculated based on the formula (GMT - UTC offset). So in the above example if UTC_Offset is -420 for - 7 hours. then the actual time would be if GMT equals 0;00 hours, 0 - (-420) equals 0 + 420 which means + 7 hours. and is wrong.

    Thanks,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hi phildunlap,

    I also face similar problem. My problem is

    • UTC_Offset set during creation of LocalDevice is not getting updated to the utc_offset property of the device. Though Simple Ack is received while writing the UTC_Offset property from 3rd party client, but when read it always responds with old value.. Here the expected behavior is UTC_Offset, should be updated.

    • When TimeSynch message is sent either via broadcast or to localDevice, the local date and time should change accordingly. But it always shows the system clock which is incorrect. I think carnecro is also facing the same issue.

    • Above issue is faced for UTCTime Synch as well. Here one more problem is UTC_Offset cannot be changed through BACnet. .

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Since the initialize() command was not executed, localDevice was not initialized. So the above issues are faced. Once the port is closed, local; device was initialized and was updated with objects, services and property values.

    However I-Am response has not received for Who-Is.

    Thanks & regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Yes, you are right. somehow port is blocked. After killing the process and the running the app, initialize() command was executed successfully.

    Thanks.

    Regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hello,

    The local device is not updated with the objects that are added, properties that are set except the object identifier which the local device is picking from the constructor. Below is the code :

    package com.test.mavenproject1;
    import com.serotonin.bacnet4j.LocalDevice;
    import com.serotonin.bacnet4j.exception.BACnetServiceException;
    import com.serotonin.bacnet4j.npdu.ip.IpNetwork;
    import com.serotonin.bacnet4j.npdu.ip.IpNetworkBuilder;
    import com.serotonin.bacnet4j.obj.BACnetObject;
    import com.serotonin.bacnet4j.transport.DefaultTransport;
    import com.serotonin.bacnet4j.transport.Transport;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;

    import com.serotonin.bacnet4j.type.constructed.ObjectTypesSupported;

    import com.serotonin.bacnet4j.type.constructed.SequenceOf;
    import com.serotonin.bacnet4j.type.constructed.ServicesSupported;
    import com.serotonin.bacnet4j.type.enumerated.ObjectType;
    import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier;
    import com.serotonin.bacnet4j.type.enumerated.RestartReason;
    import com.serotonin.bacnet4j.type.primitive.CharacterString;
    import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier;
    import com.serotonin.bacnet4j.type.primitive.UnsignedInteger;

    public class App
    {
    public static void main( String[] args ) throws Exception
    {
    final int port = 47808;
    IpNetwork network;
    System.out.println( "Hello World!" );
    network = new IpNetworkBuilder()
    .withSubnet("192.168.1.0", 24)
    .withLocalBindAddress("192.168.1.107")
    .withPort(port)
    .build();

        final Logger LOG = LoggerFactory.getLogger(DefaultTransport.class);
        LOG.debug("Default Transport class");
        
    	Transport transport = new DefaultTransport(network);
    	System.out.println( "Default Transport class!" );
    
    	ServicesSupported servicesSupported=new ServicesSupported();
        servicesSupported.setAll(false);
        servicesSupported.setWhoIs(true);
        servicesSupported.setReadProperty(true);
    	LocalDevice localDevice = new LocalDevice(1000, transport)
    			.withPassword("1234")
    			.withAPDUTimeout(new UnsignedInteger(3000))
    			.withNumberOfApduRetries(new UnsignedInteger(3))
    			.writePropertyInternal(PropertyIdentifier.protocolServicesSupported, servicesSupported);
    	
    	try {
    		localDevice.initialize();
    	} catch (Exception e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	} 
    
    	System.out.println(localDevice.getInstanceNumber());
    	System.out.println(localDevice.get(PropertyIdentifier.objectIdentifier));
    	System.out.println(localDevice.getId());
    	
        
        localDevice = localDevice.writePropertyInternal(PropertyIdentifier.location, new CharacterString("Puvys"));
        localDevice = localDevice.writePropertyInternal(PropertyIdentifier.description, new CharacterString("Server Device"));
        localDevice = localDevice.writePropertyInternal(PropertyIdentifier.activeCovSubscriptions, new SequenceOf<>());
    
        ObjectTypesSupported ots=new ObjectTypesSupported();
        ots.allFalse();
        ots.set(ObjectType.analogValue, true);
        localDevice = localDevice.writePropertyInternal(PropertyIdentifier.protocolObjectTypesSupported, ots);
        ObjectIdentifier objectId = new ObjectIdentifier(ObjectType.analogValue, 1);
        BACnetObject object = new BACnetObject(localDevice, objectId);
        try {
    		localDevice.addObject(object);
    	} catch (BACnetServiceException e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	}
     
        
        System.out.println(localDevice.getServicesSupported());
    }    	
    

    }
    For the above the code, we faced the following issues when communicated from 3rd party client

    • For Who-is, I-Am has not been received from the local Device.

    • Correct response is received for Read-Property : Object Identifier

    • Incorrect value is returned for APDU Timeout. As per the above code 3000 is expected, but returned 6000 which is never set.

    • Incorrect value for Protocol_Services_Supported.

    • Analog Value,1 added is not returned while reading Object-List.

    • Output of the print statements are correct.

    • In spite of client functionalities are not added in the above code, after receiving Who_Is from the 3rd party client local devices started sending ReadProperty requests, but not the I-Am.

    Please provide the solution. Your quick response is appreciated.

    Thanks & Regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hello,

    There is no other application running. When I terminate the server no response this local Device. But every time at the inititalize() command, I am getting exception.

    Further the values of device object, services that are modified and objects that are added not reflected in the local device. That is from the 3rd party client if I send the ReadProperty request, only the default values are returned and not the values that are set in the code. Probably I will raise another ticket with the code which help us to solve two different issues.

    Regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    When I run the code mentioned at the last following errors are received

    Exception in thread "main" java.net.BindException: Address already in use (Bind failed)
    at java.base/java.net.PlainDatagramSocketImpl.bind0(Native Method)
    at java.base/java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:131)
    at java.base/java.net.DatagramSocket.bind(DatagramSocket.java:394)
    at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:244)
    at com.serotonin.bacnet4j.npdu.ip.IpNetwork.initialize(IpNetwork.java:169)
    at com.serotonin.bacnet4j.transport.DefaultTransport.initialize(DefaultTransport.java:186)
    at com.serotonin.bacnet4j.LocalDevice.initialize(LocalDevice.java:316)

    The code is:
    public class App
    {
    public static void main( String[] args ) throws Exception
    {
    final int port = 47808;
    IpNetwork network;
    network = new IpNetworkBuilder()
    .withSubnet("192.168.1.0", 24)
    .withLocalBindAddress("192.168.1.107")
    .withPort(port)
    .build();
    Transport transport = new DefaultTransport(network);
    LocalDevice localDevice = new LocalDevice(1000, transport);
    try {
    localDevice.initialize();
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    The same exception is also received for localDevice.initialize(RestartReason.coldstart);

    Please provide solution.

    Regards,
    Kishore

    posted in BACnet4J general discussion read more
  • K
    kishorevenki

    Hi,

    Yes, I look for similar one. Since bitstringValue.java is not available under obj folder similar to other objects like AnalogInput.java etc...I thought bitStringValue is not supported.

    After your clarification I understand that bitStringValue object along with intrinsic reporting is supported.

    Please confirm.

    regards,
    Kishore

    posted in User help read more