Hi,
I’ve purchased a few of the JN5168-001-M00 modules online, and I have been able so far to setup the (free) eclipse tool chain for their HA profile, build the example demo’s they have (specifically the occupancy sensor and dimmer switch so far), flash those over UART0 to the JN5168-001-M00 module, and log over that same UART0 the logging messages from various source files in their demo. I’ve also then been able to connect this module to Smarthings, and it shows up as “unknown” which I get since I don’t think it’s matching any fingerprint of a device type that already exists.
I’ve written a few device types already, and played with some that other people have wrote for example on the AeonLabs meter switch. I’m currently reading through the documentation which has been very instructive on how to create a device type for zigbee. I believe I know the profile id for HA, the device id for this NXP module (per their documentation), and the clusters that it’s using. I’ve been reading through the module’s C source and have turned on some pretty instructive logging. I’ve seen that its getting connected, and logging various zigbee pro events for polling, data ack, data confirm, bind requests, zdp requests, etc.
From the ST side of things, I’ve tried to create a basic device type such as the following:
metadata {
// Automatically generated. Make future change here.
definition (name: "NXP module", namespace: "jdeltoft", author: "Justin Eltoft") {
capability "Motion Sensor"
fingerprint profileId: "0104", deviceId:"0x0107", inClusters: "0000,0406", outClusters: "0019"
}
// simulator metadata
simulator {
}
// UI tile definitions
tiles {
standardTile("motion", "device.motion", width: 2, height: 2) {
state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0")
state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff")
}
main "motion"
details "motion"
}
}
// Parse incoming device messages to generate events
def parse(String description) {
log.debug "description: $description"
return []
}
I’ve then assigned this device type to the Zigbee pro device. I see the proper ZigBee ID for the device listed in “My Devices” developer page, and I also see it has a Device Network ID (4 hex digits) and it even goes from INACTIVE to ACTIVE when I power up the module.
But now I’m feeling a bit stuck on how to bridge the communication between this module and ST. I have a few specific questions, and welcome any tips on what I might do next:
- When I go to the device details, I do NOT see “Raw Description” for this NXP module. I have 3 other ST Zigbee devices and 2 of the 3 have “Raw Description” so maybe it’s not a big deal? The documentation says to use this for determining the clusters (which I believe I know already anyway) but I’m just wondering if this is a concern and what might be causing it to be missing?
- If you see my device type, you can see in the parse command I just call log.debug. Should that work to send out any data coming from the module? Is there some other better way to see all the low level data from the module? I currently go to the “Live Logging” developer page and never see anything for this device.
- Does anyone know if maybe “sniffing” all the data is a good way to debug this? I don’t have a sniffer, but I believe you can buy usb dongles for this. I could try comparing this Zigbee module output to some working ST zigbee device.
- Do I need to “bind” to get anything communicating? I know bind is basically like registering for updates from the server anytime something changes. I don’t think that’s a must yet but just checking.
Well, that’s it for now. I’m continuing to read the NXP documentation on ZBP stack, HA, and ZCL, hoping I’ll find more clues. I’ll probably also order a sniffer to try that out. As well as continue to turn on various logging in the module code to see if there are more clues.