Skip to content

Firmware Update

You can update firmware by using MindSphere Firmware Update Mechanism. The following sections describe the general structure of firmware update mechanism.

MindSphere Firmware Update Mechanism

Download

Create a firmware product and a firmware release via Open Edge Cockpit and then publish it. "FW download job" should be created using Open Edge Device Manager UI plugin.

In order to get informed for the firmware update, subscribe to cloud/monitoring/update/firmware topic.

    cloud/monitoring/update/firmware
    {
    "jobid":"82c82992-89e2-410b-9311-0522b958be2e",
    "filepath":"/persistent_massdata/appData/82c82992-89e2-410b-9311-0522b958be2e_22a66c39-d3f2-4a3e-8886-e7a3b6da13a7.tar"
    }

The download path is determined as: ROOT_PATH + JOB_ID + "_" + JOB_ARTIFACTcloud/monitoring/update/firmwar

In oedk_config.json file, agentRoot can be specified as below:

    {
    "installation": {
    "autoStart": 1,
    "agentRoot": "/persistent_massdata/appData/"
    }

Get the job ID

Obtain the job ID and store it in order to send this to the software inventory after every reboot. Connect MQTT Broker with related hostname and port parameters.

    String broker = String.format("tcp://%s:%d", mqttHost, mqttPort);
    MqttClient mqttClient = new MqttClient(broker, "MQTTClientID");
    boolean isConnected = manager.connect();

Subscribe to firmware update topic to get new available firmware path.

    String topic = "cloud/monitoring/update/firmware";
    mqttClient.subscribe(topic, newAvailableFirmwarePath);

The agent publish message is as below:

    {
      Jobid: "",
      filepath: ""
    }

In messageArrived function, you can perform the tasks related to firmware update.

    public void messageArrived(String topic, MqttMessage message) {
    LOG.info("MQTT message arrived: {} --> {}", topic, message.toString());
}

Update the firmware

Update the firmware and publish the firmware update result as below:

    boxmanager/monitoring/opresult/firmwareupdate
    {
    "jobid": "82c82992-89e2-410b-9311-0522b958be2e",
    "value": "1",
    "status": "ACTIVATED"
    }

The the value is 1, then the update is successful, and if the value is 2, then it is failed.

Software Inventory Update

Publish the following topic in every reboot in order to inform MindSphere about the firmware version.

    boxmanager/monitoring/softwareinformation/version
    {
        "installedAt": "2019-12-05T10:43:39.264Z",
        "type": "Firmware",
        "softwareId": "string",
        "version": "string",
        "description": "string"
    }

Any questions left?

Ask the community


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


Last update: July 29, 2022