• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    "Hello World" BACNet device

    BACnet4J general discussion
    3
    7
    5.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      skodan
      last edited by

      Hi, I'm trying to get a minimum BACNet device going but it doesn't seem to respond. The code is as small as I could make it:

      LocalDevice dev = new LocalDevice(76, new DefaultTransport(new IpNetwork("192.168.2.255", 47808, "192.168.2.104", "255.255.255.0", 0, false)));
      BACnetObject obj = createAnalogValue(1);
      dev.addObject(obj);
      dev.initialize();
      

      When I try to "ping" it with a tool like:

      bacnet-stack-0.8.3/bin/bacwi
      

      nothing happens.
      I'm certain I'm doing something stupid but I can't find any example or even something similar to this in the test directory. Any help to get me started is appreciated.

      1 Reply Last reply Reply Quote 0
      • S
        ssimm
        last edited by

        bacnet-stack-0.8.3 is Steve Karg's C implementation of the BACNet protocol, if I'm not mistaken. It uses BACNET/IP as the transport layer and bacnet4j uses MS/TP as the transport layer. That might be why one doesn't see the other. I have both too and would also like to see them working together.

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          BACnet4J supports both MSTP and IP

          1 Reply Last reply Reply Quote 0
          • S
            ssimm
            last edited by

            I like that answer even better.

            So, three questions (I'm using the bacnet4j library v3.2.4)
            Here is my initialization of a localObject:
            IpNetwork network = new IpNetworkBuilder().broadcastIp(broadcastIPString).localBindAddress(ipAddressString).port(port).subnetMask(subnetMaskString).build();
            DefaultTransport transport = new DefaultTransport(network);
            LocalDevice localDevice = new LocalDevice(deviceID, transport);

            1.Am I using MS/TP or BACNet/IP?
            2.Given an artibrary localDevice, how you do tell which of these two it is using?
            3.Whichever I'm using above, how do I initalize my localObject with the other protocol? (e.g. if the above is MS/TP, how do I change it to use BACNet/IP)?

            Thanks, much obliged.

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by phildunlap

              1. IP, hence the "IpNetwork" and "IpNetworkBuilder" instead of MstpNetwork
              2. if( localDevice.getNetwork() instanceof IpNetwork ) return "It's an IP network!";
              3. Create an MstpNetwork and pass it to new DefaultTransport( mstpNetwork );
              1 Reply Last reply Reply Quote 1
              • S
                ssimm
                last edited by

                Ah, so simple. Facepalm moment for me.
                Thanks for the tip!

                1 Reply Last reply Reply Quote 0
                • S
                  skodan
                  last edited by

                  Thank you, will try this. Have moved forward with my project (simulation of offices/SCADA/ICS systems) but parked the BACnet connection, will work it into the backlog.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post