{"id":5432,"date":"2023-02-17T09:59:00","date_gmt":"2023-02-17T08:59:00","guid":{"rendered":"https:\/\/blog.besharp.it\/?p=5432"},"modified":"2023-03-24T17:55:55","modified_gmt":"2023-03-24T16:55:55","slug":"building-a-greengrass-based-zigbee-iot-sensor","status":"publish","type":"post","link":"https:\/\/blog.besharp.it\/building-a-greengrass-based-zigbee-iot-sensor\/","title":{"rendered":"Building a Greengrass-based ZigBee IoT sensor"},"content":{"rendered":"\n
Internet of things (IoT) is constantly evolving, and there is more and more talk of connectable devices for the general public and in the industrial, energy, and Smart City sectors.<\/p>\n\n\n\n
While in IoT products made for end users it is common to find devices directly connected to the Internet via WiFi or 4G networks, a whole series of applications less visible to consumers can benefit from an architecture composed of two distinct network stacks.<\/p>\n\n\n\n
In these cases, a group of IoT devices constitutes a local network using protocols that may be very different from those used on the Internet. <\/p>\n\n\n\n
The main benefit is the opportunity to operate networks of connected devices even in areas not served by the 3\/4\/5G network or where it is impossible to connect every device to the Internet. Also, those devices are usually much cheaper to buy and mass produce. <\/p>\n\n\n\n
Within these networks, a particular node is often identified, which acts as the network’s coordinator, and which, if necessary, can act as a bridge to put the network in communication with the external world via the Internet.<\/p>\n\n\n\n
ZigBee protocol is a wireless communication standard based on the IEEE 802.15.4 specification and is one of the most popular stacks for building a local area network of wireless devices.<\/p>\n\n\n\n
During the time we are allowed to spend researching and investigating new services, we created a playground for experimenting with Zigbee and AWS IoT Greengrass. We developed a PoC to test both Zigbee communication and various aspects of AWS IoT Greengrass.<\/p>\n\n\n\n
This article is a journal on how we created an edge device based on AWS IoT Greengrass and used it to process data collected by a network of sensors locally, leveraging AWS IoT core features to ingest the collected data into our cloud-native application.<\/p>\n\n\n\n
To set the stage, we quickly and frugally developed a wireless sensor using an XBEE module, a voltage regulator, and a photoresistor.<\/p>\n\n\n\n
XBee uses the Zigbee standard, adds some features, and wraps it up in its neat little package; plus, the module is much cheaper and easy to get quickly using our current suppliers. <\/p>\n\n\n\n
So what we had in mind was something like the following diagram shows:<\/p>\n\n\n\n