Post Edited to Remove Misinformation
I've finally, finally got this working after a lot of struggle, so I thought I'd share since I didn't seem to find much info for this application - I thought it'd be pretty common. I'll summarize what I ended up doing first to get it to work, then throw in some discussion questions.
Like most programming problems, most of what I did was unnecessary, and in the end it all boiled down to these points:
- I'm using the BitCloud ZLLDemo with AVRStudio/gcc and the 'Zigbee Light' Device in the Wink App.
- Despite the usual need for a Zigbee Alliance Master Key, it turns out you can actually pair with the Wink Hub without it.
Very cool the Wink hub allows generic devices and apparently development keys.
(The Wink Hub is a Zigbee HA device and pairs with ZLLDemo based on HA backward Compatibility - This only requires the Zigbee HA Public Key)
- You need to be compiling/loading the 'All' or 'Router' makefile/hex - Really this was the major problem preventing me from pairing (I was using the EndDevice config).
(This is because ZLL and HA require Lights to also be Routers)
- For my board at least (the ATMEGA256RFR2-XPRO), I had to modify the ZLLDemo to actually work with the onboard LED.
- configuration.h defines APP_USE_PWM for this board, but PWM doesn't appear to be configured properly to use this board's LED
- I commented the #define APP_USE_PWM out to use Digital IO for now.
This experience does leave me with a few questions about the whole thing.
- If I apply and obtain the Zigbee Master Key, where would I use it in the context of the BitCloud framework - Which key does it replace (ZLL_PREINSTALLED_LINK_KEY, ZLL_SECURITY_KEY, CS_NETWORK_KEY...)?
(See Solution Below)
- Why did I have to use the Router or All makefile instead of just the EndDevice?
(See Solution Below - ZLL and HA require lights to be Routers)
- Have I missed anything clearly documented somewhere that would have made this easier (I can still tell myself I learned something in the struggle...)?
(ZLL and HA are distinct standards. The ZLL Spec is helpful in addition to Zigbee and Zigbee HA specs).
Hope this helps others trying to develop Home Automation products. Thanks as always.