## 2 Materials and Methods
### Azure IoT Hub Infrastructure in Industry 4.0 Manufacturing  
Azure IoT Hub acts as the central communication and management platform that integrates the ESP32-CAM, M5 Stack, and Asus Tinker Board for a mixing devices typology demo purpose, ensuring compatibility across devices with different functions:* Azure IoT Hub standardizes communication between devices, regardless of type or protocol, enabling seamless data exchange and remote management. Each device is registered and configured within the IoT Hub. Figure 4 depicts the associated devices (ESP32-CAM, M5 Stack, and Asus Thinker Board) in Azure IoT Hub;
* Azure IoT Hub uses Azure Event Grid Trigger and Azure Functions to orchestrate actions based on real-time alerts and conditions. For example, if the ESP32-CAM detects a defect, Azure IoT Hub triggers a response from the M5 Stack for additional monitoring and adjustments.  
As new devices are added to the production line (e.g., additional sensors or quality control cameras, such as CastDevice in Figure 4), they can be easily integrated into the Azure IoT Hub infrastructure. This modular approach aligns with the Industry 4.0 principle of scalability, allowing the system to evolve as production needs change.  
Figure 4 shows the device management interface in Azure IoT Hub, specifically for an IoT Hub instance named castHub. This interface provides a centralized overview and management options for all devices registered within the hub, part of the smart manufacturing process in an Industry 4.0 cast production environment. Figure 4 lists the following information about Hub traffic:  
1. Device List includes the demonstration proposed devices setup for the cast manufacturing process, each with a unique Device ID: * ESP32-CAM--used for capturing images of casts and sending quality assessment alerts; * CastDevice--represents a generic device dedicated to monitoring or controlling the specific machinery or equipment involved in cast production; * M5 Stack--involved in real-time monitoring and adjustment of machine parameters, such as temperature, to maintain optimal manufacturing conditions; * AsusThinker--handles final quality verification and data logging.
2. The Device Type listed as an IoT Device indicates that all devices are connected to the IoT Hub and interact through this central platform. These devices use Azure IoT protocols to communicate, send data, and receive commands within the production infrastructure.
3. Status shows that all devices are marked as Enabled, which means they are active and ready for data transmission and command execution through Azure IoT Hub. This status maintains real-time operations and continuous monitoring within the production line.
4. The Authentication Type for all devices is set to Shared Access Signature (SAS). SAS tokens are commonly used for secure, time-limited access to Azure IoT resources.  
Figure 4: Device management interface in Azure IoT Hub for cast manufacturing.  
They ensure that each device can only access the hub for a specified period, increasing security within the manufacturing network.
5. The C2D Messages Queued column shows each device's pending messages. In this case, all devices have a count of 0, indicating no messages are waiting to be processed.  
In this context, the operators monitor the status, update configurations, and manage each device remotely with the devices connected to Azure IoT Hub. Figure 4 highlights how Azure IoT Hub provides a unified platform for monitoring, securing, and managing IoT devices in a cloud-connected manufacturing environment.