How piovezan1207/central-4.0-eniac-2022 works
Project Type and Purpose
• This project is a component of a broader industrial automation system that integrates Amazon Alexa with an industrial plant (Planta Industrial 4.0 FESTO).
• Its role is to serve as the “Central Local” responsible for interpreting API calls (which come from the Alexa Skill and API Intermediária) and managing the control of industrial devices (CLPs and the robotic arm controller) using protocols such as MQTT.
• The system supports both sending commands to the industrial plant and receiving status feedback.
Analyzing the File Structure
• Key files such as main.py and import_map.py, along with a package named “project”, indicate that the Python code in this repository implements the central processing logic.
• error_class: likely handles error management.
• mqtt_class: contains mqttClient.py and mqttPublish.py, suggesting the use of MQTT for communication.
• stations_class: includes modules such as generic_station.py, station1.py, station5.py, station7.py, and a stations_superclass.py, implying that the system is designed to interface with various industrial stations.
• Additional modules like order.py and process.py likely manage control flow or command queues.
• There is also a “status_tables” directory containing CSV files with status codes, meaning that the system uses these tables to interpret device states and error messages.
Insights from the README
• The README clearly describes a four-part architecture:
a. Alexa Skill – which converts voice commands into HTTP requests.
b. API Intermediária – that passes these requests to the Central Local unit.
c. Central Local – where this Python code resides, handling communication with CLPs and the robotic manipulator.
d. Bidirectional Communication – ensuring commands and status updates are shared.
• Technologies mentioned include Amazon Alexa, a REST API (perhaps implemented in Node.js, Flask, or similar), MQTT for messaging, and protocols for industrial equipment control.
a. Main Components:
• Alexa Skill: This is the front-end for voice commands (although not present in this repo, it’s important to include as part of the overall system).
• API Intermediária: The REST layer that accepts HTTP requests from the Alexa Skill.
• Central Local (this Python-based module): Include sub-components such as:
• MQTT Module: Represent the mqttClient and mqttPublish classes.
• Error Handling Module: Represent the error_class.
• Station Management: Illustrate the stations_class modules (generic station and specific station implementations) to show how different industrial stations are handled.
• Process/Order Modules: Representing command processing and queuing logic.
• Industrial Equipment: At the bottom, include CLPs and the control unit for the manipulator robot.
b. Relationships and Interactions:
• Within Central Local, delineate interactions:
• Subsequent flows to the MQTT module for sending commands.
c. Architectural Patterns / Design Principles:
• Modular design: Clear separation into dedicated modules (error handling, MQTT communication, station control, command processing).
• Layered architecture: Distinct layers from voice command reception (Alexa Skill) to API processing and then centralized local control.
• Use of MQTT for asynchronous communication emphasizes a decoupled message-driven architecture.
d. Relevant Technologies and Frameworks:
• Python for the Central Local module.
• MQTT libraries (as indicated by mqttClient.py and mqttPublish.py).
• CSV-based configuration/status (from the status_tables folder).
• Although external to this repository, include Amazon Alexa and the REST API, which may be implemented using frameworks like Flask or Node.js.
Elements
• “MQTT Module” (linking to station commands)
• “Error Handling Module”
• “Station Management – [Station1, Station5, Station7, etc.]”
• “Process / Order Module”
• A “Status Tables” note indicating static configuration or lookup data.