I am designing a battery operated smart lock with pin pad and cloud api and really trying to understand how I can make this work.
IOT Smart Lock Device Requirments:
- 4x aa batteries should last minimum 6 months
- It should be able to send/receive events from Mqtt with no more then 5-10 seconds latency
- It will have a capacitive touch sensor for the pin pad.
I chose the Nordic nRF52840 chip and thought the thread protocol was best one for a hotel smart lock where we will have 40-100 devices.
I understand thread needs a border router on the thread network which gives all other thread nodes wan access. Is it correct to assume the node iot device can now just have a mqtt client directly running in its firmware and it can connect to the cloud mqtt broker and can send/receive events from it just as if it was a normal wifi connected device?
My other question is if the above is true how would sleeping work? I noticed the nordic nRF52840 has ssed feature where it syncs wake up schedules with the border router (i think) and if the node is sleeping and a mqtt subscribed event comes through the border router will hold it until the scheduled wake up time of the thread connected node wakes up and then the router automatically pushes it? That is where im getting really confused. Is it the border router that stores the incoming subscribed mqtt event? does it automatically do that by default or do I need to develop some custom gateway to handle that?
Also would you guys suggest using Nats io for this instead of a mqtt client?