Closed Zedstron closed 1 year ago
@rlutes @davidraker @acedrew any thoughts on this?
This looks like you might be trying to readPropertyMultiple on a device that doesn't support it, have you tried using read_property_multiple: false in the device config?
I don't have access to the site remotely, today I have a site visit I will try this and let you know here I noticed volttron works fine over BACnet/IP but for BACnet/MSTP it throws errors and the communication is not reliable
Finally i kept the sugested property with false value in the config, now my config looks like following
{
"driver_config": {
"device_address": "50:7",
"device_id":70700,
"read_property_multiple": false
},
"driver_type": "bacnet",
"registry_config": "config://registry_configs/50:7_70700.registry",
"interval":300
}
And the error is now changed 30 seconds Timeout, note that there are almost 20+ properties to read in the device
I just discovered the root cause, its the bacpypes version which is too old in volttron container, following code confirms it
# Code which works using bacpypes==0.18.1 and not with 0.16.7
import BAC0
bacnet = BAC0.lite(ip="192.168.1.20/24", port=47808)
def main():
payload = "50:7 analogOutput 1 presentValue"
print("Requesting {}".format(payload))
print("The value is ", bacnet.read(payload))
if __name__ == '__main__':
main()
The same device is returning values using this code but Communication aborted in volttron container
That's not a root cause. There's no confirmation in your example. You're comparing reading one point, once with no timing information, with reading 20 points in 30 seconds.
It sounds like you're dealing with an especially old and slow device. Try reducing the number of points, or increasing the timeout. You may also need to increase the request interval to give the device time to respond.
You state that you have communication aborted after confirming you have timeout. The sample code you provide is using readProperty, not readPropertyMultiple, under the hood.
So, after a lot of testing and efforts, you are right the previous code was using single property read, now I changed the script to read all objects with 0.5 seconds of delay between each read and called readMultiple for each object to read all properties at once, Now following are my test results.
Regarding the code to test whether the device really doesn't support readMultiple and is really that much slow to require more then Volttron''s default 30s timeout, I used following version.
import BAC0
import json
from time import time, sleep
from tqdm import tqdm
bacnet = BAC0.lite(ip="192.168.1.20/24", port=47808)
attributes = json.load(open('devices/deviceB.json', 'r'))
print("Total Objects Found: {}".format(len(attributes)))
def main():
total_objects = len(attributes)
pbar = tqdm(total=total_objects, unit='object(s)')
start_time = time()
for attribute in tqdm(attributes, desc="Requesting Objects from RemoteStation"):
payload = "{} {} {}".format(attribute['BACnet Object Type'], attribute['Index'], 'all')
payload = "50:7 " + payload
value = bacnet.readMultiple(payload)
attribute["Value"] = value
sleep(0.5)
elapsed_time = time() - start_time
print("Total time took: {:02d}:{:02d}".format(int(elapsed_time // 60), int(elapsed_time % 60)))
if __name__ == '__main__':
main()
There is total 41 actual objects in the Json file I was loading, so baseline delay is 41 x 0.5 = 20.5s and the total script execution time after including actual reading delay was 28 seconds which is still less then default Voltron timeout value 30.
I request you to provide me a test case compatible device config which you think might work on slow device maybe I am missing some configurations.
The screenshots of the logs are following
and
I agree root cause is not related to bacpypes version, but there is something else which need attention regarding slow devices more specifically regarding MS/TP devices.
I will be very thankful to you @acedrew for assisting me to solve this issue, as by solving this problem you will solve a very big problem of my life 😟
Closing this issue after a complete diagnosis, extensive debugging and analysis of the operating system itself, I am closing this issue as it's NOT THE PROBLEM WITH VOLTTRON itself but it's a strange behavior of Ubuntu 20.04 which when goes idle after some time, changes the routing table and most of the network devices are not accessible anymore unless we login back to device.
Describe the bug Well, I am not sure if it's a bug or not but after scanning the devices using bacnet_scan.py, there are two types of devices are scanned one category has the following template.
While the other category falls under the following template
The problem is I can get data e.g., read_properties work fine for the devices following first template but not for the RemoteStation thingy. The error is following.
To Reproduce Use any device to read data which has no IP address but represented as a RemoteStation, simply scan the devices which has atleast one RemoteStation involved, Import the scanned configurations and check logs
Expected behavior The device should be scraped successfully.
Operating System
Additional context The devices are accessible in building BMS and showing values, so its hardly possible that they are not responding, Tried in two different buildings, In one site it does not read at all as shown above , in one building it reads the data for about 2 to 3 hours and then starts throwing same exact error unless the BACnet proxy agent is restarted, I am not able to conclude the root cause, as it's a strange behavior.