## 3 Results
### Overcoming IoT Device Compatibility Challenges via Azure IoT Hub  
In the proposed system, the ESP32-CAM and MSStack devices are programmed using C++ within the Arduino Integrated Development Environment (IDE). However, the cast manufacturing IoT ecosystem also includes a variety of other devices and components that utilize different programming languages and operate on diverse platforms. For instance, some parts of the system are automated using Bash scripts, which are native to Unix-like operating systems and are employed for command-line task automation and system management, such as Asus Thinker Board, using ThinkerOS. Some components in this setup are developed in C# on Windows, using the.NET framework for integration with Windows-specific hardware and software. Because the system involves diverse technologies, compatibility problems arise in cast manufacturing. For example, devices programmed with C++ using the Arduino IDE, those running Bash scripts, and Windows-based C# applications must all operate seamlessly together. These challenges often stem from differences in data formats, communication protocols, and operating system requirements. For instance, sharing information between a microcontroller running a C++ program and a C# application on Windows can be complicated by varying serialization methods or network communication approaches. Figure 15: Infrastructure visualization of device connectivity and messaging metrics in Azure IoT Hub. To address these issues, we introduced a solution based on Azure IoT, particularly Azure IoT Hub, to consolidate these heterogeneous IoT devices under a single infrastructure. The Azure IoT Hub abstracts the complexities of device communication by supporting multiple industry-standard protocols, such as MQTT and Hypertext Transfer Protocol (HTTP), employed in the NIA. We implement Azure IoT Hub to establish a consistent messaging interface across all devices. The hub manages device identities and credentials, ensuring secure authentication and authorization. This unified communication framework allows devices in our system to send telemetry data to the cloud and receive configurations or commands from cloud applications without concern for underlying platform differences. A practical example in the proposed configuration is as follows:  
* When the ESP32-CAM captures images of the cast on the conveyor belt, it processes them and sends the relevant data to the Azure Custom Vision service for defect analysis. If a defect is detected, the ESP32-CAM sends a message to the Azure IoT Hub, indicating the need for action;
* The message from the ESP32-CAM is transmitted using the MQTT protocol supported by Azure IoT Hub. The data include information about the detected defect, such as its severity and location on the cast;
* A C# application running on a Windows-based monitoring system receives this information from Azure IoT Hub. Using the Azure IoT SDK for.NET, the application processes the data and alerts human operators through a user-friendly interface;
* Using RESTful APIs triggers automated actions such as flagging the defective cast for removal. We integrate Azure IoT Hub into the proposed configuration to create a solution that unifies our heterogeneous IoT devices into an ecosystem. This approach allows us to focus on our system's core functionalities, such as real-time defect detection and response, without cross-platform communication challenges. The tests that were conducted employed the abovementioned devices and validated cross-device compatibility. These tests demonstrated that Azure IoT Hub bridges the device's operating system and the application running on it. Figure 16 graphically represents one of the typologies involved in these tests. The ESP32-CAM, a sender device in the entire system, was programmed in C++ using the Arduino IDE. It was configured to capture defect-related images and send telemetry data to Azure IoT Hub via the MQTT protocol.