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

BACnet Write Property Request Not Being Sent (Verified via Wireshark) #498

Open
tjarkst opened this issue Nov 14, 2024 · 4 comments
Open

Comments

@tjarkst
Copy link

tjarkst commented Nov 14, 2024

The write_property method is not sending BACnet packets as expected. While read operations work correctly, write operations fail silently with no packets visible in Wireshark.

Reproduction Steps

import BAC0

# Initialize connection
bacnet = BAC0.lite(ip='192.168.0.97', port=port)

# Read works
read_result = bacnet.read('192.168.0.100 analogValue 459 presentValue')
print(f"Read successful: {read_result}")

# Write fails silently
write_result = bacnet.write('192.168.0.100 analogValue 459 presentValue 100 - 8')
print(f"Write attempted: {write_result}")

![image](https://github.com/user-attachments/assets/26cca76a-5016-4a06-b987-7c2cebeae650)
@ChristianTremblay
Copy link
Owner

Try

await bacnet._write(args)

And tell me if it is better

@ChristianTremblay
Copy link
Owner

Complément : the write method creates a asyncio task. With await _write you force the write to happen now.

@tjarkst
Copy link
Author

tjarkst commented Nov 14, 2024

It worked indeed

@ChristianTremblay
Copy link
Owner

This is strongly related to "me learning asyncio" and trying to keep some function synchronous to be used in the REPL... I suspect at some point I'll need to clean that up. And rely on awaitable functions.

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

No branches or pull requests

2 participants