Kafka’s key role in IOT

Kiran Vajrapu
2 min readFeb 7, 2023

--

Hi Tech Warriors,

My name is Kiran Vajrapu, and I am from ThoughtWorks.

Again, I came with a real-time scenario from IOT Tech. As per the title, you may have understood the topic.

I was working under the R&D team a few years ago, and we only had one POC, which was the IOT one. Initial funding for the proof of concept was provided by a client from the Netherlands, so we were able to purchase IOT gateways, prebuilt IOT operating systems, etc.

However, one of the most popular telecom Indian clients requested a proof of concept related to their use case. They explained. The budget and open-source IOT software were restricted.

Fortunately, they are not restricted from using open-source hardware. So we started developing the IOT programme for the Raspberry PI. We used Python code to collect data from sensors, and it will send it to the server. another Python program for taking instructions from the server.

For pushing data to the server, we used Rest API calls because the device will collect data every minute and send it as JSON with a few details. For receiving the instructions, we used the MQTT protocol in Python.

We have another programme that makes decisions such as turning on or off the devices. However, if the administrator wishes to turn on or off the devices. The administrator sends commands from the server to the IOT gateway.

Example: switching on and off the devices in a cellular base station.

I have sample code to read sensor data using python : https://github.com/kiranvajrapu/IoT

Conclusion: We used two different protocols for sending and receiving data. But after exploring the technical stuff, we understood we could use Kafka to create a communication link with the IOT gateway and server.

Feel free to comment or provide suggestions.

--

--

No responses yet