The socket_listener_adapter adapter provides the ability for the ClearBlade Platform or ClearBlade Edge to receive data over a tcp or udp socket.
The adapter subscribes to MQTT topics which are used to interact with the socket. The adapter publishes any data received from the socket to MQTT topics so that the ClearBlade Platform/Edge is able to process the data as needed.
The socket_listener_adapter adapter utilizes MQTT messaging to communicate with the ClearBlade Platform. The adapter will publish messages to MQTT topics in order to send socket data to the ClearBlade Platform/Edge. The topic structures utilized by the adapter are as follows:
The socket-listener-adapter adapter was constructed to provide the ability to communicate with a System defined in a ClearBlade Platform instance. Therefore, the adapter requires a System to have been created within a ClearBlade Platform instance.
Once a System has been created, artifacts must be defined within the ClearBlade Platform system to allow the adapters to function properly. At a minimum:
| Column Name | Column Datatype |
|---|---|
| adapter_name | string |
| topic_root | string |
| adapter_settings | string (json) |
where
The adapter_settings column will need to contain an array of JSON objects containing the following attributes:
[
{
"protocol": "tcp",
"listen_port": "64010",
"message_end_character": "\n"
},
{
"protocol": "tcp",
"listen_port": "64011",
"message_end_character": "\n"
},
{
"protocol": "udp",
"listen_port": "2018",
"message_end_character": "\n",
"transform_to_hex": true
}
]
docker run -d --name socket_listener_adapter --network cb-net --restart always socket_listener_adapter -systemKey=<SYSTEM_KEY> -systemSecret=<SYSTEM_SECRET> -platformURL=<PLATFORM_URL> -messagingURL=<MESSAGING_URL> -deviceName=<DEVICE_NAME> -password=<DEVICE_ACTIVE_KEY> -adapterConfigCollection=<COLLECTION_NAME> -logLevel=<LOG_LEVEL>
-systemKey The System Key of your System on the ClearBlade Platform
-systemSecret The System Secret of your System on the ClearBlade Platform
-platformURL The address of the ClearBlade Platform (ex. https://platform.clearblade.com:443)
-messagingURL The MQTT broker address (ex. tcp://platform.clearblade.com:1883)
-deviceName The name of a device account created on the ClearBlade Platform
-password The active key of a device created on the ClearBlade Platform
-logLevel The level of runtime logging the adapter should provide (fatal, error, warn, info, debug)
Content type
Image
Digest
Size
6.5 MB
Last updated
over 4 years ago
docker pull clearblade/socket_listener_adapter