This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Keyfob / remote control of the smart lock via zigbee using single nRF52840 based on input pin states.

Dear fellow developers

I would like to integrate a smart lock (danalock v3) with the alarm system, so that I can control the lock via the alarm system. The alarm provides outputs via relays. If danalock had a key fob, I would wire key fob buttons via relays of the alarm system to control the lock. Howe we the key fob is not a product offered by the smart lock manufacturer.

As the lock supports zigbee protocol, I am thinking to use nRF52840 as an intermediary between the smart lock and the alarm system. In other words, nRF52840 would be a key fob, that controls the smart lock over zigbee. I would then wire the relays of the alarm system to nRF52840 inputs, so that these could be used to trigger commands over zigbee to lock and unlock danalock.

Based on the example Zigbee CLI Agent example it looks like a single nRF52840 can be both coordinator and router at the same time. So here is my question: is it possible to modify that example so that the single  /same nRF52840 board performs the following:

a) create a zigbee network in include the smart lock as an endpoint; store network configuration

b) store network configuration in non volatile memory so that after a  power failure and restart of nRF52840, no new network set up would be required (repeated inclusion or pairing with the smart lock is avoided)

b) send commands (lock / unlock) to the end point (smart lock), based on the state change of input pins of nRF52840 controlled by alarm relays

Is this achievable, and how complicated would be to make modifications to the firmware of nRF52840?

Do I need to obtain any proprietary information for the smart lock manufacturer to realize that?

I plan to use the following board:

https://www.aliexpress.com/item/4000246750580.html?spm=a2g0o.productlist.0.0.68784e3bgjVAY5&algo_pvid=176739fc-f5e3-4542-adbe-67d20a1fcf2b&algo_expid=176739fc-f5e3-4542-adbe-67d20a1fcf2b-53&btsid=0bb0622e16008040933877612e2839&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603

I would appreciate any constructive advise.

Kind regards,

Andrew

Parents
  •  Hi Andrew,

    I recommend going for the nRF52840 DK for the developing process. The reason being that the nRF52840 DK includes an on-board debugger which will make your life much easier, specially if you are new to Nordic development: https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-DK

    You can find a local distributor for the nRF52840 DK here: https://www.nordicsemi.com/About-us/BuyOnline

    After you have a working prototype you will be of course free to scale down the hardware and use instead a dongle like the one you linked to or our official nRF52840 dongle https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle

    Or perhaps make your own custom hardware Slight smile

    I would anyways recommend getting your hands on a nRF52840 dongle, since it's highly recommended you set up a Zigbee sniffer when developing for Zigbee, it's easy to setup using Wireshark: https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/nrf802154_sniffer.html 

    A sniffer trace would be one of the best sources for debugging information when working with Zigbee.

    To answer your questions about integrating the Danalock v3 as a part of a Zigbee network using the nRF52840 as the network coordinator the answer will beyes, this should be achievable. How easy or time consuming this will be will depend on your previous knowledge of Zigbee protocol and Nordic devices and SDK. You can always get help along the way from us here in Devzone if you struggle with something.

    In the nRF5 Thread and Zigbee SDK we have a door lock example which uses the door lock cluster which can be controlled using commands from the Zigbee CLI example: https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/zigbee_multi_dynamic_door_lock_nus_example.html

    So first step would be to dig in in our the door lock cluster works and how you can interact with it.

    About storing the network parameters in the persistent storage, this is actually what it's done by default by the Zigbee stack, but in the CLI example the persistent storage is erased using

    zigbee_erase_persistent_storage(ZB_TRUE);

    after a reboot or power-off just to make the developement and testing process easier for developers.

    Let me know if you have any more question and good luck in your Zigbee journey! Slight smile

    Best regards,

    Marjeris

Reply
  •  Hi Andrew,

    I recommend going for the nRF52840 DK for the developing process. The reason being that the nRF52840 DK includes an on-board debugger which will make your life much easier, specially if you are new to Nordic development: https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-DK

    You can find a local distributor for the nRF52840 DK here: https://www.nordicsemi.com/About-us/BuyOnline

    After you have a working prototype you will be of course free to scale down the hardware and use instead a dongle like the one you linked to or our official nRF52840 dongle https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle

    Or perhaps make your own custom hardware Slight smile

    I would anyways recommend getting your hands on a nRF52840 dongle, since it's highly recommended you set up a Zigbee sniffer when developing for Zigbee, it's easy to setup using Wireshark: https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/nrf802154_sniffer.html 

    A sniffer trace would be one of the best sources for debugging information when working with Zigbee.

    To answer your questions about integrating the Danalock v3 as a part of a Zigbee network using the nRF52840 as the network coordinator the answer will beyes, this should be achievable. How easy or time consuming this will be will depend on your previous knowledge of Zigbee protocol and Nordic devices and SDK. You can always get help along the way from us here in Devzone if you struggle with something.

    In the nRF5 Thread and Zigbee SDK we have a door lock example which uses the door lock cluster which can be controlled using commands from the Zigbee CLI example: https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/zigbee_multi_dynamic_door_lock_nus_example.html

    So first step would be to dig in in our the door lock cluster works and how you can interact with it.

    About storing the network parameters in the persistent storage, this is actually what it's done by default by the Zigbee stack, but in the CLI example the persistent storage is erased using

    zigbee_erase_persistent_storage(ZB_TRUE);

    after a reboot or power-off just to make the developement and testing process easier for developers.

    Let me know if you have any more question and good luck in your Zigbee journey! Slight smile

    Best regards,

    Marjeris

Children
No Data
Related