BAC0.connect() not working anymore after switching over to async #475
-
I have pulled the code from a while ago before the shift to async connection and I can make a simple connection started. Today when I try to pull the latest code from git, and see that there is a the new change to shifting over to async connection. When I then try to do just a basic |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Be sure to start Python using
This way an event loop is created and run A Jupyter Notebook would also work For scripts, you can have a look to some example in the tests folder. I recently migrated manual_test_cov and manual_test_create_devices |
Beta Was this translation helpful? Give feedback.
-
Thanks for that. Sorry if that was a noob question. I am new to python. I am looking more to use scripts to run read and write values via bacnet. When you have time, would greatly appreciate if the sample read and write py can be updated as well. |
Beta Was this translation helpful? Give feedback.
-
Look carefully at the script named manual_test_create_device On a real BACnet network, you won't need to use more than 1 async with (cause you won't create fake device to interact with), you just need the main one, named bacnet... |
Beta Was this translation helpful? Give feedback.
-
I am currently connected to some real devices right now and managed to get the connection working and can discover the device on the network and read from it. However, when I try to write to it using the format I am not getting any error, but when I then try to read from the same object instance, the presentValue has not be written in properly. It was just what it was prior to my write command. I have also tried including the priority as well, but that does not seem to make a difference. In the test_create_device example, I can see that there is the example to write to it, but the example is using a device which you can directly address the analogValue by "AV-1". But when I do not have a device, can I still use bacnet.write() as described above? |
Beta Was this translation helpful? Give feedback.
Be sure to start Python using
Python -m asyncio
This way an event loop is created and run
A Jupyter Notebook would also work
For scripts, you can have a look to some example in the tests folder. I recently migrated manual_test_cov and manual_test_create_devices