MQTT & Webhooks
Eryxon MES can push real-time production events to your external systems via Webhooks (HTTP) or MQTT (Industrial Messaging).
Webhooks (Outbound HTTP)
Section titled “Webhooks (Outbound HTTP)”Webhooks send HTTP POST requests to your endpoint when events occur.
Configuration
Section titled “Configuration”- URL: Your HTTPS endpoint.
- Events: Choose from
job.created,operation.completed,issue.created, etc. - Secret: Used for HMAC SHA256 signature verification.
Signature Verification (Node.js)
Section titled “Signature Verification (Node.js)”const crypto = require('crypto');const hmac = crypto.createHmac('sha256', secret);const digest = 'sha256=' + hmac.update(JSON.stringify(payload)).digest('hex');const isValid = crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(digest));MQTT Publishing (Outbound)
Section titled “MQTT Publishing (Outbound)”Eryxon publishes events to MQTT brokers using ISA-95 compliant Unified Namespace (UNS) topic patterns.
Topic Variables
Section titled “Topic Variables”Build dynamic topics using variables like {enterprise}, {site}, {area}, {cell}, and {event}.
Example Pattern:
{enterprise}/{site}/{area}/{cell}/{event}
Result:
acme/chicago/fabrication/laser_cutting/operation/completed
Message Payload
Section titled “Message Payload”{ "event": "operation.started", "timestamp": "2024-01-15T10:30:00Z", "data": { "operation_name": "Laser Cutting", "part_number": "BRACKET-A1", "operator_name": "John Smith" }}Testing Outbound Integrations
Section titled “Testing Outbound Integrations”Webhook Testing
Section titled “Webhook Testing”- Use a service like
webhook.siteto receive test payloads. - Trigger an event in Eryxon (e.g., start timing an operation).
- Verify the payload and the
X-Eryxon-Signatureheader.
MQTT Testing
Section titled “MQTT Testing”- Use
mosquitto_subto listen for messages:mosquitto_sub -h broker.hivemq.com -t "test/#" -v - Configure a publisher in Eryxon pointed to the test broker.
- Complete an operation and verify the message arrival.