Skip to content

Stopping the Open Edge Device Kit

Docker Version

The docker version of Open Edge Device Kit is stopped using the following command:

1
docker-compose down

Executable version

The executable version of Open Edge Device Kit is stopped using the following command:

1
agentruntime/controlling/command/stop

This topic should also be subscribed to by all data readers and trigger them to stop all operations. After the Open Edge Device Kit has stopped all of its operations, it publishes a success message via agentruntime/monitoring/opresult/stop.

Code Example

  1. Establish a connection to the MQTT broker where <mqtt_host> is the host name and <mqtt_port> is the port:

    1
    2
    3
    String broker = String.format("tcp://%s:%d", <mqtt_host>, <mqtt_port>);
    MqttClient mqttClient = new MqttClient(broker, "<mqtt_client_id>");
    mqttClient.connect();
    
  2. Publish the stop command to the Open Edge Device Kit:

    1
    2
    3
    4
    String message = "STOP COMMAND";
    String topic = "agentruntime/controlling/command/stop";
    
    mqttClient.publish(topic, message.getBytes(StandardCharsets.ISO_8859_1));
    
  3. Wait for 30 seconds or until the Open Edge Device Kit publishes the success message via agentruntime/monitoring/opresult/stop

    1
    2
    3
    4
    {
        "value": 0,
        "status": "Stopped"
    }
    
  4. After receiving the success message or if it has not arrived after 30 seconds, kill the Open Edge Device Kit process.

Restarting Open Edge Device Kit

After sending the stop command, the Open Edge Device Kit must be restarted as described in the Getting Started sections:

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.