A containerized MTConnect agent implementation that provides manufacturing equipment connectivity and data collection capabilities. This repository contains the official Docker container release of the MTConnect C++ Agent, customized for HEMsaw manufacturing systems.
This project packages the official MTConnect Institute C++ Agent into a Docker container with custom styling and configuration for manufacturing data collection and monitoring. The MTConnect agent:
- Collects Manufacturing Data: Connects to manufacturing equipment (CNC machines, robots, sensors) via adapters
- Provides REST API: Exposes machine data through standardized MTConnect REST endpoints
- Real-time Monitoring: Streams live manufacturing data including machine status, tool conditions, and production metrics
- Asset Management: Manages manufacturing assets like cutting tools, fixtures, and pallets
- MQTT Integration: Publishes manufacturing data to MQTT brokers for integration with other systems
- Web Interface: Includes a custom Bootstrap-based web UI for visualizing machine data
- MTConnect 2.6+ Compliance: Latest version with support for DataSets, WebSockets, and enhanced validation
- Multi-Protocol Support: SHDR, MQTT, WebSocket adapters for equipment connectivity
- Custom HEMsaw Styling: Professional web interface with HEMsaw branding and logos
- Production Ready: Configured with proper logging, health checks, and restart policies
- Multi-Architecture: Supports both AMD64 and ARM64 platforms
The system consists of two main services:
- MTConnect Agent (
mtc_agent): Core agent that collects and serves manufacturing data - MQTT Broker (
mosquitto): Message broker for real-time data distribution
- Create a
docker-compose.ymlfile:
version: '3.5'
services:
mtc_agent:
container_name: mtc_agent
hostname: mtc_agent
image: hemsaw/mtconnect:latest
user: agent
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes:
- "/etc/mtconnect/config/:/mtconnect/config/"
- "/etc/mtconnect/data/ruby/:/mtconnect/data/ruby/"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- 5000:5000/tcp
entrypoint: "/usr/bin/mtcagent run /mtconnect/config/agent.cfg"
working_dir: "/home/agent"
restart: unless-stopped
depends_on:
- mosquitto
mosquitto:
container_name: mosquitto
hostname: mosquitto
image: hemsaw/mosquitto:latest
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes:
- "/etc/mqtt/config/mosquitto.conf:/mosquitto/config/mosquitto.conf"
- "/etc/mqtt/data/passwd:/mosquitto/data/passwd"
- "/etc/mqtt/data/acl:/mosquitto/data/acl"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- 1883:1883/tcp
- 9001:9001/tcp
restart: unless-stopped- Set proper permissions for MQTT security files:
chmod 0700 ./mqtt/data/passwd
chmod 0700 ./mqtt/data/acl- Start the services:
docker-compose up --remove-orphans -d- Access the web interface at
http://localhost:5000
docker build . -t "mtc_agent:latest"docker run --name agent --rm -it mtc_agentdocker-compose builddocker-compose up --remove-orphans -ddocker-compose downdocker-compose logsmtcagent [help|install|debug|run] [configuration_file]
help Prints this message
install Installs the service
remove Remove the service
debug Runs the agent on the command line with verbose logging
run Runs the agent on the command line
config_file The configuration file to load
Default: agent.cfg in current directoryOnce running, the agent provides these REST endpoints:
- Probe:
http://localhost:5000/probe- Device capabilities and structure - Current:
http://localhost:5000/current- Current state of all data items - Sample:
http://localhost:5000/sample- Historical data samples - Assets:
http://localhost:5000/assets- Manufacturing assets (tools, fixtures, etc.)
The agent uses configuration files mounted at /mtconnect/config/. Key configuration options include:
- Device Models: Define your manufacturing equipment in
Devices.xml - Agent Settings: Configure ports, logging, and adapters in
agent.cfg - MQTT Settings: Configure MQTT broker connection and topics
- Validation: Enable MTConnect document validation for data quality
Push manufacturing assets (cutting tools, fixtures, etc.) using curl:
curl -d @TOOL_ID.xml 'http://localhost:5000/assets/TOOL_ID.1?device=YourDevice&type=CuttingTool'The agent supports multiple protocols for equipment integration:
- SHDR: MTConnect's Simple Streaming Protocol
- MQTT: Bidirectional MQTT communication
- WebSockets: Real-time web-based data streaming
- File-based: Configuration and static data import
This container includes custom HEMsaw branding and a responsive web interface built with Bootstrap. The styling provides:
- Professional dashboard for machine monitoring
- Tabbed interface for Probe, Current, and Sample data
- Mobile-responsive design
- HEMsaw logos and branding
See ChangeLog.md for detailed release notes. This container tracks the official MTConnect Institute agent releases with HEMsaw-specific customizations.
This is a production deployment container for HEMsaw manufacturing systems. For MTConnect protocol questions, refer to the MTConnect Standard. For container-specific issues, contact the HEMsaw development team.
This project uses automated GitHub Actions workflows to build and publish Docker images to Docker Hub under the hemsaw/mtconnect repository.
hemsaw/mtconnect:latest- Latest stable releasehemsaw/mtconnect:experimental- Development builds fromdevelopbranchhemsaw/mtconnect:X.X.X.X- Specific version releases (e.g.,2.6.0.3)hemsaw/mtconnect:X.X- Major.minor version (e.g.,2.6)
Pushes to the develop or dev branches automatically trigger experimental builds:
# Push changes to develop branch
git checkout develop
git add .
git commit -m "Add new feature"
git push origin developThis creates: hemsaw/mtconnect:experimental
Create and push a version tag to trigger a production release:
# Create and push a version tag
git checkout main
git tag 2.6.0.4
git push origin 2.6.0.4This creates:
hemsaw/mtconnect:latesthemsaw/mtconnect:2.6.0.4hemsaw/mtconnect:2.6
For manual deployments or testing:
docker build -t hemsaw/mtconnect:your-tag .docker login
# Enter your Docker Hub credentials# Push specific tag
docker push hemsaw/mtconnect:your-tag
# Push multiple tags
docker tag hemsaw/mtconnect:your-tag hemsaw/mtconnect:latest
docker push hemsaw/mtconnect:latestThe automated workflows build for multiple architectures:
linux/amd64(Intel/AMD x64)linux/arm64(ARM64/Apple Silicon)
To build multi-architecture images manually:
# Set up buildx
docker buildx create --use
# Build and push multi-arch
docker buildx build --platform linux/amd64,linux/arm64 \
-t hemsaw/mtconnect:your-tag --push .The following secrets must be configured in the GitHub repository:
DOCKERHUB_USERNAME- Docker Hub usernameDOCKERHUB_TOKEN- Docker Hub access token (not password)
Follow the MTConnect Agent version numbering scheme:
- Format:
MAJOR.MINOR.PATCH.BUILD(e.g.,2.6.0.3) - Major: MTConnect standard version
- Minor: Agent feature release
- Patch: Bug fixes and minor updates
- Build: HEMsaw-specific builds
Before creating a release:
- ✅ Update ChangeLog.md with release notes
- ✅ Test the build locally:
docker build . -t test-build - ✅ Verify multi-architecture compatibility
- ✅ Ensure all tests pass in GitHub Actions
- ✅ Create and push the version tag
- ✅ Monitor the GitHub Actions workflow
- ✅ Verify the image is available on Docker Hub
Based on the official MTConnect Institute C++ Agent. Custom styling and configurations are proprietary to HEMsaw.