Menu

Real Devices

Help
Lara Braga
2012-05-14
2021-11-09
  • Lara Braga

    Lara Braga - 2012-05-14

    Hello,

    I'm trying to communicate with a real device, but I got a trouble.

    Setting BACNET environment variables I can find my controller device with
    ./bacwi.

    But with "./bacepics -v 12", I got "Error: Unable to bind to 12 after waiting
    10 seconds.

    Error: APDU Timeout! (11s)".

    Because of the binding error I tried "./bacepics -t C0:A8:C8:11:BA:C0 12" and
    again I got

    "List of Objects in device 12:

    {

    {

    Error: APDU Timeout! (10s)

    }"

    And more, in wireshark the only thing I can see is the controller looking for
    a network router.

    For while, I don't know what to do.

    Please, I need help!

    Thanks in advance,

    Lara

     
  • Steve Karg

    Steve Karg - 2012-05-22

    Hi Lara,

    I can get the "Error: Unable to bind to 123 after waiting 10 seconds." and
    "Error: APDU Timeout! (11s)" if I use a Device ID that does not exist.

    $ ./bacwi -1

    Received I-Am Request from 18, MAC = 192.168.0.18.186.192

    Received I-Am Request from 2401, MAC = 192.168.0.24.186.192

    Received I-Am Request from 1234, MAC = 192.168.0.24.186.192

    Received I-Am Request from 90, MAC = 192.168.0.18.186.192

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    18 C0:A8:00:12:BA:C0 0 0 1476

    2401 C0:A8:00:18:BA:C0 0 0 480

    1234 C0:A8:00:18:BA:C0 26001 7F 50

    90 C0:A8:00:12:BA:C0 4 07 128

    ;

    ; Total Devices: 4

    $ ./bacepics -v 123

    Error: Unable to bind to 123 after waiting 10 seconds.

    Error: APDU Timeout! (11s)

    What did you set your BACNET_IFACE environment variable? I am using:

    $ export BACNET_IFACE=eth0

    Best Regards,

    Steve

     
  • Lara Braga

    Lara Braga - 2012-05-28

    Hi Steve,

    Thank you for your reply.

    And... Yes, I am using eth0 interface.

    I can bind the device but a can't read the properities yet.

    At another forum post, you've talked about firewall and NAT.

    I am using a cross cable to link my PC with the controller.

    So NAT isn't a problem and I disabled the firewall.

    I am a little lost about what to do now to solve this.

    Do you have an idea?

    Thank you in advance,

    Lara

     
  • Lara Braga

    Lara Braga - 2012-05-28

    Hello Steve,

    One more thing...

    I am setting the environment variables

    BACNET_APDU_TIMEOUT=12000,

    BACNET_IFACE=eth0,

    BACNET_IP_PORT=47808,

    BACNET_BBMD_PORT=47808,

    BACNET_BBMD_TIMETOLIVE=120000

    and exporting them.

    But in wireshark I can't see my PC traffic at eth0. Just the controller asking
    for IP.

    And I got error trying to read the properities either of the controller or of
    a virtual device using ./bin/bacepics.

    What am I doing wrong?

    Thanks,

    Lara

     
  • Steve Karg

    Steve Karg - 2012-05-28

    Hi Lara,

    As long as you are not exporting BACNET_BBMD_ADDRESS, it should work to
    discover and read/write to the device. If you export BACNET_BBMD_ADDRESS, the
    client tools will attempt to register as a foreign device with that target
    address over the BACNET_BBMD_PORT with a BACNET_BBMD_TIMETOLIVE. So unless you
    are needing to register as a foreign device, I wouldn't define any of those
    BBMD environment variables.

    Is there another service using the BACnet UDP port? What does netstat show?

    $ netstat --numeric-ports --udp --listening

    What does the bacwi -1 show? Can you post that info?

    What is your PC IP address?

    What is the IP address of your controller? If the controller is asking for an
    IP address, does it get it? (i.e. is it configured for DHCP and there is no
    DHCP server).

    It's possible that your PC and the device are in exclusive subnets, but that
    broadcast (discovery with WhoIs) somehow works.

    Best Regards,

    Steve

     
  • Lara Braga

    Lara Braga - 2012-05-28

    Hi Steve,

    Just to show you what I got:

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0/bin$ ./bacwi -1

    BACNET_APDU_TIMEOUT=12000

    Received I-Am Request from 1234, MAC = 172.10.10.69.186.192

    Received I-Am Request from 12, MAC = 192.168.200.17.186.192

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    1234 AC:0A:0A:45:BA:C0 0 0 1476

    12 C0:A8:C8:11:BA:C0 0 0 480

    ;

    ; Total Devices: 2

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0/bin$ ./bacepics -v 12

    BACNET_APDU_TIMEOUT=12000

    List of Objects in device 12:

    {

    {

    Error: APDU Timeout! (37s)

    }

     
  • Lara Braga

    Lara Braga - 2012-05-28

    Hi again Steve,

    Now, the controller and my PC are in the office network.

    I set the BBMD and exported it with the IPv4 of the eth0 (172.10.10.46).

    Now, I can see some traffic in wireshark.

    And I got this:

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0/bin$ ./bacwi -1

    BACNET_APDU_TIMEOUT=12000

    Registering with BBMD at 172.10.10.46:47808 for 65535 seconds

    Received I-Am Request from 1234, MAC = 172.10.10.46.186.192

    Received I-Am Request from 12, MAC = 192.168.200.17.186.192

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    1234 AC:0A:0A:2E:BA:C0 0 0 1476

    12 C0:A8:C8:11:BA:C0 0 0 480

    ;

    ; Total Devices: 2

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0/bin$ ./bacepics -v 12

    BACNET_APDU_TIMEOUT=12000

    Registering with BBMD at 172.10.10.46:47808 for 65535 seconds

    List of Objects in device 12:

    {

    {

    Error: APDU Timeout! (37s)

    }

    The controller got the IP 192.168.200.17.

    But I am little lost with the ($ netstat --numeric-ports --udp --listening)
    answer

    Proto Recv-Q Send-Q Endereço Local Endereço Remoto Estado

    udp 0 0 0.0.0.0:68 0.0.0.0:*

    udp 0 0 0.0.0.0:46698 0.0.0.0:*

    udp 0 0 0.0.0.0:47808 0.0.0.0:*

    udp 25111 0 0.0.0.0:47808 0.0.0.0:*

    udp 0 0 0.0.0.0:5353 0.0.0.0:*

    udp6 0 0 :::58313 :::*

    udp6 0 0 :::5353 :::*

    Thank you in advance,

    Lara

     
  • Steve Karg

    Steve Karg - 2012-05-28

    Hi Lara,

    BACnet/IP uses, by default, port 47808 (0xBAC0). If another program or
    application is using BACnet/IP, then netstat would show there is a listener at
    port 47808:

    udp 0 0 0.0.0.0:47808 0.0.0.0:*

    udp 25111 0 0.0.0.0:47808 0.0.0.0:*

    And it does show a listener at port 47808. That means that bacepics, bacrp,
    etc., will not be able to use port 47808 to read or write to devices since
    another BACnet application uses port 47808. You will need to stop the other
    application, or use Foreign Device Registration on another port to that
    application if it supports BBMD.

    Are you running ./bacserv 1234 in another shell? If so, exit that application.
    Alternately, the bacserv application includes BBMD support, so you could just
    use another port, and use the Foreign Device Registration built into the
    client tools.

    set the BBMD address my device that supports BBMD:

    $ export BACNET_BBMD_ADDRESS= 192.168.200.17

    set the bacnet-tools to use port 47809:

    $ export BACNET_IP_PORT=47809

    run the EPICS

    $ ./bacepics 12

    Best Regards,

    Steve

     
  • Lara Braga

    Lara Braga - 2012-06-04

    Hello again Steve,

    Bad news. I tried, but without success.

    I changed the IP port and the BBMD and they don't work. When I tried the who-
    is command, there was no answer. Neither with the bacepics.

    What do you think about it? What can I try?

    The following is what I've got:

    lara@lara:~$ export BACNET_IFACE=eth0

    lara@lara:~$ export BACNET_BBMD_ADDRESS=192.168.200.17

    lara@lara:~$ export BACNET_BBMD_TIMETOLIVE=120000

    lara@lara:~$ export BACNET_APDU_TIMEOUT=120000

    lara@lara:~$ export BACNET_BBMD_PORT=47809

    lara@lara:~$ export BACNET_IP_PORT=47808

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacwi -1

    BACNET_APDU_TIMEOUT=120000

    Registering with BBMD at 192.168.200.17:47809 for 65535 seconds

    ^Z

    • Parado ./bin/bacwi -1
      lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export BACNET_IP_PORT=47809

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export BACNET_BBMD_PORT=47808

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacwi -1

    BACNET_APDU_TIMEOUT=120000

    Registering with BBMD at 192.168.200.17:47808 for 65535 seconds

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    ;

    ; Total Devices: 0

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export
    BACNET_BBMD_ADDRESS=172.10.10..46

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacwi
    -1BACNET_APDU_TIMEOUT=120000

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    ;

    ; Total Devices: 0

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export BACNET_IP_PORT=47808

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacwi -1

    BACNET_APDU_TIMEOUT=120000

    Received I-Am Request from 1234, MAC = 172.10.10.69.186.192

    Received I-Am Request from 12, MAC = 192.168.200.17.186.192

    ;Device MAC SNET SADR APDU

    ;------- -------------------- ----- -------------------- ----

    1234 AC:0A:0A:45:BA:C0 0 0 1476

    12 C0:A8:C8:11:BA:C0 0 0 480

    ;

    ; Total Devices: 2

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export BACNET_IP_PORT=47809

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ export
    BACNET_BBMD_ADDRESS=192.168.200.17

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacepics 12

    BACNET_APDU_TIMEOUT=120000

    Registering with BBMD at 192.168.200.17:47808 for 65535 seconds

    Error: Unable to bind to 12 after waiting 163 seconds.

    Error: APDU Timeout! (164s)

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$ ./bin/bacepics -t C0:A8:C8:11:BA:C0
    12

    BACNET_APDU_TIMEOUT=120000

    Registering with BBMD at 192.168.200.17:47808 for 65535 seconds

    List of Objects in device 12:

    {

    {

    Error: APDU Timeout! (163s)

    }

    lara@lara:~/Ubuntu One/bacnet-stack-0.6.0$

    So, with BBMD at my PC IP 172.10.10.46 and with IP PORT at 47808 is the only
    way I can find the devices.

    Another issue, in wireshark the object identifier is: device, 100. I was
    waiting for 12. There's something wrong on it?

    Thank you very much in advance,

    Lara

     
  • Lara Braga

    Lara Braga - 2012-06-04

    Sorry Steve,

    There is no problem with the identifier.

    There is another device of the same vendor on the net.

    The controller is the device 12!

     
  • Steve Karg

    Steve Karg - 2012-06-04

    Hi Lara,

    BACnet/IP needs to have exclusive access to UDP port 47808, so no other
    application can use that port. If there is another BACnet application or
    service running on your PC using that port, the bacnet-tools will not work
    correctly. The netstat results indicated that there was another application
    running, so the tools will not work if netstat shows a listener at 47808.

    Can you try using the latest version of the BACnet stack tools (currently
    0.7.1)? There have been improvements since 0.6.0.

    Best Regards,

    Steve

     
  • Lara Braga

    Lara Braga - 2012-06-04

    Hi again Steve,

    Thank you very much for your help.

    I've to tell you that the fault was mine.

    I was working with the controller without checking its net configuration.

    The UDP/IP option was unenabled. So, I checked it with the Orcaview and now I
    can read the properities.

    One more,

    Thanks,

    Lara

    PS: topic solved!

     
  • Mikael Dallaire

    Mikael Dallaire - 2021-11-09

    Hello Steeve,

    I have a similar issue where the port 47809 is used by controllers to communicate.
    So i set BACNET_BBMD_PORT=47809.

    For a reason I ignore, if i set BACNET_IP_PORT to anything else than 47809, nothing works. Maybe the controllers are not able to answer on a other port than the one they are configured ?

    The problem I have is that the bacnet server running on this pc already uses UDP:47809 , so bacwi will not work until i kill the server application because the port is already reserved.

    I red on a website that UDP port can be configured to be used by multiple application using SO_REUSEPORT option. Is that something you hear about?

    https://stackoverflow.com/questions/1694144/can-two-applications-listen-to-the-same-port

    My last option is to use an other computer that have no bacnet server running on it... But this is not by easiest option !

     

Log in to post a comment.