Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

  • Errors with multi-segment messages.

    2
    0 Votes
    2 Posts
    2k Views
    S
    If the Bacnet console asks for information that is larger than the frame size, Transport->sendResponse() will use network->sendSegmented instead of network->sendAPDU. sendAPDU works great but sendSegmented is having problems with keys in the waiting room. When it sends the first segment Transport->sendSegments always comes back with a null response. This is causing a lot of hangs in the console as it waits for information. The console appears to be sending the correct response based on Wireshark.
  • How to set mac address for the virtual device

    3
    0 Votes
    3 Posts
    3k Views
    S
    Can you set it in your bootup scripts? If on linux you can put it either in the system startup or in the service script.
  • Multiple Devices on one physical Device

    7
    0 Votes
    7 Posts
    4k Views
    R
    Well, what shall I say... I tried it today without changing anything and there is no Exception and it does what it is supposed to.
  • Any plan to use git? (Github)

    4
    0 Votes
    4 Posts
    2k Views
    F
    Awesome! My google-fu failed me... I always end up on the sourceforge repo. :oops:
  • A free webserver built on top of BACnet4J

    3
    0 Votes
    3 Posts
    3k Views
    F
    New version of Wacnet! (1.1.0) As usual, completely free! [image: YFuJMJv.gif] Detailed review of what changed: http://blog.hvac.io/2014/07/01/new-wacnet-release-110/ Download link and instructions: https://hvac.io/docs/wacnet
  • Foreign Device Registry Answer

    2
    0 Votes
    2 Posts
    2k Views
    D
    The APDU frame length of a Foreign Device Registry Answer message is six bytes long. The IncomingRequestParser.parseApdu() immediately sends all messages to the NPCI constructor, regardless of length checks, which subsequently chokes (array out of bounds) due to queue.size() being zero. I've inserted a couple changes to the source code to address this: First, in IpNetwork.parseFrame(): if (function != 0xa && function != 0xb && function != 0x4 && function != 0x0 && function != 0x5) throw new MessageValidationAssertionException("Function is not unicast, broadcast, forward" + " or foreign device reg answer (0xa, 0xb, 0x4, 0x0, or 0x5)"); "function != 0x05" is missing from the original method, and prematurely chokes the method. Secondly, I enclosed all of the lines in IncomingRequestParser.parseApdu() in the following if-statement: if (queue.size() > 6) With a "return null;" to satisfy the return type. This is logically avoiding all exceptions I've been experiencing while doing a device discovery across sub-nets. Because I'm not wholly aware of what else uses these methods, I cannot be certain if I have not broken something else yet. Anyone with any more familiarity, please advise! The Dolphin's Grin Edit: Realized that checking queue.size() >6 was more effective than setting and referencing an "isForeignDevMsg" flag.
  • Updated JavaDoc for BACnet4J Version 1.3

    3
    0 Votes
    3 Posts
    3k Views
    B
    Thanks, that's quite helpful.
  • Multi-state fault

    2
    0 Votes
    2 Posts
    2k Views
    W
    Hi, If I have a multi-state input that is currently unknown (i.e. I don't have enough information to compute its state) should I set Reliability to Reliability.multiStateFault ? Basically I'm looking for a way to indicate "unknown" without having to define a completely separate state for "unknown" (as that would be confusing here - what I'm building is really more of a proxy to an existing system). I'm having trouble, even within the bacnet spec book, figuring out how I'm really supposed to use MultiStateFault. --Chris
  • Device Discovery Across Subnets

    7
    0 Votes
    7 Posts
    4k Views
    D
    So, I successfully fired off a "Register Foreign Device" broadcast, resulting in a fireworks-display of exceptions being thrown, but all subsequent sendGlobalRequest() return perfectly. Here is my call: network.sendRegisterForeignDeviceMessage(network.getLocalBroadcastAddress().getMacAddress().getInetSocketAddress(),1000); Where network is an instance of IpNetwork with all default values. The "Register-Foreign-Device" function code is 0x05, which the frame parser throws a hissy-fit about: com.serotonin.bacnet4j.npdu.MessageValidationAssertionException: Function is not unicast, broadcast, forward or foreign device reg anwser (0xa, 0xb, 0x4 or 0x0) at com.serotonin.bacnet4j.npdu.ip.IpNetwork$IncomingMessageExecutor.parseFrame(IpNetwork.java:275) at com.serotonin.bacnet4j.npdu.IncomingRequestParser.run(IncomingRequestParser.java:37) at com.serotonin.bacnet4j.npdu.ip.IpNetwork.run(IpNetwork.java:242) at java.lang.Thread.run(Unknown Source) Foreign device registration not successful! result: 48 java.lang.ArrayIndexOutOfBoundsException: -1 at com.serotonin.util.queue.ByteQueue.pop(ByteQueue.java:221) at com.serotonin.util.queue.ByteQueue.popU1B(ByteQueue.java:236) at com.serotonin.bacnet4j.npdu.NPCI.<init>(NPCI.java:105) at com.serotonin.bacnet4j.npdu.IncomingRequestParser.parseApdu(IncomingRequestParser.java:64) at com.serotonin.bacnet4j.npdu.IncomingRequestParser.run(IncomingRequestParser.java:40) at com.serotonin.bacnet4j.npdu.ip.IpNetwork.run(IpNetwork.java:242) at java.lang.Thread.run(Unknown Source) Foreign device registration not successful! result: 48 Any insight as to how to do this cleaner would be appreciated. I can't shake the feeling I'm breaking something when so much red floods my screen. Thanks again! Always Monday! Dolphin's Grin P.S. After passing this foreign device message, the foreign devices (devices on other subnets) address BOTH my machine's specific IP address, and its local subnet broadcast.
  • SeroUtils sourcecode?

    5
    0 Votes
    5 Posts
    5k Views
    L
    That's good news, but I see the commits started on March 2014. Is there any possibility to get the same version as included in mango 1.12.3 and 1.12.4? Best Regards, Andres Ponte
  • Method request: remove a remote device

    3
    0 Votes
    3 Posts
    2k Views
    F
    I implemented it locally and it seems to work. Here is the code: public void removeRemoteDevice(int instanceId) throws BACnetException { RemoteDevice d = getRemoteDeviceImpl(instanceId, null, null); if (d != null) remoteDevices.remove(d); else throw new BACnetException("Unknown device: instance id=" + instanceId); }
  • Talking to devices without discovery

    5
    0 Votes
    5 Posts
    3k Views
    F
    Glad to hear you don't expose your BACnet port! I'm a little rusty on the discovery process. When answering a WhoIs, isn't the gateway supposed to send you the list of devices it knows about? As a patch, perhaps you could 'scan' for these devices every once in a while to make sure you have all of them. Say all device from ID 0 to 99 (or whatever is their ID range).
  • Segmented Answer -> Timeout while waiting for APDU id

    2
    0 Votes
    2 Posts
    2k Views
    T
    Hello, i am struggling with sending segmented answers: I implemented a "virtual" local device with some objects and testing it with various test-clients like "BrightCore BACnet Lookout" or "WAGO BACnet Configurator". Everything is fine until I have around 300 BacNetObjects so that the answer to this request ``` Confirmed-REQ readProperty[ 1] device,1234 object-list has to be segmented. BACnet4J sends back the first segment ``` Complex-ACK readProperty[ 1] (Message fragment 0) ``` and wait for an ACK, which is visible in wireshark (``` Segment-ACK ```), but not recognized by BACnet4J. After 3 retries i got a timeout :cry: i am debugging in eclipse alot, but i cant figure out why the Segment-ACK-Answer from my client is ignored. Any suggestions? Thank you!
  • Where/how to start?

    4
    0 Votes
    4 Posts
    3k Views
    R
    I have a similar problem like you had in BacnetTest. In my project I get an exception when I call "new LocalDevice(1234, transport);". I stepped in up to this point. private void setPropertyImpl(PropertyIdentifier pid, Encodable value) { Encodable oldValue = properties.get(pid); properties.put(pid, value); if (!ObjectUtils.equals(value, oldValue)) { // Check for subscriptions. if (ObjectCovSubscription.sendCovNotification(id.getObjectType(), pid, this.getCovIncrement())) { synchronized (covSubscriptions) { long now = System.currentTimeMillis(); ObjectCovSubscription sub; for (int i = covSubscriptions.size() - 1; i >= 0; i--) { sub = covSubscriptions.get(i); if (sub.hasExpired(now)) covSubscriptions.remove(i); else if (sub.isNotificationRequired(pid, value)) sendCovNotification(sub, now); } } } } } The error occurs in the if-statement "ObjectUtils.equals(value, oldValue)". Bizarrely the error doesn't occur in my BacnetTest :-/ Has anybody solved this problem by now?
  • Address already in use when configuring multiple devices

    12
    0 Votes
    12 Posts
    7k Views
    S
    At the moment that is the big hammer approach. I am experimenting with setting up a virtual network on the linux system just for the bacnet devices. I will let you know how that goes. The ifconfig and ip commands can do the same things. the ip command can do more but for this application ifconfig is just fine. I am going to start a blog of my experiences and give some same code once I get this thing working (just about ready). Scott
  • Problem with getting object-list from device

    3
    0 Votes
    3 Posts
    2k Views
    S
    Thanks! I was just pulling my hair out on a similar problem.
  • Bind Address does not seem to be working

    2
    0 Votes
    2 Posts
    2k Views
    S
    I have multiple devices on the same physical platform. I have added multiple IP addresses to the NIC and then created devices that use the standard port but different address with the "bind address" when creating an UpNetwork object. If I use one device with the primary IP and one with a newly bound address, then send a IAM broadcast, the console sees both devices but can only query the one bound to the primary address. The other one is reporting the same address! Am I missing something here? If I use the same address but increment the port I get the same problem of the first can be queried and the second cannot. Scott
  • 0 Votes
    2 Posts
    1k Views
    S
    When creating a series of device objects you are forced to increment the port on each one. If you do not there is a "Cannot create device, address in use" problem. However, the incrementing port is a problem as the BACNET console is not seeing any device that is not on the standard port. Any ideas?
  • ErrorAPDU(choice=15, errorClass=Property, errorCode=Write access denied)

    3
    0 Votes
    3 Posts
    3k Views
    S
    Are you running as root? I think you will need to be.
  • Reading trendlog data

    9
    0 Votes
    9 Posts
    5k Views
    M
    HI can any one please help me on this .... package com.lnt.TestApp; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.serotonin.bacnet4j.LocalDevice; import com.serotonin.bacnet4j.RemoteDevice; import com.serotonin.bacnet4j.enums.MaxApduLength; import com.serotonin.bacnet4j.exception.BACnetException; import com.serotonin.bacnet4j.npdu.ip.IpNetwork; import com.serotonin.bacnet4j.service.acknowledgement.AcknowledgementService; import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck; import com.serotonin.bacnet4j.service.acknowledgement.ReadRangeAck; import com.serotonin.bacnet4j.service.confirmed.ConfirmedRequestService; import com.serotonin.bacnet4j.service.confirmed.ReadPropertyRequest; import com.serotonin.bacnet4j.service.confirmed.ReadRangeRequest; import com.serotonin.bacnet4j.service.confirmed.ReadRangeRequest.BySequenceNumber; import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest; import com.serotonin.bacnet4j.transport.Transport; import com.serotonin.bacnet4j.type.Encodable; import com.serotonin.bacnet4j.type.constructed.Address; import com.serotonin.bacnet4j.type.constructed.LogRecord; import com.serotonin.bacnet4j.type.constructed.SequenceOf; import com.serotonin.bacnet4j.type.enumerated.ObjectType; import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier; import com.serotonin.bacnet4j.type.enumerated.Segmentation; import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier; import com.serotonin.bacnet4j.type.primitive.OctetString; import com.serotonin.bacnet4j.type.primitive.SignedInteger; import com.serotonin.bacnet4j.type.primitive.UnsignedInteger; import com.serotonin.bacnet4j.util.PropertyReferences; import com.serotonin.bacnet4j.util.PropertyValues; import com.serotonin.bacnet4j.util.RequestUtils; public class Test { static LocalDevice lDevice; static Address addr = new Address(0, "172.28.14.100"); public Test() { } public static void main(String args[]) { initializeDevice(); } public static void initializeDevice() { try { System.out.println("Initializing..."); IpNetwork ipNetwork = new IpNetwork("172.28.14.255", 47808, "172.28.14.63"); Transport transport = new Transport(ipNetwork); lDevice = new LocalDevice(9899, transport); lDevice.initialize(); lDevice.getEventHandler().addListener(new Listener()); lDevice.sendGlobalBroadcast(new WhoIsRequest()); Thread.sleep(500); getObjectList(lDevice, "172.28.14.100", 47808, 0); } catch (Exception e) { System.out.println("Error : " + e.getMessage()); } finally { closeDevice(); } } public static AcknowledgementService send(LocalDevice d, ConfirmedRequestService s) throws Exception { // Address a = new Address(InetAddrCache.get("localhost", 0xbac1)); return d.send(addr, null, MaxApduLength.UP_TO_1476, Segmentation.segmentedBoth, s); } public static void closeDevice() { try { lDevice.terminate(); } catch (Exception e) { System.out.println(e.getMessage()); } } private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) { RemoteDevice fileDev = null; ObjectIdentifier file = null; ReadPropertyRequest readPropertyRequest; ReadPropertyAck reaPropertyAck; UnsignedInteger referenceIndex = null; SignedInteger signedInteger = null; Address address[] = lDevice.getAllLocalAddresses(); OctetString octetString = new OctetString("172.28.14.63", 47808); RemoteDevice dev3400 = null; //try { //dev3400 = lDevice.findRemoteDevice(address[0], octetString, 0); dev3400 = lDevice.getRemoteDevice(address[0]); //} catch (BACnetException e1) { // TODO Auto-generated catch block // e1.printStackTrace(); //} for (RemoteDevice d : localDevice.getRemoteDevices()) { // ObjectIdentifier oid = d.getObjectIdentifier(); RemoteDevice rd = new RemoteDevice(123, localDevice.getAllLocalAddresses()[0], octetString); @SuppressWarnings("unchecked") List<ObjectIdentifier> oids; try { oids = ((SequenceOf<ObjectIdentifier>) RequestUtils .sendReadPropertyAllowNull(localDevice, d, d.getObjectIdentifier(), PropertyIdentifier.objectList)).getValues(); for (ObjectIdentifier oid : oids) { readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.objectName); reaPropertyAck = (ReadPropertyAck) localDevice.send(d,readPropertyRequest); System.out.println("Value: " + reaPropertyAck.getValue()); if (oid.getObjectType().equals(ObjectType.trendLog)) { readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.objectName); reaPropertyAck = (ReadPropertyAck) localDevice.send(d, readPropertyRequest); System.out.println("ObjectName: "+ reaPropertyAck.getValue()); readPropertyRequest = new ReadPropertyRequest(oid,PropertyIdentifier.bufferSize); reaPropertyAck = (ReadPropertyAck) localDevice.send(d,readPropertyRequest); System.out.println("BufferSize: "+ reaPropertyAck.getValue()); readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.totalRecordCount); reaPropertyAck = (ReadPropertyAck) localDevice.send(d, readPropertyRequest); System.out.println("totalRecordCount: " + reaPropertyAck.getValue()); // Encodable totalRecordCount = // reaPropertyAck.getValue(); readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.recordCount); reaPropertyAck = (ReadPropertyAck) localDevice.send(d, readPropertyRequest); System.out.println("RecordCount: "+ reaPropertyAck.getValue()); // Encodable recordCount = reaPropertyAck.getValue(); readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.eventState); reaPropertyAck = (ReadPropertyAck) localDevice.send(d, readPropertyRequest); System.out.println("eventState: " + reaPropertyAck.getValue()); readPropertyRequest = new ReadPropertyRequest(oid,PropertyIdentifier.totalRecordCount); reaPropertyAck = (ReadPropertyAck) lDevice.send(d,readPropertyRequest); System.out.println("TotalRecordCount: "+ reaPropertyAck.getValue()); UnsignedInteger totalRecordCount = (UnsignedInteger) reaPropertyAck.getValue(); readPropertyRequest = new ReadPropertyRequest(oid, PropertyIdentifier.recordCount); reaPropertyAck = (ReadPropertyAck) lDevice.send(d, readPropertyRequest); System.out.println("RecordCount: "+ reaPropertyAck.getValue()); UnsignedInteger recordCount = (UnsignedInteger) reaPropertyAck.getValue(); signedInteger = new SignedInteger(recordCount.bigIntegerValue()); referenceIndex = new UnsignedInteger(totalRecordCount.longValue() - signedInteger.longValue() - 1); ReadRangeRequest rrr = new ReadRangeRequest(new ObjectIdentifier(ObjectType.trendLogMultiple, 11), PropertyIdentifier.logBuffer, null, new BySequenceNumber(referenceIndex,signedInteger)); //lDevice.send(d, rrr); ReadRangeAck rra = (ReadRangeAck)lDevice.send(d, rrr); System.out.println(rra.getItemCount()); System.out.println(rra.getFirstSequenceNumber()); System.out.println(rra.getItemData()); Iterator<?> it = (Iterator<?>)rra.getItemData().iterator(); while (it.hasNext()) { Encodable e = (Encodable)it.next(); if (e instanceof LogRecord) { LogRecord lr = (LogRecord)e; //System.out.println(lr.getBaseType()); System.out.println(lr.getChoiceType()); } } } } } catch (BACnetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } I am able to read bacnet objets, but i want to read trendlog contentes in my code when the flo comes ReadRangeRequest and ReadRangeAc am getting bacnet timeout exception can u please see the code and guid me on this...