MQTT Configuration
Configuring MQTT/CAN Briding
With the MQTT/CAN Bridging module CAN messages in JSON format can be published and received via MQTT.
1.
Enable the MQTT configuration (see
2.
In the configuration tree select MQTT/CAN Bridging.
3.
To subscribe to a CAN message, enter the MQTT topic of the message in the table MQTT Subscribe.
• If an MQTT message of the defined format is published, it is received by the CAN@net NT.
4.
To publish a received CAN message via MQTT, enter the message and the MQTT topic in the table MQTT
Publish.
NOTE
For the topic it is possible to use system variables that are replaced with actual values when a
message is sent (see
Example 2. JSON Format of a CAN Message
{"port":1, "format":"csd","ident":256,"data":[17,34,51,68]}
port
CAN port number (NT 100: 1, NT 200: 1...2, NT 420: 1...4)
format
Message format according to CFT:
• C – Controller type (C – CAN, F — CAN FD)
• F – Frame Format (S – Standard, E – Extended)
• T – Frame Type (D – Data, R – RTR)Remote frames (RTR) are only supported by Classic CAN.
ident
Message identifier (decimal)
data
List of data bytes (0..64 values)
Defining MQTT Messages
As publisher the CAN@net NT can publish messages via MQTT that can be individually defined in Action Rules.
For each MQTT message the following has to be defined via Action Rules:
• event (trigger) to transmit an MQTT message
• message topic (string to filter and route the messages to the subscribers)
• message payload (ASCII string)
• Quality of Service (QoS)
NOTE
If the Master and the Slave device use the same broker, the topics of the messages of Master and
Slave must be different (add e.g. the serial number).
1.
Enable the MQTT configuration (see
2.
Define MQTT messages via Action Rules:
a.
Configure an IF event to set the trigger for the transmission of an MQTT message.
b.
As THEN action select the action type Send MQTT message and define the message.
3.
For information about the configuration possibilities see
4.02.0332.20001 Version 1.7
Enabling the MQTT Configuration, p.
System Variables for Topic and Payload, p.
Enabling the MQTT Configuration, p.
CAN-Gateway Configurator V6 for CAN@net NT and CANbridge NT
24).
26).
24).
Action Rules, p.
26.
Page 25 of 56
Need help?
Do you have a question about the Ixxat CAN-Gateway Configurator V6 and is the answer not in the manual?
Questions and answers