Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 29 02:09
    github-actions[bot] unlabeled #268
  • Nov 28 10:17
    trollkarlen commented #268
  • Nov 28 02:06
    github-actions[bot] labeled #268
  • Nov 28 02:06
    github-actions[bot] commented #268
  • Nov 28 02:06
    github-actions[bot] labeled #273
  • Nov 28 02:06
    github-actions[bot] commented #273
  • Nov 25 14:37
    ChristianTremblay commented #302
  • Nov 17 17:52
    iamliamc edited #302
  • Nov 17 17:46
    iamliamc opened #302
  • Nov 13 21:31
    jorgenfb edited #301
  • Nov 13 21:30
    jorgenfb opened #301
  • Nov 01 17:32

    ChristianTremblay on develop

    Trying to improving recurring t… (compare)

  • Oct 31 20:35

    ChristianTremblay on develop

    Added support to add local obje… (compare)

  • Oct 31 02:11
    github-actions[bot] closed #281
  • Oct 28 20:02

    ChristianTremblay on develop

    Vendor id was not handled corre… Merge branch 'develop' of githu… (compare)

  • Oct 27 11:58
    VigneshwaranKR opened #300
  • Oct 24 02:10
    github-actions[bot] labeled #281
  • Oct 24 02:10
    github-actions[bot] commented #281
  • Oct 23 00:31

    ChristianTremblay on develop

    Work to improve BBMD. Modified … Merge branch 'develop' of https… (compare)

  • Oct 22 17:39

    ChristianTremblay on develop

    Working on DateTimeValue support Adding support to create XML fi… (compare)

Christian Tremblay
@ChristianTremblay
I'll have to investigate, let me know if you find something on your side.
Ben Bartling
@bbartling

How do you ovrride an BO with BAC0? When I read the BO is comes thru as active

If I run:

import BAC0, time, random


bacnet = BAC0.lite()

address = '12345:2'
object_type = 'binaryOutput'
object_instance = '1'
value = 'False'


read_vals = f'{address} {object_type} {object_instance} presentValue'
check = bacnet.read(read_vals)
print("check ",check)

write_vals = f'{address} {object_type} {object_instance} presentValue {value}'
print("Excecuting write_vals statement:", write_vals)

write_result = bacnet.write(write_vals)

read_vals = f'{address} {object_type} {object_instance} presentValue'
check = bacnet.read(read_vals)
print("check ",check)

bacnet.disconnect()
print('BACnet disconnected')

I cant get to the end of the code it doesnt like what I am trying to write.

check  active
Excecuting write_vals statement: 12345:2 binaryOutput 1 presentValue False
Ben Bartling
@bbartling
Ah, I had to google whats the opposite of active using value = 'inactive' works
image.png
Christian Tremblay
@ChristianTremblay
:-)
John Jensen
@jensenja
hi all. trying to figure out where i'm going wrong. i have an instance of ALC that i'm doing testing with. I'm having ALC subscribe to an Analog Value that I'm creating within BAC0 in order for BAC0 to send out CoV notifications for.
it works, but only if the controller doing the subscribing is on the same subnet as the machine running BAC0
I thought that I'd have to tell BAC0 to connect to a BBMD using connect(), but when I do this, I'm no longer able to add analog values to BAC0 using add_objects_to_application()
I get this error
Traceback (most recent call last):
  File "/root/bacnet/./test_cov.py", line 49, in <module>
    main()
  File "/root/bacnet/./test_cov.py", line 41, in main
    initialize_objects(bacnet_device)
  File "/root/bacnet/./test_cov.py", line 25, in initialize_objects
    _new_objects.add_objects_to_application(bacdev)
  File "/usr/local/lib/python3.10/site-packages/BAC0/core/devices/local/object.py", line 186, in add_objects_to_application
    raise TypeError("Provide BAC0Application object or BAC0 Base instance")
TypeError: Provide BAC0Application object or BAC0 Base instance
John Jensen
@jensenja
here's the full code
#!/usr/bin/env python

import BAC0
from BAC0.core.devices.local.models import analog_value
import logging
import random
import sys
import time


logging.basicConfig(
    stream=sys.stderr,
    level=logging.DEBUG,
    format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
)

log = logging.getLogger(__name__)


def initialize_objects(bacdev):
    _new_objects = analog_value(
        name='a_test_point',
        presentValue=0
    )
    _new_objects.add_objects_to_application(bacdev)


def update_values(bacdev):
    i = random.randint(1, 65535)
    log.debug('setting new value of a_test_point to {}'.format(i))
    bacdev['a_test_point'].presentValue = i


def main():
    #BAC0.log_level('silence')
    #bacnet_device = BAC0.lite(deviceId=4169000, localObjName='cov_test')
    bacnet_device = BAC0.connect(ip='10.15.4.253/24', bbmdAddress='10.15.88.48:47808', bbmdTTL=900)
    #for i in dir(bacnet_device):
    #    print(i)
    #print(type(bacnet_device))
    initialize_objects(bacnet_device)
    #while True:
        #pass
        #update_values(bacnet_device)
        #time.sleep(32)


if __name__ == "__main__":
    main()
if I basically comment out the call to connect() and uncomment everything else, it works fine, but again only if the controller doing the subscribing is on the same subnet (10.15.4.0/24) as the BAC0 device.
John Jensen
@jensenja
what i'm really not understanding is that if i do print(type(bacnet_device)) for each invocation of BAC0, they're both showing the exact same thing: <class 'BAC0.scripts.Lite.Lite'>
John Jensen
@jensenja
just as an FYI on the last messages, we're going to make sure that our existing BBMD's are functioning the way they should - my building engineer doesn't believe that BAC0 should be registering as a foreign device in order for the subscriptions to work
Christian Tremblay
@ChristianTremblay
@jensenja good catch.. if the app was defined as foreign device or BBMD, it failed... it is now fixed in the develop branch
John Jensen
@jensenja
hey thanks @ChristianTremblay! I'm not sure if this will solve our problem (myself and the other guy are now questioning if subscriptions were ever intended to cross subnet boundaries) but I'll check this out and give it a test!
Christian Tremblay
@ChristianTremblay
If your network is setup properly, and device 1 sees device 2, cov will work.
Safrone
@Safrone
image.png
Hey yall, trying to discover some bacnet devices and didn't have any luck. Sometimes this is because we have our device on the wrong subnet so I did some wireshark sniffing. Usually I'm able to use the output to find the broadcast IP to figure out what mask I should be using for the subnet to fix things but I got some different looking output
Does anyone have experience with this kind of messaging? I've never seen the source/destination look like Mac addresses so I'm not sure what to test out here
Joel Bender
@JoelBender
Please expand one of the packets to look at the layers, you are probably dealing with BACnet over Ethernet.
Safrone
@Safrone
image.png
that does look like it
just surprised I'm able to see it then via wireshark. IDK the best way to initiate discovery given this
Joel Bender
@JoelBender
Next two octets after the length are probably X’82’, check out the hex piece.
You’ll need some IPv4-to-Ethernet BACnet router. I bet one of the devices is already doing that.
Safrone
@Safrone
image.png
yup
Safrone
@Safrone
@JoelBender Would this require specific hardware or is there a script that would enable this. I didn't see any responses to my ipv4 discovery requests so probably will need some talking to the client
Joel Bender
@JoelBender
It looks like you are talking to a device from Delta Controls and since it speaks BACnet/Ethernet, unless it is a very old device, it also speaks BACnet/IPv4. The simplest thing to do would be to configure it with BACnet/IPv4 support turned on, give the new port a BACnet network numbers that don't conflict with other BACnet network numbers in the intranet, and you're good to go.
Safrone
@Safrone
OK, thanks for the help
Safrone
@Safrone
what is the specific format of the date data? e.g.: {'calendarEntry': {'dateRange': {'endDate': [121, 7, 5, 1], 'startDate': [121, 7, 5, 1]}}}
ah, found it:
        _date = Date(
            year=_d.year - 1900, month=_d.month, day=_d.day, day_of_week=_d.isoweekday()
        ).value
        _time = Time(
            hour=_t.hour,
            minute=_t.minute,
            second=_t.second,
            hundredth=int(_t.microsecond / 10000),
        ).value
sujitregal
@sujitregal
I have gateway to which 10 radios are connected. Each radio have to 10 motors. Motor have 2 parameters speed and torque. Now i want to create one object for each radio with it's 10 motors and want to show present value of speed and torque. How can i do that?
Gateway is my bacnet device and for remaining i want to create objects
Christian Tremblay
@ChristianTremblay

What do you want to do ? Create 1 BACnet device that will present 100 motors with 2 points ?

It’s possible to create that using a simple name convention

Motor001_speed
Motor001_torque
[…]
Motor100_speed
Motor100_torque

In your code, the presentValue of each point is updated based on the value for from your radio gateway.

The points could be analogInputs (read only from BACnet)
You could also use another name convention for objects… maybe with the radio ID included…
sujitregal
@sujitregal
@ChristianTremblay Thanks for your reply.
Yes your are correct. I want to create one BACnet device in that I have 10 radios.
And radio have connected to some motors.
But my requirement is to create single object for them in which i will update present value.
sujitregal
@sujitregal
But i don't know how to create an array inside object for each radio's each motor
sujitregal
@sujitregal
image.jpeg
My BACnet device structure is something like this.
So i want to create object for each radio in which i can send present value of all 10 motors connected to it.
It will be great if i get sample code
Joel Bender
@JoelBender
I think you are looking for a Group Object, Clause 12.14, which "defines a standardized object whose properties represent a collection of other objects and one or more of their properties." You would still create the 200 Analog Value Objects, the present value of each one is for a specific radio, motor, and speed/torque. Then create a Group Object representing a radio, which will reference the 20 points for the corresponding motor and point (see Clause 12.14.5, List_Of_Group_Members). When a BACnet client reads the Present_Value from your gateway it will get back a list of 20 ReadAccessResult structures all at once.
There is rudimentary support for Group Objects in BACpypes, but only for the client side (reading the properties of the object) and not the server side (that gathers all of the referenced values in the list of group members).
Joel Bender
@JoelBender
I'm not sure how widely supported the Group Object will be for BACnet clients, of course if you are only going to be using your own client then it would be fine and still conformant. An easier and more widely supported option is to let the client decide which objects to read using Read Property Multiple, which has the same effect returning a list of read access results. Assuming BACpypes and then BAC0 better support server-side Group Objects in the future, your existing gateway code can simply add those additional objects without changing any of the other code you need to write to get the value into the present value of the Motor075_speed object.