Bug #152

viewGroup command

Added by Han Alink almost 6 years ago. Updated over 3 years ago.

Status:Closed Start date:10/22/2012
Priority:Normal Due date:
Assignee:Stefano Lenzi % Done:

0%

Category:zigbee.zcl.library Spent time: -
Target version:org.aaloa.zb4osgi.zigbee.zcl.library-0.9.0
Has a patch:No Has license agreement signed:No

Description

After setting a Group (16) with a name (abc), the viewGroup leads to the following incomming message:
Packet: length = 27, apiId = 0x44
0x81, full data = 0xfe 0x1b 0x44 0x81 0x00 0x00 0x04 0x00 0xf1 0x46 0x0a 0x02 0x
00 0x34 0x00 0x26 0xad 0x0b 0x00 0x00 0x0a 0x19 0x15 0x01 0x00 0x10 0x00 0x03 0x
61 0x62 0x63 0xa5, checksum = 0xa5, error = false, errorMessage = null

This looks okay to mee.
Nevertheless, the following info is displayed in the tester window:

==== Action:: Groups.viewGroup ====
[16]
----------- result ----------
java.lang.IllegalArgumentException: Type java.lang.String not supported!
at it.cnr.isti.primitvetypes.util.Integers.readObject(Integers.java:249)
at it.cnr.isti.zigbee.zcl.library.impl.core.DefaultDeserializer.readObject(DefaultDeserializer.java:74)
at it.cnr.isti.zigbee.zcl.library.impl.general.groups.ViewGroupResponseImpl.<init>(ViewGroupResponseImpl.java:55)
at it.cnr.isti.zigbee.zcl.library.impl.general.GroupsCluster.viewGroup(GroupsCluster.java:122)
at it.cnr.isti.zigbee.ha.cluster.impl.GroupsImpl.viewGroup(GroupsImpl.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.persona.zigbee.tester.gui.Command.invoke(Command.java:99)
at org.persona.zigbee.tester.gui.CommandActionPanel$1.actionPerformed(CommandActionPanel.java:97)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

test.jpg (60.5 kB) Han Alink, 02/01/2013 05:12 pm


Related issues

blocked by Improvement #162: No command result shown when type is Response in Tester Closed 10/24/2012

Associated revisions

Revision 554
Added by Stefano Lenzi almost 6 years ago

Verified and fixed parsing of "View Group Response" command ( refs #152 )
Adde Test Unit for verification of the parsing

Revision 621
Added by Stefano Lenzi over 5 years ago

Reapplying fix that was deleted due to the merge ( refs #152 ) ( refs #174 )
Added JUnit for regression test ( refs #152 ) ( refs #133 )

Revision 623
Added by Stefano Lenzi over 5 years ago

Added log message for the ZCL Frame that are sent and received
Fixed NPE for addGroup, due to invokation of method without waiting for response ( refs #152 )
Added JUnit for test issue ( refs #152 )

Revision 626
Added by Stefano Lenzi over 5 years ago

Better log message when sending ZCL Command ( refs #152 )

Revision 628
Added by Stefano Lenzi over 5 years ago

Fixed issues when GroupName field is missing ( refs #152 )

History

#1 Updated by Stefano Lenzi almost 6 years ago

  • Category set to zigbee.zcl.library
  • Status changed from New to Feedback
  • Target version set to org.aaloa.zb4osgi.zigbee.zcl.library-1.X

The issue was related to the parsing of all the "String" data of ZigBee it should be fixed

#2 Updated by Han Alink almost 6 years ago

No exception anymore, but the name of the group is not displayed in the tester window.

#3 Updated by Stefano Lenzi over 5 years ago

  • Status changed from Feedback to In Progress

#4 Updated by Stefano Lenzi over 5 years ago

  • Status changed from In Progress to Resolved

A message should be shown on tester window when view group command is issued to a device.

Please close the ticket if you agree

#5 Updated by Han Alink over 5 years ago

I still have problems with this command.
I can not add a group, as the name parameter is missing (again): ==== Action:: Groups.addGroup ====
[10]
----------- result ----------
java.lang.NullPointerException
at it.cnr.isti.zigbee.zcl.library.impl.core.ResponseImpl.<init>(ResponseImpl.java:54)
at it.cnr.isti.zigbee.zcl.library.impl.general.groups.AddGroupResponseImpl.<init>(AddGroupResponseImpl.java:47)
at it.cnr.isti.zigbee.zcl.library.impl.general.GroupsCluster.addGroup(GroupsCluster.java:88)
at it.cnr.isti.zigbee.ha.cluster.impl.GroupsImpl.addGroup(GroupsImpl.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.persona.zigbee.tester.gui.Command.invoke(Command.java:189)
at org.persona.zigbee.tester.gui.CommandActionPanel$1.actionPerformed(CommandActionPanel.java:109)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


#6 Updated by Stefano Lenzi over 5 years ago

I'm so sorry, the merging of the change caused so many issue and deleted so many bug fixes... We are working hard for recovering it...

Everything should be working as expected now... Please let me know

#7 Updated by Han Alink over 5 years ago

AddGroupstill leads to a nullpointer exception:
adding device:OnOff Light

==== Action:: Groups.addGroup ====
[10, abc]
----------- result ----------
java.lang.NullPointerException
at it.cnr.isti.zigbee.zcl.library.impl.core.ResponseImpl.<init>(ResponseImpl.java:54)
at it.cnr.isti.zigbee.zcl.library.impl.general.groups.AddGroupResponseImpl.<init>(AddGroupResponseImpl.java:47)
at it.cnr.isti.zigbee.zcl.library.impl.general.GroupsCluster.addGroup(GroupsCluster.java:88)
at it.cnr.isti.zigbee.ha.cluster.impl.GroupsImpl.addGroup(GroupsImpl.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.persona.zigbee.tester.gui.Command.invoke(Command.java:189)
at org.persona.zigbee.tester.gui.CommandActionPanel$1.actionPerformed(CommandActionPanel.java:109)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


#8 Updated by Stefano Lenzi over 5 years ago

There was a hidden issue, that should be fixed and I have also added a JUnit for.
The issue was that the GroupsCluster class was treating the AddGroup as a one-way communication thus returning a Null value as answer

#9 Updated by Han Alink over 5 years ago

No "null pointer exception" anymore.
But:
The name string is not transmitted; the ZCL command: [ ZCL Header: 0x19 0x18 0x00, ZCL Payload: 0x8a 0x0a 0x00]
Also there is no output anymore about the SUCCESS of the transmission.

When issuing the viewGroup command, a slide bar appears in the interface. Reading of the contents is not possible, as the slidebar covers the text line.
I include a picture of the tester window.

#10 Updated by Stefano Lenzi over 5 years ago

The message

 [ ZCL Header: 0x19 0x18 0x00, ZCL Payload: 0x8a 0x0a 0x00] 

represent the Add Group Response Command and it represent a failure of the Add Group Command due to a DUPLICATE_EXISTS, which explain also the no SUCCESS message on the Tester

By the way I have changed again to logging to be more clear.

Regarding the sidebar I think that you sent the wrong screenshot because it looks like that scrolling down will show the message

#11 Updated by Han Alink over 5 years ago

  • Status changed from Resolved to Reopen

You are right.
Adding another groupID (50) with the name "abc" returns a succes response ([ ZCL Header: 0x19 0x07 0x00, ZCL Payload: 0x00 0x32 0x00])
The ViewGroup command for group 50 returns: [ ZCL Header: 0x19 0x08 0x01, ZCL Payload: 0x00 0x32 0x00 0x03 0x61 0x62 0x63] which is okay too.
Nevertheless, no "Success" message or parameters are displayed; only the ZCL messages.
And about the scroll bar: I can not change the TEXT window in such a way that the message becomes visible (scrolling down is not possible). It's not a big deal, because enlarging the main window makes the horizontal scroll bar disappear.
Furthermore:
When issuing a ViewGroup command for a non-existing group, the device returns: 0x19 0x29 0x01 0x8b 0x05 0x00 (group5, command looks okay)
ZB4O issues a "outOffBounds" exception: ==== Action:: Groups.viewGroup ====
[5]
----------- result ----------
java.lang.ArrayIndexOutOfBoundsException: 3
at it.cnr.isti.zigbee.zcl.library.impl.core.DefaultDeserializer.readString(DefaultDeserializer.java:138)
at it.cnr.isti.zigbee.zcl.library.impl.core.DefaultDeserializer.readZigBeeType(DefaultDeserializer.java:178)
at it.cnr.isti.zigbee.zcl.library.impl.general.groups.ViewGroupResponseImpl.<init>(ViewGroupResponseImpl.java:54)
at it.cnr.isti.zigbee.zcl.library.impl.general.GroupsCluster.viewGroup(GroupsCluster.java:124)
at it.cnr.isti.zigbee.ha.cluster.impl.GroupsImpl.viewGroup(GroupsImpl.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

#12 Updated by Stefano Lenzi over 5 years ago

  • Status changed from Reopen to Resolved

Actually, checking with the ZigBee Cluster Library document on paragraph 3.6.2.4.2.2, they stated

" [...] If the status is SUCCESS, and group names are supported, the Group
Name field is set to the Group Name associated with that Group ID in the Group
Table; otherwise it is set to the null (empty) string, i.e. a single octet of value 0. [...] " 

Which seems that the Group Name is mandatory but is not present on your case, so I have made a workaournd for it...

#13 Updated by Han Alink over 5 years ago

In the case I subscribed, there is no group at all (no groupID and no group name). The 0x8b indicating: NOT FOUND. So I think that the ZCL frame is formatted as described in 3.6.2.4.2.2.
The case you are referring to is a succesful GroupView command for a group that has a GroupID but not a GroupName (The attribute NameSupport = 0).
Well .... I'm not completely sure!!

#14 Updated by Han Alink about 4 years ago

Checked again; name of the group is still not displayed in the tester window.

#15 Updated by Stefano Lenzi about 4 years ago

  • Status changed from Resolved to Feedback

Han Alink wrote:

Checked again; name of the group is still not displayed in the tester window.

As I wrote in note12 and as I tested with the JUnit source:trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/general/groups/ViewGroupResponseImplTest.java@628#L67
the problem is that

0x19 0x29 0x01 0x8b 0x05 0x00

The viewGroup fails so no name has to be shown. What is missing?

#16 Updated by Han Alink about 4 years ago

Let me explain:
If I assign a name to group 10: "abcd", and I view this group by means of the ViewGroup command, the following string is received and displayed: [ ZCL Header: 0x09 0x42 0x01, ZCL Payload: 0x00 0x0a 0x00 0x04 0x61 0x62 0x63 0x64]. This is okay.
The only thing I "complained" about is the fact that the ASCI string "abcd" is not displayed in the tester window. But this is not a big deal, so forget about it and close the issue.

#17 Updated by Stefano Lenzi over 3 years ago

  • Status changed from Feedback to Closed
  • Target version changed from org.aaloa.zb4osgi.zigbee.zcl.library-1.X to org.aaloa.zb4osgi.zigbee.zcl.library-0.9.0

As last comment

Also available in: Atom PDF