Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COV subscription setting lifetime to 0 causes Error #521

Open
kheldaroz402 opened this issue Mar 14, 2024 · 2 comments
Open

COV subscription setting lifetime to 0 causes Error #521

kheldaroz402 opened this issue Mar 14, 2024 · 2 comments

Comments

@kheldaroz402
Copy link

Hi All,
I'm trying to talk to a Mitsubishi controller and it only supports COV subscription where lifetime is zero

when I try and do that, I get the following error

File "/opt/WebAI/WebAIPy/BACnetIP.py", line 2087, in <module> @recurring_function(delay) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/WebAI/WebAIPy/virtualenv/lib/python3.11/site-packages/bacpypes/task.py", line 253, in recurring_function_decorator task.install_task() File "/opt/WebAI/WebAIPy/virtualenv/lib/python3.11/site-packages/bacpypes/task.py", line 192, in install_task raise RuntimeError("interval must be greater than zero") RuntimeError: interval must be greater than zero

I also tried setting it to none

class SubscriptionContext:

def __init__(self, address, objid, confirmed=None, lifetime=None):
    if lifetime == 0:
        lifetime = None
    if _debug: SubscriptionContext._debug("__init__ %r %r confirmed=%r lifetime=%r", address, objid, confirmed, lifetime)
    global subscription_contexts, next_proc_id

    # destination for subscription requests
    self.address = address

    # assign a unique process identifer and keep track of it
    self.subscriberProcessIdentifier = next_proc_id
    next_proc_id += 1
    subscription_contexts[self.subscriberProcessIdentifier] = self

    self.monitoredObjectIdentifier = objid
    self.issueConfirmedNotifications = confirmed
    self.lifetime = lifetime
@JoelBender
Copy link
Owner

Have you started with the COVClientApp.py sample application and you are expecting to call send_subscription() at some interval based on the lifetime stored in the context?

@kheldaroz402
Copy link
Author

Yes I think I did start with that app - it's been heavily modified since

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants