<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christian Ighohor Okonta, PhD on Medium]]></title>
        <description><![CDATA[Stories by Christian Ighohor Okonta, PhD on Medium]]></description>
        <link>https://medium.com/@okonta.christian?source=rss-728a4d9e3217------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YS0S3OHTfUZ2JtBIkAwPFg.jpeg</url>
            <title>Stories by Christian Ighohor Okonta, PhD on Medium</title>
            <link>https://medium.com/@okonta.christian?source=rss-728a4d9e3217------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:12:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@okonta.christian/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Your best technician is also your biggest risk.]]></title>
            <link>https://medium.com/@okonta.christian/your-best-technician-is-also-your-biggest-risk-ff2efe12d111?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff2efe12d111</guid>
            <category><![CDATA[knowledge-management]]></category>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 06:21:56 GMT</pubDate>
            <atom:updated>2026-04-09T06:21:56.891Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*1Akr7XHuvSbxIMfPI2VL0A@2x.jpeg" /></figure><p>Not because they are a problem –</p><p>but because too much knowledge depends on them.</p><p>When they’re unavailable, things slow down.</p><p>When they leave, knowledge leaves with them.</p><p>Operational knowledge should be a system, not a person.</p><p>#system #knowledge</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff2efe12d111" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It is good to have documented procedures.]]></title>
            <link>https://medium.com/@okonta.christian/it-is-good-to-have-documented-procedures-276999b43df5?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/276999b43df5</guid>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 09:29:30 GMT</pubDate>
            <atom:updated>2026-04-06T09:29:30.294Z</atom:updated>
            <content:encoded><![CDATA[<h2>It is good to have documented procedures. What is better is to have the procedures available to the frontline where they are needed.</h2><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*ybIncybOLL9kq-k40ipcKg@2x.jpeg" /></figure><p>Your plant has SOPs.</p><p>Thick ones. Well-written ones.</p><p>Nobody reads them on the floor.</p><p>Not because your workers don’t care – but because a binder in the office isn’t available at the machine at 2am when something goes wrong.</p><p>Over two years of real production data from a global brewing facility showed that over 90% of downtime traces back to man or method – not the machine.</p><p>The documentation isn’t the problem.</p><p>The delivery is.</p><p>SquareMethods turns your existing SOPs and work instructions into scannable job aids – accessible at the machine, at the moment your team needs them.</p><p>If you manage operations or maintenance – this was built for your floor.</p><p>Demo access is open. Link in the comments.</p><p>@SquareMethods</p><p>#OperationalExcellence #MaintenanceManagement #FrontlineWorkers #TribalKnowledge</p><p><a href="https://onboarding.squaremethods.com/auth/register">Square Methods</a></p><p>#iEndorse</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=276999b43df5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most ideas don’t fail. They are abandoned.]]></title>
            <link>https://medium.com/@okonta.christian/most-ideas-dont-fail-they-are-abandoned-1aed04af511b?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aed04af511b</guid>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 12:05:50 GMT</pubDate>
            <atom:updated>2026-04-05T12:05:50.467Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*c1z3yFSq0HRNSQ4hGIxNsA@2x.jpeg" /></figure><p>Execution is rarely glamorous.</p><p>It’s repetitive, sometimes boring, and often slow.</p><p>But consistency compounds.</p><p>Stay with it longer than most people would.</p><p>#iEndorse</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aed04af511b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most systems don’t fail because they are complex. They fail because they are unclear.]]></title>
            <link>https://medium.com/@okonta.christian/most-systems-dont-fail-because-they-are-complex-they-fail-because-they-are-unclear-e6dc7579591c?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6dc7579591c</guid>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 16:17:58 GMT</pubDate>
            <atom:updated>2026-04-04T16:19:39.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*d7Y1v8AkYsnRLUdztD0dEg@2x.jpeg" /></figure><p>Clarity is underrated.</p><p>In maintenance, in software, in business – people don’t struggle because they are not capable.</p><p>They struggle because expectations, processes, or tools are not clearly defined.</p><p>Before optimizing anything, make it clear.</p><p>Clarity scales. Confusion doesn’t.</p><p>#iEndorse</p><p><a href="https://squaremethods.com/">SquareMethods</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6dc7579591c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Execution beats intention. Every single time.]]></title>
            <link>https://medium.com/@okonta.christian/execution-beats-intention-every-single-time-aa8eb1dd4bd5?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa8eb1dd4bd5</guid>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 11:08:31 GMT</pubDate>
            <atom:updated>2026-04-04T11:08:31.519Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*x4vJwTKPTjhQF-SYdiS3kA@2x.jpeg" /></figure><p>Ideas are everywhere.</p><p>What’s rare is taking one idea, sticking with it, and actually building something useful.</p><p>Less talking.</p><p>More doing.</p><p>That’s the real advantage.</p><p>#iEndorse</p><p>https://iendorse.premiumasp.net/a/c/va?l=bYXtXT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa8eb1dd4bd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biography of Christian Okonta, PhD]]></title>
            <link>https://medium.com/@okonta.christian/biography-of-christian-okonta-phd-058db54f4251?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/058db54f4251</guid>
            <category><![CDATA[biography]]></category>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 12:44:55 GMT</pubDate>
            <atom:updated>2025-08-24T12:46:05.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*mvqan0X5ciPRsZ18hf2Iwg.jpeg" /></figure><h3>Professional Overview</h3><p>Dr. Christian Okonta is a distinguished Industrial Engineer, technology entrepreneur, and innovation strategist with over a decade of expertise in reliability engineering and emerging technology applications. As the Founder and CEO of <strong>SquarePyramid Limited</strong>, he leads a Canadian technology company that develops innovative products including <strong>iEndorse</strong>, a revolutionary influencer marketing platform, and other digital solutions that transform how businesses connect with their audiences and optimize operations.</p><p>Currently serving as a <strong>Reliability Engineer at Mondelez Canada</strong>, Dr. Okonta applies advanced data analytics, AWS cloud architecture, and IoT-based monitoring systems to optimize industrial operations and predictive maintenance strategies.</p><h3>Education &amp; Academic Excellence</h3><p>Dr. Okonta’s academic journey reflects consistent excellence across multiple engineering disciplines. He earned his <strong>Bachelor of Engineering (BEng) in Production Engineering</strong> from the University of Benin, graduating <strong>First Class with Honors as the Best Graduating Student</strong> in his program.</p><p>Advancing his technical expertise internationally, he relocated to the United Kingdom where he completed his <strong>Master’s degree in Electronic and Electrical Engineering</strong> at the University of Leeds, achieving <strong>Distinction</strong>. He subsequently earned his <strong>Doctor of Philosophy (PhD) in Industrial Engineering</strong> with specialization in maintenance and reliability engineering.</p><p>This comprehensive academic foundation — spanning production systems, electrical engineering, and industrial optimization — positions him uniquely at the intersection of traditional engineering excellence and cutting-edge technology innovation.</p><h3>Entrepreneurial Leadership</h3><h3>SquarePyramid Limited: Technology Innovation Company</h3><p>As Founder and CEO of <strong>SquarePyramid Limited</strong>, Dr. Okonta leads a Canadian technology company specializing in automation, artificial intelligence, and scalable digital solutions. SquarePyramid serves as the parent company for innovative products that transform how businesses connect with audiences and optimize operations.</p><h3>Key Product Portfolio:</h3><p><strong>iEndorse</strong> — The flagship product representing a paradigm shift in authentic influence marketing. Dr. Okonta identified a critical gap where small and medium enterprises lacked access to meaningful influencer partnerships, while everyday consumers possessed untapped endorsement potential. iEndorse operates as a <strong>decentralized marketing and endorsement platform</strong> that democratizes brand advocacy by connecting businesses directly with micro-influencers and authentic community voices. The platform addresses three key market inefficiencies:</p><ul><li><strong>Accessibility</strong>: Enabling SMEs to leverage influencer marketing without prohibitive costs</li><li><strong>Authenticity</strong>: Creating genuine connections between brands and real customers</li><li><strong>Measurability</strong>: Providing transparent, data-driven campaign performance metrics</li></ul><p>Under his leadership, iEndorse has established market presence across Nigeria and is expanding internationally, positioning itself as the premier platform for grassroots marketing engagement.</p><p><strong>SquareMethods</strong> — A digital transformation solution for industrial maintenance, converting traditional SOPs into QR-accessible, mobile-optimized job aids that reduce equipment downtime and enhance technician effectiveness.</p><p><strong>Strategic Consulting Services</strong> — Providing automation, AI, and machine learning implementation strategies for organizations seeking operational excellence.</p><h3>Technical Competencies</h3><h3>Engineering &amp; Operations:</h3><ul><li>Industrial Reliability &amp; Predictive Maintenance (10+ years)</li><li>Advanced Data Analytics and Condition Monitoring Systems</li><li>Operational Excellence and Process Optimization</li></ul><h3>Technology Stack:</h3><ul><li>Cloud Computing Architecture (AWS: Kinesis, Athena, S3, Lambda)</li><li>Full-Stack Development (Node.js, Angular, MongoDB, PostgreSQL)</li><li>Business Intelligence (Grafana, Dashboard Development)</li><li>Automation and IoT Integration</li></ul><h3>Business Leadership:</h3><ul><li>Strategic Product Development and Market Entry</li><li>Cross-Cultural Business Development (North America, West Africa)</li><li>Technology Commercialization and Scaling</li></ul><h3>Vision &amp; Market Philosophy</h3><p>Dr. Okonta’s strategic approach is grounded in a fundamental market insight: <strong>“Global markets possess abundant resources, but lack efficient systems for optimal distribution and accessibility.”</strong>This philosophy drives his focus on building technology platforms that eliminate friction between supply and demand, particularly in underserved market segments.</p><p>His leadership of iEndorse exemplifies this approach — recognizing that authentic influence exists across all demographics, but traditional marketing systems have failed to create accessible pathways for mutual value creation between brands and everyday consumers.</p><h3>Current Strategic Focus</h3><p>Dr. Okonta is actively scaling <strong>iEndorse</strong> as a global platform for authentic influencer marketing, with particular emphasis on emerging markets where traditional advertising models have limited penetration. Simultaneously, he continues to expand SquareMethods within the Canadian industrial sector, establishing it as a leading digital maintenance solution.</p><p>His long-term objective centers on building sustainable technology businesses that create measurable economic impact while solving fundamental market inefficiencies.</p><p><em>Dr. Christian Okonta combines rigorous engineering methodology with entrepreneurial vision to build technology solutions that democratize access to opportunities and optimize business outcomes across diverse markets.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=058db54f4251" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Lost Notifications to Proactive Maintenance: Building a Data-Driven Solution for Asset…]]></title>
            <link>https://medium.com/@okonta.christian/from-lost-notifications-to-proactive-maintenance-building-a-data-driven-solution-for-asset-8847cbf6ccc2?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/8847cbf6ccc2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Sat, 15 Feb 2025 02:10:07 GMT</pubDate>
            <atom:updated>2025-02-15T02:10:07.689Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Lost Notifications to Proactive Maintenance: Building a Data-Driven Solution for Asset Management</h3><p><strong>Introduction:</strong></p><p>In today’s competitive manufacturing environment, downtime due to equipment failures can significantly impact profitability. Traditional methods of asset management often struggle with inefficient communication and reactive maintenance, leading to lost production time and increased repair costs. This project aimed to address this challenge by developing a data-driven solution to improve asset management efficiency and reduce breakdowns.</p><p><strong>The Problem:</strong></p><p>A manufacturing plant was experiencing a significant communication gap between Asset Management (AM) and Production Maintenance (PM). This resulted in:</p><ul><li>Unattended Notifications: Over 1,000 notifications related to equipment anomalies were left unattended, leading to defects escalating into breakdowns.</li><li>Operator Disengagement: Operators were discouraged from reporting issues due to the lack of visibility and timely action.</li><li>Inefficient Repair Process: The lack of a centralized and organized notification system led to delays in defect identification and resolution.</li></ul><p><strong>The Solution:</strong></p><p>We developed a data-driven solution using a combination of data extraction, machine learning, and visualization tools to create a real-time maintenance notification system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*mrt1Zbtk8y68IzT3WH1gIA.gif" /><figcaption>Notification System</figcaption></figure><p>Steps Taken:</p><p><em>Data Acquisition and Preparation:</em></p><ul><li>Scripted data extraction from SAP using BAPI/RFC functions to collect details on notifications, equipment, defect classifications, and maintenance history.</li><li>Cleaned and transformed the extracted data to ensure consistency and accuracy for further analysis.</li></ul><p><em>Machine Learning for Defect Classification:</em></p><ul><li>Designed and implemented a classification algorithm using supervised learning to categorize notifications based on defect type and assign priority levels.</li><li>Trained the algorithm on historical notification data to improve its accuracy in identifying patterns and predicting defect categories.</li></ul><p><em>VBA-Powered Excel System:</em></p><ul><li>Developed a user-friendly VBA application within Excel to:</li><li>Import and process data from SAP using the data extraction script.</li><li>Apply the machine learning model to classify notifications.</li><li>Generate dynamic dashboards and visualizations to track key metrics.</li><li>Display real-time information on televisions in the maintenance office.</li></ul><p><em>Visualization and Television Display:</em></p><ul><li>Created interactive dashboards and visualizations to:</li><li>Display key metrics such as notification age, closure rate, and breakdown frequency.</li><li>Visualize the distribution of defects by type, priority, and equipment.</li><li>Provide real-time updates on notification status.</li><li>Developed a mechanism to connect the Excel system to televisions and dynamically update the displayed information.</li></ul><p><em>Deployment and Evaluation:</em></p><ul><li>Conducted a pilot test with the maintenance team to evaluate the system’s functionality and gather feedback.</li><li>Deployed the system after addressing user feedback and optimizing performance.</li><li>Monitored key performance indicators (KPIs) to track the system’s impact on notification response time, defect resolution rate, and overall equipment effectiveness (OEE).</li></ul><p><strong>Impact and Results:</strong></p><ul><li>Improved Communication and Collaboration: The new system significantly improved communication and collaboration between AM and PM teams.</li><li>Increased Notification Response Rate: The number of unattended notifications decreased significantly, reducing the risk of escalating defects into breakdowns.</li><li>Enhanced Defect Identification and Resolution: Operators were more motivated to report issues, and the automated classification algorithm helped to expedite the defect resolution process.</li><li>Reduced Equipment Downtime: The proactive approach to addressing anomalies led to a reduction in breakdowns and improved overall equipment efficiency.</li></ul><p><strong>Conclusion:</strong></p><p>This project successfully leveraged data science and machine learning to address a real-world business challenge. The new maintenance notification system proved to be a valuable asset in improving asset management practices and reducing downtime, leading to significant cost savings and increased operational efficiency.</p><p>This project demonstrates my ability to:</p><ul><li>Gather, Clean, and Analyze Data: I successfully extracted, cleaned, and prepared data from a real-world system.</li><li>Develop and Implement Machine Learning Models: I created and applied a classification algorithm to automate defect categorization.</li><li>Develop Data Visualization Tools: I designed interactive dashboards and visualizations to present key metrics and insights.</li><li>Build User-Friendly Solutions: I developed a user-friendly interface to allow for efficient data management and information access.</li><li>Solve Real-World Business Problems: I addressed a significant business challenge by developing a solution that improved communication, efficiency, and operational performance.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8847cbf6ccc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoiding Data Nightmares: Tackling Schema Variations in IoT Sensor Data with AWS Lambda]]></title>
            <link>https://medium.com/@okonta.christian/avoiding-data-nightmares-tackling-schema-variations-in-iot-sensor-data-with-aws-lambda-4d3cb2bca2ec?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d3cb2bca2ec</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 18:23:08 GMT</pubDate>
            <atom:updated>2024-10-25T18:23:08.733Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jKbIWlEZZ01I5yxV.png" /></figure><p>Imagine showing up to this machine learning monitoring dashboard on a Monday morning, where everything was working just fine before the close of business on Friday. It’s a nightmare scenario for everyone in the data field, particularly for data engineers and data scientists.</p><p>This usually happens when variations in data schema affect the execution of a data query. It’s even more common when you’re not completely in control of the data source or when the data comes from a third-party system. The data payload may vary depending on the features included at the point of generation.</p><p>In my experience working with sensor data, the payload often contains different schemas based on specific circumstances. Occasionally, the event payload may differ, and in some cases, the sensor could employ multiple versions of the predefined schema due to operating system updates or other factors beyond the scope of this discussion.</p><p>To handle schema and partition-related issues effectively, I recommend performing data transformation before sending it to the final data catalog. This ensures that only the relevant fields are transferred, and for any excluded fields, a predefined value like NULL is assigned. NULL values are widely recognized by query languages like SQL, helping avoid potential errors during query execution.</p><p>Here’s how this can be done using a Lambda function that decodes and processes data from a Kinesis stream before sending it to the final storage.</p><h3>Lambda Transformation of Kinesis Stream Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3CfrEk3eEqip6N25aaAkw.png" /></figure><p>In this Lambda function, the goal is to transform incoming data from a Kinesis Firehose stream by decoding base64-encoded sensor data and restructuring it to extract important information. The function processes sensor readings, including acceleration, velocity, temperature, and classification models (vibration ISO and temperature ML), while also handling variations in the incoming schema.</p><p>Below is the code snippet with an explanation.</p><pre>import base64<br>import json<br><br>def lambda_handler(event, context):<br>    output_records = []<br>    try:<br>        for record in event[&#39;records&#39;]:<br>            # Decode base64 data<br>            data = base64.b64decode(record[&#39;data&#39;]).decode(&#39;utf-8&#39;)<br>            event_data = json.loads(data)<br><br>            # Process the event payload<br>            parsed_data = process_event_payload(event_data)<br><br>            # Prepare the output record<br>            output_record = {<br>                &#39;recordId&#39;: record[&#39;recordId&#39;],<br>                &#39;result&#39;: &#39;Ok&#39;,<br>                &#39;data&#39;: base64.b64encode(json.dumps(parsed_data).encode(&#39;utf-8&#39;)).decode(&#39;utf-8&#39;)<br>            }<br>            output_records.append(output_record)<br><br>        return {<br>            &quot;records&quot;: output_records<br>        }<br><br>    except Exception as e:<br>        print(f&quot;Error: {str(e)}&quot;)<br>        return {<br>            &quot;statusCode&quot;: 500,<br>            &quot;body&quot;: json.dumps(&quot;Error processing data.&quot;)<br>        }</pre><h4>Explanation:</h4><ol><li><strong>Data Decoding</strong>:</li></ol><ul><li>The Lambda function first takes the base64-encoded data from Kinesis and decodes it into a JSON string.</li><li>This decoded JSON represents the sensor readings and metadata.</li></ul><p><strong>2. Processing Event Payload</strong>:</p><ul><li>The process_event_payload() function is responsible for extracting key pieces of information from the sensor data.</li><li>Below is the function that restructures and extracts important fields like acceleration, velocity, temperature, and classification model outputs (vibration ISO and temperature ML).</li></ul><pre>def process_event_payload(event_data):<br>    def safe_get(d, keys, default=None):<br>        for key in keys:<br>            d = d.get(key, default)<br>            if d is default:<br>                return default<br>        return d<br><br>    parsed_data = {<br>        &quot;timestamp&quot;: event_data.get(&#39;timestamp&#39;),<br>        &quot;eventId&quot;: event_data.get(&#39;eventId&#39;),<br>        &quot;version&quot;: event_data.get(&#39;version&#39;),<br>        &quot;accountId&quot;: event_data.get(&#39;accountId&#39;),<br>        &quot;projectName&quot;: event_data.get(&#39;projectName&#39;),<br>        &quot;eventPayload&quot;: {<br>            &quot;siteName&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;siteName&#39;]),<br>            &quot;assetName&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;assetName&#39;]),<br>            &quot;sensor&quot;: {<br>                &quot;physicalId&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;sensor&#39;, &#39;physicalId&#39;]),<br>                &quot;rssi&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;sensor&#39;, &#39;rssi&#39;])<br>            },<br>            &quot;features&quot;: {<br>                &quot;acceleration&quot;: {<br>                    &quot;band0To6000Hz&quot;: {<br>                        &quot;xAxis&quot;: {&quot;rms&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;features&#39;, &#39;acceleration&#39;, &#39;band0To6000Hz&#39;, &#39;xAxis&#39;, &#39;rms&#39;])},<br>                        &quot;yAxis&quot;: {&quot;rms&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;features&#39;, &#39;acceleration&#39;, &#39;band0To6000Hz&#39;, &#39;yAxis&#39;, &#39;rms&#39;])},<br>                        &quot;zAxis&quot;: {&quot;rms&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;features&#39;, &#39;acceleration&#39;, &#39;band0To6000Hz&#39;, &#39;zAxis&#39;, &#39;rms&#39;])},<br>                    }<br>                },<br>                &quot;temperature&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;features&#39;, &#39;temperature&#39;]),<br>            },<br>            &quot;models&quot;: {<br>                &quot;vibrationISO&quot;: {<br>                    &quot;previousPersistentClassificationOutput&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;models&#39;, &#39;vibrationISO&#39;, &#39;previousPersistentClassificationOutput&#39;]),<br>                    &quot;persistentClassificationOutput&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;models&#39;, &#39;vibrationISO&#39;, &#39;persistentClassificationOutput&#39;]),<br>                    &quot;pointwiseClassificationOutput&quot;: safe_get(event_data, [&#39;eventPayload&#39;, &#39;models&#39;, &#39;vibrationISO&#39;, &#39;pointwiseClassificationOutput&#39;]),<br>                }<br>            }<br>        }<br>    }<br><br>    return parsed_data</pre><p><strong>3. Handling Schema Variations</strong>:</p><ul><li>The function uses a helper method safe_get() to safely extract nested values from the JSON structure, ensuring that missing fields don’t cause errors during processing.</li></ul><p><strong>4. Output Preparation</strong>:</p><ul><li>After processing the event payload, the function encodes the transformed data back to base64, which is required by Kinesis Firehose.</li><li>The result is stored in the output_records list with a recordId and a status of &#39;Ok&#39;, indicating successful processing.</li></ul><p><strong>5. Error Handling</strong>:</p><ul><li>If an error occurs, the function catches the exception and logs it, returning an error status.</li></ul><p>This approach allows the Lambda function to reliably decode and process the Kinesis stream data, extracting essential information for use in condition monitoring. The transformation ensures that the data is structured properly for further analysis and visualization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d3cb2bca2ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Lambda Transformation for Kinesis Stream Data]]></title>
            <link>https://medium.com/@okonta.christian/aws-lambda-transformation-for-kinesis-stream-data-709e0fc1a43d?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/709e0fc1a43d</guid>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 18:03:11 GMT</pubDate>
            <atom:updated>2024-10-25T18:33:45.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3CfrEk3eEqip6N25aaAkw.png" /></figure><h4>Objective:</h4><p>The primary objective of this Lambda function is to transform and process incoming data from an Amazon Kinesis Data Firehose stream. The data originates from IoT sensors (vibration, temperature, acceleration, and velocity sensors) used in condition monitoring of equipment such as the ‘Cooker’ and ‘Gearbox’. The transformation includes decoding, parsing, and handling schema variations in the incoming data to ensure consistent formatting and analysis in downstream systems such as Amazon S3 or Amazon Athena.</p><h4>Key Components:</h4><ol><li><strong>Base64 Decoding</strong>: The data arriving through Kinesis Data Firehose is base64-encoded. The Lambda function first decodes the base64 payload.</li></ol><pre>import base64<br>def lambda_handler(event, context):<br>    for record in event[&#39;records&#39;]:<br>        payload = base64.b64decode(record[&#39;data&#39;])<br>        # Further processing here...</pre><p>2. <strong>Data Parsing</strong>: After decoding, the payload contains JSON data with nested structures. This JSON includes information such as:</p><ul><li><strong>Site Information</strong>: siteName, assetName, positionName</li><li><strong>Sensor Details</strong>: sensor.physicalId, sensor.rssi</li><li><strong>Vibration and Temperature Features</strong>: Data on vibration (broken into different frequency bands and axes) and temperature measurements</li><li><strong>Models</strong>: Output from machine learning models that predict the health of the assets</li></ul><p>Example structure of the eventPayload field:</p><pre>{<br>  &quot;siteName&quot;: &quot;Cadbury&quot;,<br>  &quot;assetName&quot;: &quot;Cooker&quot;,<br>  &quot;positionName&quot;: &quot;Gearbox&quot;,<br>  &quot;sensor&quot;: {<br>    &quot;physicalId&quot;: &quot;sensor123&quot;,<br>    &quot;rssi&quot;: -70<br>  },<br>  &quot;features&quot;: {<br>    &quot;acceleration&quot;: {<br>      &quot;band0To6000Hz&quot;: {<br>        &quot;xAxis&quot;: { &quot;rms&quot;: 0.2 },<br>        &quot;yAxis&quot;: { &quot;rms&quot;: 0.3 },<br>        &quot;zAxis&quot;: { &quot;rms&quot;: 0.1 }<br>      }<br>    },<br>    &quot;temperature&quot;: 75.3<br>  },<br>  &quot;models&quot;: {<br>    &quot;vibrationISO&quot;: {<br>      &quot;isoClass&quot;: &quot;Class1&quot;,<br>      &quot;pointwiseClassificationOutput&quot;: &quot;HEALTHY&quot;,<br>      &quot;previousPersistentClassificationOutput&quot;: &quot;WARNING&quot;<br>    }<br>  }<br>}</pre><p>3. <strong>Handling Schema Variations</strong>: One challenge in the Lambda function is handling schema variations in the eventPayload. Some sensors might return data with missing fields or in a different structure, causing issues during downstream processing.</p><p>To handle this, the Lambda function checks for the existence of fields before attempting to process them. For example:</p><pre>def process_payload(payload):<br>    # Check if the expected fields exist<br>    if &#39;eventPayload&#39; in payload:<br>        event_payload = payload[&#39;eventPayload&#39;]<br>        <br>        # Extract specific fields safely<br>        asset_name = event_payload.get(&#39;assetName&#39;, &#39;Unknown&#39;)<br>        position_name = event_payload.get(&#39;positionName&#39;, &#39;Unknown&#39;)<br>        vibration_data = event_payload.get(&#39;features&#39;, {}).get(&#39;acceleration&#39;, {})<br>        <br>        # Process vibration data safely, handle nested structures<br>        rms_x = vibration_data.get(&#39;band0To6000Hz&#39;, {}).get(&#39;xAxis&#39;, {}).get(&#39;rms&#39;, None)<br>        # Additional processing...</pre><p>4. <strong>Classification Output</strong>: The models section of the payload contains outputs from machine learning models like vibrationISO and temperatureML. The pointwiseClassificationOutput field is particularly important as it shows the real-time state of the asset (e.g., &#39;HEALTHY&#39;, &#39;WARNING&#39;, &#39;ALARM&#39;).</p><p>The Lambda function processes this field and can transform or filter the data based on specific conditions (such as filtering only ‘WARNING’ and ‘ALARM’ states):</p><pre>state = event_payload.get(&#39;models&#39;, {}).get(&#39;vibrationISO&#39;, {}).get(&#39;pointwiseClassificationOutput&#39;, &#39;UNKNOWN&#39;)<br>if state in [&#39;WARNING&#39;, &#39;ALARM&#39;]:<br>    # Process accordingly</pre><p>5. <strong>Error Handling</strong>: For robustness, the Lambda function includes error handling to manage missing or malformed data. It ensures that incomplete payloads do not break the transformation process and logs any irregularities for debugging purposes.</p><pre>try:<br>    payload = json.loads(base64.b64decode(record[&#39;data&#39;]))<br>    process_payload(payload)<br>except KeyError as e:<br>    print(f&quot;Missing key: {e}&quot;)<br>except Exception as e:<br>    print(f&quot;Error processing record: {e}&quot;)</pre><p>6. <strong>Output</strong>: The transformed data is re-encoded and sent back to Kinesis Data Firehose or stored in an S3 bucket, depending on your architecture. The output data typically includes only the relevant fields required for condition monitoring and analysis.</p><pre>transformed_payload = {<br>    &quot;siteName&quot;: asset_name,<br>    &quot;positionName&quot;: position_name,<br>    &quot;classificationState&quot;: state,<br>    &quot;timestamp&quot;: timestamp,<br>    # Other fields...<br>}<br># Re-encode the payload as base64 for output to Kinesis or Firehose<br>encoded_payload = base64.b64encode(json.dumps(transformed_payload).encode(&#39;utf-8&#39;)).decode(&#39;utf-8&#39;)</pre><h4>Challenges Addressed:</h4><ul><li><strong>Schema Mismatch</strong>: The Lambda function addresses inconsistencies between sensor data schemas by programmatically checking for field existence before processing.</li><li><strong>Real-time Processing</strong>: The function handles real-time data from sensors and ensures quick transformation to meet near-instantaneous monitoring needs.</li><li><strong>Historical Data Management</strong>: The function can handle historical data points by referencing fields such as previousPersistentClassificationOutput to track asset state changes over time.</li></ul><h4>Conclusion:</h4><p>This documentation provides a comprehensive explanation of the Lambda transformation process, focusing on how it decodes, parses, handles schema variations, and processes real-time sensor data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=709e0fc1a43d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Multi-Hat Journey to Condition Monitoring and Predictive Maintenance with Amazon Monitron]]></title>
            <link>https://medium.com/@okonta.christian/a-multi-hat-journey-to-condition-monitoring-and-predictive-maintenance-with-amazon-monitron-1167607bea3c?source=rss-728a4d9e3217------2</link>
            <guid isPermaLink="false">https://medium.com/p/1167607bea3c</guid>
            <dc:creator><![CDATA[Christian Ighohor Okonta, PhD]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 15:48:46 GMT</pubDate>
            <atom:updated>2024-10-25T18:40:44.849Z</atom:updated>
            <content:encoded><![CDATA[<p>How I Applied Expertise in Maintenance Management, DevOps, Data Engineering, and Data Science to Implement a Complete Predictive Maintenance Solution with Amazon Monitron and Grafana</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sl6N_fblw3pnN6FxZ_QDrA.png" /><figcaption>Condition Monitoring Dashboard (Image credit: Author)</figcaption></figure><p>Over the past few weeks, I have immersed myself in a journey focused on condition monitoring and predictive maintenance. The experience has been both challenging and extremely rewarding, allowing me to utilize my expertise across various fields. This project has pushed me to apply my specialties in maintenance management, DevOps, data engineering, and data science.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*k72MrGKJAfeKIXhR9OBPnA.png" /><figcaption>Implementation Amazon Monitron CBM</figcaption></figure><p><strong>Maintenance Management</strong>: I applied my understanding of what needs to be monitored, the importance of key parameters, and how best to measure them. Focusing on vibration and temperature monitoring, more than 70% of mechanical failures can be detected by tracking changes in these parameters. Vibration monitoring is a broad approach and one of the most accurate, providing extensive data like acceleration in the x, y, and z axes, velocity, crest factor, and temperature, across frequency bands from 0 to 1000 Hz. These parameters are used to detect anomalies in bearings, gearboxes, electric motors, and pumps, identifying failure modes such as lack of lubrication, pump cavitation, misalignment, and excessive wear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*eV4iolMswKQWlY2tKOelJw.jpeg" /><figcaption>Machine failure</figcaption></figure><p><strong>Technology Selection</strong>: The next critical step was choosing the right technology for sensors, gateways, cloud storage, and visualization. This is where my expertise as a DevOps engineer became invaluable. After thorough research, I selected Amazon Monitron, an excellent end-to-end system for condition monitoring. It’s seamless, secure, and highly effective, built on AWS IoT, and it integrates easily with other Amazon services. This was a big advantage since one of my top priorities was streaming data and applying statistical models and machine learning algorithms for predictive maintenance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*d5nvXIOFE6Vsyjzqd7yO-Q.jpeg" /><figcaption>Amazon Monitron</figcaption></figure><p><strong>Data Engineering</strong>: After configuring the system, the next step was obtaining live, clean data for further analysis. I configured the live data stream using Kinesis Firehose to stream the data to an S3 bucket. That was just the beginning. Next, I needed to determine the data schema, so I used AWS Glue and a crawler to create a data catalog that I could query with Athena. It was a relief to use SQL for querying my data, but understanding the schema and the parameters’ meaning was essential for performing meaningful analysis. Knowing what analysis to conduct and understanding the implications of every result was crucial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*mgdzbJlXanI0st7Byx3zrA.jpeg" /><figcaption>Technologies for generating insignhts</figcaption></figure><p><strong>Data Science</strong>: This is my favorite part. I opened Google Colab, connected my Python environment to stream from my S3 bucket, and after setting everything up, I could finally see my data in Jupyter.</p><p>Hold on — there was a new client request: “Thanks for the visualization of the vibration and temperature data for our equipment. We’re getting value for our money, but we’d like to project this dashboard across the plant.” I replied, “Fair enough, that’s easy with televisions and projectors.” After setting up the displays, guess what — Oliver asked for more! He wanted a summary dashboard for the operational technology and management teams to have a holistic view of the machine statuses, sensor positions, and other insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*xFAJOIy2VbZqjOyqnTtRfQ.png" /><figcaption>Vibration readings</figcaption></figure><p><strong>Visualization Challenges</strong>: Amazon Monitron doesn’t offer this out-of-the-box. So, I put on my DevOps hat again and configured a Grafana dashboard for visualization and alerts. I started with AWS Managed Grafana, but the Athena plugin required an enterprise account and wasn’t free. AWS and Grafana need to make their money, I guess! Not wanting to incur extra costs, I decided to launch an EC2 Linux instance with my favorite Ubuntu OS. I configured AWS CLI, granted the necessary permissions, and tested to make sure my S3 bucket was accessible. Then, I installed Grafana, configured the firewalls, and exposed port 3000. Boom! Grafana was live. I installed the Athena plugin (the reason I left the managed version), connected the data source, and successfully tested the connection.</p><p>Next, I donned my data scientist hat once again, this time working with SQL rather than Python. I ran the first query successfully, but when I went back to AWS Glue to run the crawler and refresh my tables, I encountered errors in Grafana due to schema mismatches. It turns out the crawler was changing the schema whenever it ran, causing issues. The solution was simple — ignore null sensor sites to avoid changing the schema.</p><p><strong>Final Steps</strong>: With clean data ready, I returned to Grafana and began building dashboards. However, I had to ensure I fully understood each parameter, like the “VibrationISO persistentClassificationOutput.” Flattening the data was a crucial step in cleaning it for this project.</p><p>Finally, I wore my maintenance and reliability engineer hat, reviewing the meaning and interpretation of each parameter in the payload, testing and confirming their implications, and verifying event types and their respective payload content. Now, with the help of my data scientist hat, I built dashboards combining SQL queries with Grafana charts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Zv8r99pIC7rIJDEg3bfd5Q.png" /></figure><p>And a shoutout to my buddy, ChatGPT! At first, she was confused, but once I shared the data schema and ensured she understood it, she was able to help me troubleshoot effectively.</p><p>The project was a success! Now, the next phase involves exploring various statistical and machine learning models for predictions. Though this is outside the scope of the project, once you find something that encompasses all your expertise, you won’t want to stop.</p><p>Feel free to book a call <a href="https://calendly.com/okonta-christian/30min">https://calendly.com/okonta-christian/30min</a> and ask me anything about condition monitoring, predictive maintenance, or Amazon Monitron!</p><p>Share your thoughts with me in the comment section!</p><p><a href="https://squaremethods.com/">Author</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*Sof1gaZlp_toEzpt.jpg" /></figure><p><a href="https://www.linkedin.com/in/christian-okonta-ph-d-b7664b106/">Christian Okonta, PhD</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1167607bea3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>