Author
|
Matrix TSL
|
Version
|
1.0
|
Category
|
Comms: IoT/Cloud
|
IoT Made Easy component
A component designed to simplify MQTT comms allowing for multiple data streams to be dealt with in a simple manner. Deals with translating values to and from the broker from topic strings into message IDs and numeric values. Works with lots of different MQTT brokers.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_IoTMadeEasy.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_IoTMadeEasy.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
|
ErrorAsString
|
|
- BYTE
|
Error
|
|
- STRING
|
Return
|
|
PublishString
|
Publishes data to the selected topic ID using a data string. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- STRING
|
Data
|
Data string to publish
|
- BYTE
|
Return
|
|
GetTopicID
|
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.
|
- BYTE
|
Return
|
|
Connect
|
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.
|
- BYTE
|
Return
|
|
GetPayloadInteger
|
Get the Payload of the last received (Read) packet as a signed long value
|
- LONG
|
Return
|
|
LastError
|
Returns the last error
|
- BYTE
|
Return
|
|
Read
|
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.
|
- UINT
|
Return
|
|
Disconnect
|
Disconnects from the MQTT server and the network
|
- BYTE
|
Return
|
|
PublishFloat
|
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- FLOAT
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
Ping
|
Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful
|
- BYTE
|
Return
|
|
PublishInteger
|
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- LONG
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
GetPayloadFloat
|
Get the Payload of the last received (Read) packet as a floating point value
|
- FLOAT
|
Return
|
|
GetPayloadString
|
Get the Payload of the last received (Read) packet as a string value
|
- STRING
|
Payload
|
|
- BYTE
|
Size
|
|
- BYTE
|
Return
|
|
Initialise
|
Starts up the MQTT component - call this after initialising the NetworkComms component.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
MQTT Properties
|
|
LinkTo
|
|
|
Host
|
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)
|
|
Port
|
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.
|
|
Client identifier
|
Client identifier (Maximum length 20 characters) Must be unique to the broker.
|
|
Network Timeout
|
Maximum time in mS to wait for network responses
|
|
Read Timeout
|
Time to wait in ms when waiting for incoming messages
|
|
Keep Alive
|
The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.
|
|
Authentication
|
Selects if the broker is open or if the broker requires a username and password.
|
|
Topics
|
|
Number of topics
|
Sets the number of data topics that can be sent or received
|
|
Topic ID: 0
|
|
Topic String
|
|
|
Topic Type
|
|
|
Topic ID: 1
|
|
Topic String
|
|
|
Topic Type
|
|
==Macro reference==
|
ErrorAsString
|
|
- BYTE
|
Error
|
|
- STRING
|
Return
|
|
PublishString
|
Publishes data to the selected topic ID using a data string. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- STRING
|
Data
|
Data string to publish
|
- BYTE
|
Return
|
|
GetTopicID
|
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.
|
- BYTE
|
Return
|
|
Connect
|
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.
|
- BYTE
|
Return
|
|
GetPayloadInteger
|
Get the Payload of the last received (Read) packet as a signed long value
|
- LONG
|
Return
|
|
LastError
|
Returns the last error
|
- BYTE
|
Return
|
|
Read
|
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.
|
- UINT
|
Return
|
|
Disconnect
|
Disconnects from the MQTT server and the network
|
- BYTE
|
Return
|
|
PublishFloat
|
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- FLOAT
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
Ping
|
Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful
|
- BYTE
|
Return
|
|
PublishInteger
|
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- LONG
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
GetPayloadFloat
|
Get the Payload of the last received (Read) packet as a floating point value
|
- FLOAT
|
Return
|
|
GetPayloadString
|
Get the Payload of the last received (Read) packet as a string value
|
- STRING
|
Payload
|
|
- BYTE
|
Size
|
|
- BYTE
|
Return
|
|
Initialise
|
Starts up the MQTT component - call this after initialising the NetworkComms component.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
MQTT Properties
|
|
LinkTo
|
|
|
Host
|
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)
|
|
Port
|
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.
|
|
Client identifier
|
Client identifier (Maximum length 20 characters) Must be unique to the broker.
|
|
Network Timeout
|
Maximum time in mS to wait for network responses
|
|
Read Timeout
|
Time to wait in ms when waiting for incoming messages
|
|
Keep Alive
|
The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.
|
|
Authentication
|
Selects if the broker is open or if the broker requires a username and password.
|
|
Topics
|
|
Number of topics
|
Sets the number of data topics that can be sent or received
|
|
Topic ID: 0
|
|
Topic String
|
|
|
Topic Type
|
|
|
Topic ID: 1
|
|
Topic String
|
|
|
Topic Type
|
|
==Macro reference==
|
ErrorAsString
|
|
- BYTE
|
Error
|
|
- STRING
|
Return
|
|
PublishString
|
Publishes data to the selected topic ID using a data string. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- STRING
|
Data
|
Data string to publish
|
- BYTE
|
Return
|
|
GetTopicID
|
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.
|
- BYTE
|
Return
|
|
Connect
|
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.
|
- BYTE
|
Return
|
|
GetPayloadInteger
|
Get the Payload of the last received (Read) packet as a signed long value
|
- LONG
|
Return
|
|
LastError
|
Returns the last error
|
- BYTE
|
Return
|
|
Read
|
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.
|
- UINT
|
Return
|
|
Disconnect
|
Disconnects from the MQTT server and the network
|
- BYTE
|
Return
|
|
PublishFloat
|
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- FLOAT
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
Ping
|
Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful
|
- BYTE
|
Return
|
|
PublishInteger
|
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- LONG
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
GetPayloadFloat
|
Get the Payload of the last received (Read) packet as a floating point value
|
- FLOAT
|
Return
|
|
GetPayloadString
|
Get the Payload of the last received (Read) packet as a string value
|
- STRING
|
Payload
|
|
- BYTE
|
Size
|
|
- BYTE
|
Return
|
|
Initialise
|
Starts up the MQTT component - call this after initialising the NetworkComms component.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
MQTT Properties
|
|
LinkTo
|
|
|
Host
|
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)
|
|
Port
|
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.
|
|
Client identifier
|
Client identifier (Maximum length 20 characters) Must be unique to the broker.
|
|
Network Timeout
|
Maximum time in mS to wait for network responses
|
|
Read Timeout
|
Time to wait in ms when waiting for incoming messages
|
|
Keep Alive
|
The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.
|
|
Authentication
|
Selects if the broker is open or if the broker requires a username and password.
|
|
Topics
|
|
Number of topics
|
Sets the number of data topics that can be sent or received
|
|
Topic ID: 0
|
|
Topic String
|
|
|
Topic Type
|
|
|
Topic ID: 1
|
|
Topic String
|
|
|
Topic Type
|
|
==Macro reference==
|
ErrorAsString
|
|
- BYTE
|
Error
|
|
- STRING
|
Return
|
|
PublishString
|
Publishes data to the selected topic ID using a data string. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- STRING
|
Data
|
Data string to publish
|
- BYTE
|
Return
|
|
GetTopicID
|
Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.
|
- BYTE
|
Return
|
|
Connect
|
Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.
|
- BYTE
|
Return
|
|
GetPayloadInteger
|
Get the Payload of the last received (Read) packet as a signed long value
|
- LONG
|
Return
|
|
LastError
|
Returns the last error
|
- BYTE
|
Return
|
|
Read
|
Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.
|
- UINT
|
Return
|
|
Disconnect
|
Disconnects from the MQTT server and the network
|
- BYTE
|
Return
|
|
PublishFloat
|
Publishes data to the selected topic ID using a floating point value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- FLOAT
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
Ping
|
Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful
|
- BYTE
|
Return
|
|
PublishInteger
|
Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful
|
- BYTE
|
TopicID
|
The topic ID to publish data to
|
- LONG
|
Data
|
Data to publish
|
- BYTE
|
Return
|
|
GetPayloadFloat
|
Get the Payload of the last received (Read) packet as a floating point value
|
- FLOAT
|
Return
|
|
GetPayloadString
|
Get the Payload of the last received (Read) packet as a string value
|
- STRING
|
Payload
|
|
- BYTE
|
Size
|
|
- BYTE
|
Return
|
|
Initialise
|
Starts up the MQTT component - call this after initialising the NetworkComms component.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
MQTT Properties
|
|
LinkTo
|
|
|
Host
|
Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)
|
|
Port
|
Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.
|
|
Client identifier
|
Client identifier (Maximum length 20 characters) Must be unique to the broker.
|
|
Network Timeout
|
Maximum time in mS to wait for network responses
|
|
Read Timeout
|
Time to wait in ms when waiting for incoming messages
|
|
Keep Alive
|
The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.
|
|
Authentication
|
Selects if the broker is open or if the broker requires a username and password.
|
|
Topics
|
|
Number of topics
|
Sets the number of data topics that can be sent or received
|
|
Topic ID: 0
|
|
Topic String
|
|
|
Topic Type
|
|
|
Topic ID: 1
|
|
Topic String
|
|
|
Topic Type
|
|