Introduction

In RDK, User Initiated Firmware upgrade is handled by org.rdk.System Plugin through ‘updateFirmware’ method. System plugin will invoke ‘deviceInitiatedFWDnld.sh’  script to communicate with Xconf server and fetch firmware information. Image download will be initiated by ‘deviceInitiatedFWDnld.sh’. Once download is completed then a device specific script will be executed. The device specific script can have implementation specific to the platform and will invoke the Flash Utility after verifying integrity of the firmware.

Use case


Usecase description


How to prepare XConf Server

Xconf server provide information to STB like which Firmware version, From where to download the image and how(protocol) to download.

There are 3 significant steps involved in the Xconf firmware upgrade configuration:

1. Firmware Config – The firmware details will be configured here.

    Where : Go to Firmware - > Firmware Configs -> Create.

    How : Add your firmware details - File name ( Upgrading image name ), Version( Upgrading image name) and select your model name and save the details in Xconf server.

2. Firmware rule – Rule is to map your device to the configuration created.

    Where : Go to Firmware -> FirmwareRule - > Create.

     How : Select one of the default template like MAC_RULE.

Enter name of the rule, build condition (you can add estbMacAddress i.e. )

select the firmware config from the drop down list to map it with the rule

3. Download Location Filter – Here we can specify the download location URL and it’s protocol.

Where : Go to Firmware-> Download Location Filter -> Edit.

How : An Http location will be returned by default for all the devices. Enter FQDN and Full URL of the location.

The configuration will be available through below Xconf data service API: https://xconf.rdkcentral.com:9092/xconf/swu/stb/ 

Xconf Authorization Module Details

Create Environment


Create Model


Create Mac List


Create Firmware Config

Before configuring Firmware essentials, Ensure application type is stb.

Create Firmware Rules


Edit Download Location Round Robin Filter

Admin can set up an alternative download location for hosting the firmware image using any local file server . To add alternative location for the device, we need to override it from firmware rules.

For setting up Local File Server refer section "Setup a local File-Server" under Support Section. Below setup shows using hfs as file server:

Host the upgrade image in File-Server and copy the link address of the file url. Below snapshot was taken with another setup hence there is mismatch with the URI. Use the uri which is obtained from section "Setup a local File-Server", "link address of the image" (http://192.168.1.106:8001)

Add the firmwareDownloadProtocol and copied link address as the firmwareLocation in Xconf server.


Validation Steps

Verification via Xconf firmware Test page

After creating the Firmware configs and Firmware rules, go to Firmware->Test page and give a parameter that will match the one of the rules that you have created. Then matched rule will be displayed like below. 


     


Verification via curl command:

root@raspberrypi-rdk-ipmc:/opt# curl --location --request GET 'https://xconf.rdkcentral.com:19092/xconf/swu/stb?eStbMac=B8:27:EB:EE:8C:0B'
{"firmwareDownloadProtocol":"http","firmwareFilename":"rdk-generic-ip-stb-client_rdk-next_20230116141625.rootfs.wic","firmwareLocation":"http://192.168.1.12","firmwareVersion":"rdk-generic-ip-stb-client_rdk-next_20230116141625","rebootImmediately":false,"mandatoryUpdate":false}

How to upgrade the Firmware 

Once the server side configurations are done, made the changes in the client side.

The cloud URL should be set in the file /etc/include.properties

CLOUDURL=https://xconf.rdkcentral.com:9092/xconf/swu/stb?eStbMac= 


curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":"3","method":"Controller.1.activate","params": {"callsign":"org.rdk.System"}}'
curl -X POST http://127.0.0.1:9998/jsonrpc -d '{"jsonrpc":"2.0","id":"3","method":"org.rdk.System.1.updateFirmware","params":{}}'