Talking directly to the Ember network

How does the Wink Hub do what it does? What's stored in the database? What does the aprond daemon do? what does aprontest communicate with? What is the ultimate question?
CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Talking directly to the Ember network

Postby CloneNum3 » Mon Jan 26, 2015 10:08 pm

http://www.wless.ru/files/ZigBee/EM260/120-4028-000_EmberZNetAppDevGuide.pdf

I am able to talk directly with the ember network... here's some notes...

Run ZigBeeHACoord

Code: Select all

[root@flex-dvt ~]# ZigBeeHACoord -n 1 -p ttySP4
Reset info: 11 (SOFTWARE)
ezsp ver 0x04 stack type 0x02 stack ver. [5.1.2.1 GA build 94]
Ezsp Config: set max end device children to 0x0006:Success: set
Ezsp Config: set binding table size to 0x0002:Success: set
Ezsp Config: set source route table size to 0x0064:Success: set
Ezsp Config: set security level to 0x0005:Success: set
Ezsp Config: set address table size to 0x00FA:Success: set
Ezsp Config: set TC addr cache to 0x0004:Success: set
Ezsp Config: set stack profile to 0x0002:Success: set
Ezsp Config: set MAC indirect TX timeout to 0x1E00:Success: set
Ezsp Config: set max hops to 0x001E:Success: set
Ezsp Config: set key table size to 0x0000:Success: set
Ezsp Config: set tx power mode to 0x8000:Success: set
Ezsp Config: set supported networks to 0x0001:Success: set
Ezsp Policy: set binding modify to "allow for valid endpoints & clusters only":Success: set
Ezsp Policy: set message content in msgSent to "return":Success: set
Ezsp Value : set maximum incoming transfer size to 0x000000FF:Success: set
Ezsp Value : set maximum outgoing transfer size to 0x000000FF:Success: set
Ezsp Config: set Fragmentation RX window size to 0x0001:Success: set
NCP supports maxing out packet buffers
Ezsp Config: set packet buffers to 89
Ezsp Config: set Fragmentation RX window size to 0x0001:Success: set
Ezsp Endpoint 1 added, profile 0x0104, in clusters: 5, out clusters 11
Ezsp Policy: set TC Key Request to "Deny":Success: set
Ezsp Policy: set App. Key Request to "Allow":Success: set
Ezsp Policy: set Trust Center Policy to "Allow preconfigured key joins":Success: set
Found 0 files

main: flxOs Initialize success!
zbServer_Initialize: Ipc Server Initialization success!
zbServer_Initialize: Ipc Server Open success!
main: zbServer Initialize success!
EMBER_NETWORK_UP 0x0000
IpcServerSendMessage: send error
emberAfStackStatusCallback: error on IPC send
The app framework is handling the stack status.
ZigBeeHACoord>


List attributes of known devices

Code: Select all

ZigBeeHACoord>print attr
ENDPOINT 01
indx  clus / attr /type(len)/ rw / t / [mfcode] / data (raw)
0000: 0000 / 0000 / 20 (01) / RO / N /01 (Basic)
0001: 0000 / 0007 / 30 (01) / RO / N /00 (Basic)
0000: 0003 / 0000 / 21 (02) / RW / N /00 00 (Identify)
0000: 0006 / 0000 / 10 (01) / RO / N /00 (On/off)
0000: 0008 / 0000 / 20 (01) / RO / N /00 (Level Control)
0000: 0019 / 0000 / F0 (08) / RO / N /FF FF FF FF FF FF FF FF (Over the Air Bootloading)
0001: 0019 / 0001 / 23 (04) / RO / N /FF FF FF FF (Over the Air Bootloading)
0002: 0019 / 0006 / 30 (01) / RO / N /00 (Over the Air Bootloading)
ZigBeeHACoord>


Get info on the entire network

Code: Select all

ZigBeeHACoord>info
MFG String:
node [(>)000D6F0004AB4D2A] chan [11] pwr [3]
panID [0x1D84] nodeID [0x0000] xpan [0x(>)52E885AD9C3ECD1D]
ezsp ver 0x04 stack type 0x02 stack ver. [5.1.2.1 GA build 94]
nodeType [0x01]
Security level [05]network state [02] Buffs: 81 / 89
Ep cnt: 1
ep 1 [endpoint enabled, device enabled] nwk [0] profile [0x0104] devId [0x0007] ver [0x00]
    out(client) cluster: 0x0000 (Basic)
    in (server) cluster: 0x0000 (Basic)
    out(client) cluster: 0x0001 (Power Configuration)
    in (server) cluster: 0x0003 (Identify)
    out(client) cluster: 0x0004 (Groups)
    out(client) cluster: 0x0006 (On/off)
    in (server) cluster: 0x0006 (On/off)
    out(client) cluster: 0x0008 (Level Control)
    in (server) cluster: 0x0008 (Level Control)
    out(client) cluster: 0x0019 (Over the Air Bootloading)
    in (server) cluster: 0x0019 (Over the Air Bootloading)
    out(client) cluster: 0x0020 (Poll Control)
    out(client) cluster: 0x0201 (Thermostat)
    out(client) cluster: 0x0405 (Relative Humidity Measurement)
    out(client) cluster: 0x0500 (IAS Zone)
    out(client) cluster: 0xFC00 (Accelerometer Cluster)
Nwk cnt: 1
nwk 0 [Primary]
  nodeType [0x01]
  securityProfile [0x01]
ZigBeeHACoord>


Define what you want to do (in this case, I want to turn ON the endpoint aka the light)

Code: Select all

ZigBeeHACoord>zcl on-off on
Msg: clus 0x0006, cmd 0x01, len 3
buffer: 01 00 01


Now send the command to the short name (0xabcd) of the endpoint aka light

Code: Select all

ZigBeeHACoord>send 0x3cf1 0x01 0x01


Now read the status of the light

Code: Select all

ZigBeeHACoord>zcl global read 6 0
Msg: clus 0x0006, cmd 0x00, len 5
buffer: 00 06 00 00 00


Again, we need to send the command to the light.

Code: Select all

ZigBeeHACoord>send 0x3cf1 0x01 0x01


And you should get something back like this...

Code: Select all

ZigBeeHACoord>send 0x3cf1 0x01 0x01
ZigBeeHACoord>
T00000000:RX len 8, ep 01, clus 0x0006 (On/off) FC 08 seq 06 cmd 01 payload[00 00 00 10 00 ]
Attribute decoded as 0
emberAfReadAttributesResponseCallback: unable to determine source device
emberAfReadAttributesResponseCallback: clusterId = 0x6
emberAfReadAttributesResponseCallback: read_status = 0x0
emberAfReadAttributesResponseCallback: attributeId = 0x0
emberAfReadAttributesResponseCallback: attribute value = 0
emberAfReadAttributesResponseCallback: src endpoint = 0x1
emberAfReadAttributesResponseCallback: network address = 0x3cf1
IpcServerSendMessage: send error
emberAfReadAttributesResponseCallback: error on IPC send


the value=0 says it's OFF (which it was at the time)

Now tell it to turn on and then get the status again...

Code: Select all

ZigBeeHACoord>zcl global read 0x0006 0x0000
Msg: clus 0x0006, cmd 0x00, len 5
buffer: 00 02 00 00 00
ZigBeeHACoord>send 0x3cf1 0x01 0x01
T00000000:RX len 8, ep 01, clus 0x0006 (On/off) FC 08 seq 02 cmd 01 payload[00 00 00 10 01 ]
Attribute decoded as 1
emberAfReadAttributesResponseCallback: unable to determine source device
emberAfReadAttributesResponseCallback: clusterId = 0x6
emberAfReadAttributesResponseCallback: read_status = 0x0
emberAfReadAttributesResponseCallback: attributeId = 0x0
emberAfReadAttributesResponseCallback: attribute value = 1
emberAfReadAttributesResponseCallback: src endpoint = 0x1
emberAfReadAttributesResponseCallback: network address = 0x3cf1
IpcServerSendMessage: send error
emberAfReadAttributesResponseCallback: error on IPC send


And there we go... value=1, light is on 8-)

more fun stuff...

Gradually move to a different brightness (take 20 umm, miliseconds?) to move to 255 (full brightness)...

Code: Select all

ZigBeeHACoord>zcl level-control o-mv-to-level 255 20
Msg: clus 0x0008, cmd 0x04, len 6
buffer: 01 00 04 FF 14 00
ZigBeeHACoord>send 0x3cf1 0x01 0x01
ZigBeeHACoord>
T00000000:RX len 5, ep 01, clus 0x0008 (Level Control) FC 08 seq 00 cmd 0B payload[04 00 ]
[DRC - Cluster 0x0008; Command 0x04; Status 0x00]
[DRC - Cluster 0x0008; Command 0x04; Status 0x00]

T00000000:RX len 7, ep 01, clus 0x0008 (Level Control) FC 18 seq 97 cmd 0A payload[00 00 20 02 ]
[RAC]
Attribute decoded as 2
emberAfReportAttributesCallback: clusterId              = 0x8
emberAfReportAttributesCallback: attributeId            = 0x0
emberAfReportAttributesCallback: attribute state        = 2
emberAfReportAttributesCallback: src endpoint   = 0x1
emberAfReportAttributesCallback: network address        = 0x3cf1
emberAfReportAttributesCallback: unable to determine source device
IpcServerSendMessage: send error
emberAfReportAttributesCallback: error on IPC send

T00000000:RX len 7, ep 01, clus 0x0008 (Level Control) FC 18 seq 98 cmd 0A payload[00 00 20 A4 ]
[RAC]
Attribute decoded as 164
emberAfReportAttributesCallback: clusterId              = 0x8
emberAfReportAttributesCallback: attributeId            = 0x0
emberAfReportAttributesCallback: attribute state        = 164
emberAfReportAttributesCallback: src endpoint   = 0x1
emberAfReportAttributesCallback: network address        = 0x3cf1
emberAfReportAttributesCallback: unable to determine source device
IpcServerSendMessage: send error
emberAfReportAttributesCallback: error on IPC send

bondjames12
Posts: 3
Joined: Mon Feb 16, 2015 3:29 pm

Re: Talking directly to the Ember network

Postby bondjames12 » Mon Feb 16, 2015 3:42 pm

I was poking around in ZigBeeHACoord as far as I can tell they haven't implemented any of these zcl commands yet:

From page 24 of the above posted EmberZNet Application Developers PDF:
Cluster domain Cluster Sent by Cluster command M/OPayload
LightingColor Control (0x0300) cli move to hue (0x00) M [hue 1] [dir 1] [ttime 2]
LightingColor Control (0x0300) cli move hue (0x01) M [move mode 1] [rate 1]
LightingColor Control (0x0300) cli step hue (0x02) M [step mode 1] [ttime 1]
LightingColor Control (0x0300) cli move to saturation (0x03)M [saturation 1] [ttime 2]
LightingColor Control (0x0300) cli move saturation (0x04)M [move mode 1] [rate 1]
LightingColor Control (0x0300) cli step saturation (0x05)M [step mode 1] [ttime 1]
LightingColor Control (0x0300) cli move to hue and saturation (0x06) M [hue 1] [saturation 1] [ttime 2]

Also there is no 0x0300 (decimal 768) cluster or any of the color attributes in the apron database. So for anyone hoping to use the wink software to control zigbee color lights (Phillips Hue) we will have to wait until they update there software with the required functions.

bondjames12
Posts: 3
Joined: Mon Feb 16, 2015 3:29 pm

Re: Talking directly to the Ember network

Postby bondjames12 » Mon Mar 23, 2015 7:32 am

A follow up. The recent update to Winkhub 00.77 software has updated the ember interface.

The following commands will change the hue, etc of a Philips hue bulb.
0x2e28 is the nodeID of the bulb

>zcl colorcontrol movetocolortemp 450 1
>send 0x2e28 0x01 0xff

>zcl colorcontrol movetocolortemp 200 1
>send 0x2e28 0x01 0xff

>zcl colorcontrol movetohue 200 1 1
>send 0x2e28 0x01 0xff

>zcl colorcontrol movetohue 255 1 1
>send 0x2e28 0x01 0xff

zcl colorcontrol movetohue 180 1 1
>send 0x2e28 0x01 0xff


Return to “How does it work?”

Who is online

Users browsing this forum: No registered users and 1 guest