|
From: Monson, K. E <Kyl...@pn...> - 2016-04-01 15:27:59
|
(We just deleted the branch I referenced in my previous email. The file can now be found here: https://github.com/VOLTTRON/volttron/blob/develop/scripts/bacnet/grab_bacnet_config.py ) I just realized that I left something out of my previous email: pduSource = <Address 192.168.1.100> pduExpectingReply = False pduNetworkPriority = 0 apduType = 5 apduService = 12 apduInvokeID = 67 errorClass = 'property' errorCode = 'unknownProperty' pduData = x'' ERROR:__main__:an error has occurred: enumerated application tag required Traceback (most recent call last): File "grab_bacnet_config.py", line 485, in <module> main() ... This is why I suspected a bad ReadPropertyACK. The above PDU dump came right before the exception. Actually the only way this is dumped is if the 'if' on 149 is entered... I don't see how something could catch that exception and continue on in that same function. This is really weird. I'll keep looking. -----Original Message----- From: Joel Bender [mailto:jo...@ca...] Sent: Thursday, March 31, 2016 19:29 To: Discussion about developing BACpypes Subject: Re: [BACpypes-developers] bacpypes bug? Kyle, > We've run into a problem that only seems to happen with recent versions of bacpypes. Humph. > InvalidTag: enumerated application tag required I'm guessing that there is a property of an object that you are reading that should be an enumerated value and maybe earlier versions of the library had the wrong data type for the property, or weren't as strict as the current version in decoding it, or something else trapped the exception and hid it from you. Then again, maybe the current version has the wrong datatype. In all of those scenarios, capturing the response packet for the object and property is essential. > If we roll bacpypes back to 0.13.2 the error goes away. Sweet! That means you not only have a consistent way of reproducing the error, but you can create communications logs for both versions. > Other slightly newer versions may work but I didn't try them all. (I > can only replicate these errors with customer devices and had limited > opportunity to mess with it.) Is there a chance that you can run daemonlogger or wireshark on the device with your application the next time you get a chance? Do you need an object/property discovery application that is separate from the rest of your code you can run? Maybe you could send them a special application for them to run that reads the objects and properties and captures the communications log blob they can send back to us for analysis... $ python special_discovery.py ZZZ > special_discovery.log Where ZZZ is a BACnet address or device identifier. They could stop your application, run this code, and then starts theirs back up again. > I know for certain that 0.13.7 and 0.13.6 don't work. Humph. Again. > I'm checking the type of the object returned by the by the read property call to make sure it's a ReadPropertyACK and raising an exception if it's not. (See line 149) I think some reason we are getting a bad ReadPropertyACK back instead of an error. That might be the case, but I'm not pointing fingers. I've reviewed some files (master branch, using 'git blame' on the GitHub web site): https://github.com/JoelBender/bacpypes/blame/master/py27/bacpypes/object.py https://github.com/JoelBender/bacpypes/blame/master/py27/bacpypes/appservice.py Beyond that I'm having trouble lining up the git commit log with the release history so I can get a full diff of everything that has change between versions. > What do you think? Without having a ReadPropertyACK just before being decoded it's not going to be easy. Here is a bit of code that prints out the names of the enumerated properties: import bacpypes.primitivedata import bacpypes.object for cls in bacpypes.object.registered_object_types.values(): for prop in cls.properties: if issubclass(prop.datatype, bacpypes.primitivedata.Enumerated): print cls, prop.identifier Maybe there are some properties that jump out at you that you can investigate, or groups of them that you can ignore because you know the customer doesn't have any instances of those objects. Joel ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 _______________________________________________ BACpypes-developers mailing list BAC...@li... https://lists.sourceforge.net/lists/listinfo/bacpypes-developers |