Introduction

  • This document  describes the bring-up of RdkFwUpgradeManager in RPI RDK Broadband devices for firmware upgrade by using HTTP protocol.
  • Downloaded firmware from local/public http server with support of http protocol.

Build procedure to generate R-Pi image with Firmware upgrade

Please refer the below link for host environment set-up & flashing procedure for yocto build ,

Dunfell :

RPI 3B/3B+ Model Reference Platform

Repo Steps

To  build, follow below instructions


    Dunfell Build
    $ mkdir <workspace dir>
    $ cd <workspace dir> 
    $ repo init -u https://code.rdkcentral.com/r/manifests -b dunfell -m rdkb-extsrc.xml 
    $ repo sync -j`nproc` --no-clone-bundle



    Image Generation Steps


    Build steps
    $ MACHINE=raspberrypi-rdk-broadband source meta-cmf-raspberrypi/setup-environment
    $ bitbake rdk-generic-broadband-image

    Overall Architecture

    Following diagram depicts the flow of control among the components,

    FwUpgradeManager

    TR-181 Data Model Parameters 


    S.NODMValueDescription
    1Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURLhttp://192.168.0.8 Value should be local/public http server url
    2Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocolhttpValue should be auto-generated based on above parameter Input
    3Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownloadrdkb-generic-broadband-image_rdk-next_20210525055548.rootfs.wicValue should be Firmware Image Name .

    Note: This API does not reboot the device.

    4Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatusCompletedReturns the current state of the Firmware Download operation.
    5Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNowTrue 

    Downloads and upgrades the firmware. The firmware is updated in the passive bank and marks it as active.

    Reboots the device and the device boots up with the active bank and updated firmware.


    Pre-requisites - I

    Flashing the image


    sd-card size requisite

    It is must to have minimal size of 8GB SD-Card for Firmware upgrade support

    Command to flash the image

    Generated image has to be flashed to an SD card using this command in local PC:

    bzip2 -d <path to ImageName.wic.bz2>
    $ sudo -E bmaptool copy --nobmap <path to ImageName.wic> <path to SD card space>

    Ex:

    $ bzip2 -d rdk-generic-broadband-image-raspberrypi-rdk-broadband.wic.bz2
    $ sudo -E bmaptool copy --nobmap rdk-generic-broadband-image-raspberrypi-rdk-broadband.wic /dev/sdb

    The SD card is inserted to the Raspberry Pi board and booted to check for containers created.

    The Raspberry Pi board is connected to the PC via a USB to serial converter and the logs can be checked in console or can be connected via HDMI cable to a TV and logs will be shown in the terminal

    Increasing the rootfs partition size in SD-CARD if Flashed for first time

    It is necessary to have partizion size matching to  RDKB image size ( especially rootfs ). 

    To make compatible, size of RDKB rootfs partition should be increased to 5 GB ( 5098 MB) from 300MB default

    This resize can be achieved using gparted ui tool which should be available in host pc

    Here , example we given as 2GB.

    gparted tool Install and usage


    Please resize the rootfs partition to 2098 MB or 2GB (/dev/sdb1) accordingly from below procedure as captured in various stages

    1. Select gparted tool from menu


    2. Select the rootfs partition of format ext3 for resize/move option



    3. Resize the rootfs partition by giving new size image to 2098 MiB


    4. After resize , position stands as below



    5.After modifying size, "Apply all operations" using tick symbol in UI which displays icon as below




    6. After giving "Apply icon" position stands as below



    7. After resizing is completed 

    8. After applying close size increased to 2 GB can be seen

    Local Apache2 server set up

    Server Set-up 

    1.  Install the apache2 http server in local pc
    2.  place the rpi image in document root directory.

    HTTP Location folder

    Verify that rpi image file  is present in the http folder. Here , document root directory as "/var/www/html"

    Local Http server Document root path
    keerthana@keerthana-INVALID:/var/www/html$ pwd
    /var/www/html
    keerthana@keerthana-INVALID:/var/www/html$ ls -lh rdkb-generic-broadband-image_rdk-next_20210813104338.rootfs.wic
    -rw-r--r-- 1 root root 316M Aug 13 17:29 rdkb-generic-broadband-image_rdk-next_20210813104338.rootfs.wic
    keerthana@keerthana-INVALID:/var/www/html$ 
    
    

    Pre-requisites - II

           Please check the below commands to verify the Fwupgrade Manager is running or not in rpi device,

    systemd service
    root@RaspberryPi-Gateway:~# systemctl status RdkFwUpgradeManager
    ● RdkFwUpgradeManager.service - Firmware Upgrade Manager service
         Loaded: loaded (/lib/systemd/system/RdkFwUpgradeManager.service; enabled; vendor preset: enabled)
         Active: active (running) since Fri 2021-08-13 13:20:04 UTC; 6 days ago
        Process: 696 ExecStart=/usr/bin/fwupgrademanager -subsys $Subsys (code=exited, status=0/SUCCESS)
       Main PID: 701 (fwupgrademanage)
          Tasks: 4 (limit: 830)
         CGroup: /system.slice/RdkFwUpgradeManager.service
                 └─701 /usr/bin/fwupgrademanager -subsys eRT.
    
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
    
    
    Before Execution Steps
    root@RaspberryPi-Gateway:~# dmcli eRT getv Device.DeviceInfo.                                     
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.
    Execution succeed.
    Parameter    1 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus
                   type:     string,    value: Not Started 
    Parameter    2 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol
                   type:     string,    value:  
    Parameter    3 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL
                   type:     string,    value:  
    Parameter    4 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload
                   type:     string,    value:  
    Parameter    5 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow
                   type:       bool,    value: false 
    Parameter    6 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadAndFactoryReset
                   type:        int,    value: 0 
    Parameter    7 name: Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.RPC.DeferFWDownloadReboot
                   type:       uint,    value: 290 
    
    

    FwUpgrade Manager Log file ,

    Log file
    root@RaspberryPi-Gateway:~# cat /rdklogs/logs/FwUpgradeManagerLog.txt.0 
    210805-16:04:07.534093 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] 
    After daemonize before signal
    210805-16:04:07.535782 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] Connect to bus daemon...
    210805-16:04:07.536150 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DBus is enabled
    210805-16:04:07.549648 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] INFO: bus_handle: 0x 169ce08 
    210805-16:04:08.556185 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.
    210805-16:04:08.556397 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco.
    210805-16:04:08.556525 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco.spvtg.
    210805-16:04:08.556656 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco.spvtg.ccsp.
    210805-16:04:08.558086 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DM Library module name = CCSP Base Data Model
    210805-16:04:08.558481 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872]  Download_Control_Flag is 1 
    210805-16:04:08.558714 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872]  Current FW Version is rdkb-generic-broadband-image_rdk-next_20210813103706 
    210805-16:04:08.558846 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] syscfg_get failed
    210805-16:04:08.566939 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DM Library module name = TR181_RdkFirmwareUpgradeManager
    210805-16:04:08.568084 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Search for empty object in 'dslhCpeCheckEmptyObject'
    root@RaspberryPi-Gateway:~# 
    
    

    Execution Steps

                       Please run the below commands for FwUpgrade Manager,

    Using dmcli commands

                     Below steps are used to validate the FwUpgrade by using dmcli commands,

    dmcli commands
    root@RaspberryPi-Gateway:~# dmcli eRT setv Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL string "http://192.168.0.7"
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    setv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL
    Execution succeed.
    
    root@RaspberryPi-Gateway:~# dmcli eRT setv Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload string "rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic"
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    setv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload
    Execution succeed.
    
    root@RaspberryPi-Gateway:~# dmcli eRT setv Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow bool true
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    setv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow
    Execution succeed.
    
    root@RaspberryPi-Gateway:~# 
    
    
    Get Commands
    root@RaspberryPi-Gateway:/# dmcli eRT getv Device.DeviceInfo.
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.
    Execution succeed.
    Parameter    1 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus
                   type:     string,    value: Completed
    Parameter    2 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol
                   type:     string,    value: HTTP 
    Parameter    3 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL
                   type:     string,    value: http://192.168.0.7 
    Parameter    4 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload
                   type:     string,    value: rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic 
    Parameter    5 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow
                   type:       bool,    value: false 
    Parameter    6 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadAndFactoryReset
                   type:        int,    value: 0 
    Parameter    7 name: Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.RPC.DeferFWDownloadReboot
                   type:       uint,    value: 290 
    
    

    The New Firmware Image is downloaded at /firmware/imagedwld and Use 'ls -lh' command to check the image size.

    NewFw_Imagedwld_path
    root@RaspberryPi-Gateway:/firmware/imagedwld# pwd
    /firmware/imagedwld
    root@RaspberryPi-Gateway:/firmware/imagedwld# ls -lh rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic 
    -rw-r--r--    1 root     root      316.0M Aug 20 09:40 rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic
    root@RaspberryPi-Gateway:/firmware/imagedwld# 
    
    

    Use 'fdisk  -l'  & mount command to check the available partitions.


    fdisk
    Device         Boot    Start      End Sectors  Size Id Type
    /dev/mmcblk0p1 *        8192   112525  104334   51M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2        114688  9822207 9707520  4.6G 83 Linux
    /dev/mmcblk0p3       9822208 14016512 4194305    2G 83 Linux
    /dev/mmcblk0p4      14016513 18210817 4194305    2G 83 Linux
    
    root@RaspberryPi-Gateway:/ df -h | grep extblock
    /dev/mmcblk0p4            1.9G    246.9M      1.5G  13% /extblock
    /dev/mmcblk0p1           50.8M     29.2M     21.6M  58% /extblock/bank0_linux
    /dev/mmcblk0p2            4.5G     95.0M      4.2G   2% /extblock/bank0_rootfs
    
    root@RaspberryPi-Gateway: mount | grep extblock
    /dev/mmcblk0p4 on /extblock type ext4 (rw,relatime)
    /dev/mmcblk0p1 on /extblock/bank0_linux type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
    /dev/mmcblk0p2 on /extblock/bank0_rootfs type ext4 (rw,relatime)
     

    Using Webpa

                   Below steps are used to validate the fwupgrade by using webpa commands,

    prerequisite

                   Please use the below command to check the webpa & parodus process are running successfully or not.

    webpa
    root@RaspberryPi-Gateway:~# ps aux | grep webpa
     5827 root      0:01 /usr/bin/parodus --hw-model=RPI --hw-serial-number=00000000a31b564c --hw-manufacturer=Raspberry --hw-last-reboot-reason= --fw-name=rdkb-generic-broadband-image_rdk-next_20210813103706 --boot-time=1629896069 --hw-mac=B8:27:EB:1B:56:4C --webpa-ping-time=180 --webpa-interface-used=erouter0 --webpa-url=http://54.148.37.189:8080 --webpa-backoff-max=9 --parodus-local-url=tcp://127.0.0.1:6666 --partner-id=comcast --ssl-cert-path=/etc/ssl/certs/ca-certificates.crt --force-ipv4
     5884 root      0:02 /usr/bin/webpa &
    28195 root      0:00 webpa
    28608 root      0:00 grep webpa
    root@RaspberryPi-Gateway:~# 

    Curl Commands

    WebPA Set 

    curl - set
    root@RaspberryPi-Gateway:~# curl -X PATCH http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config -d '{"parameters": [ {"dataType": 0, "name": "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL", "value": "http://192.168.0.10"}]}' -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK'
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL","message":"Success"}],"statusCode":200}
    root@RaspberryPi-Gateway:~#
    
    root@RaspberryPi-Gateway:~# curl -X PATCH http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config -d '{"parameters": [ {"dataType": 0, "name": "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload", "value": "rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic"}]}' -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK'
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload","message":"Success"}],"statusCode":200}
    
    root@RaspberryPi-Gateway:~#   root@RaspberryPi-Gateway:~# curl -X PATCH http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config -d '{"parameters": [ {"dataType": 3, "name": "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow", "value": "true"}]}' -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK'
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow","message":"Success"}],"statusCode":200}
    
    root@RaspberryPi-Gateway:~# 
     

    WebPA Get

    curl - Get
    root@RaspberryPi-Gateway:~# curl -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK' -i http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config?names=Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    X-Scytale-Build: 0.1.4-1
    X-Scytale-Flavor: mint
    X-Scytale-Region: east
    X-Scytale-Server: 54.148.37.189
    X-Scytale-Start-Time: 23 Jul 19 11:55 UTC
    X-Talaria-Build: 0.1.3-1
    X-Talaria-Flavor: mint
    X-Talaria-Region: east
    X-Talaria-Server: 54.148.37.189
    X-Talaria-Start-Time: 22 Jul 19 09:34 UTC
    X-Tr1d1um-Build: 0.1.2-1
    X-Tr1d1um-Flavor: mint
    X-Tr1d1um-Region: east
    X-Tr1d1um-Server: 54.148.37.189
    X-Tr1d1um-Start-Time: 22 Jul 19 07:07 UTC
    X-Webpa-Transaction-Id: fC0LI-meLU0OIKStT94L_w
    X-Xmidt-Span: "http://localhost:8080/api/v2/device/send","2021-08-25T14:03:21Z","252.811878ms"
    Date: Wed, 25 Aug 2021 14:03:22 GMT
    Content-Length: 181
    
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL","value":"http://192.168.0.10","dataType":0,"parameterCount":1,"message":"Success"}],"statusCode":200}
    
    root@RaspberryPi-Gateway:~# curl -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK' -i http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config?names=Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload   
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    X-Scytale-Build: 0.1.4-1
    X-Scytale-Flavor: mint
    X-Scytale-Region: east
    X-Scytale-Server: 54.148.37.189
    X-Scytale-Start-Time: 23 Jul 19 11:55 UTC
    X-Talaria-Build: 0.1.3-1
    X-Talaria-Flavor: mint
    X-Talaria-Region: east
    X-Talaria-Server: 54.148.37.189
    X-Talaria-Start-Time: 22 Jul 19 09:34 UTC
    X-Tr1d1um-Build: 0.1.2-1
    X-Tr1d1um-Flavor: mint
    X-Tr1d1um-Region: east
    X-Tr1d1um-Server: 54.148.37.189
    X-Tr1d1um-Start-Time: 22 Jul 19 07:07 UTC
    X-Webpa-Transaction-Id: jpdlC7t-S8vMwLjENt1niA
    X-Xmidt-Span: "http://localhost:8080/api/v2/device/send","2021-08-25T14:06:59Z","254.980233ms"
    Date: Wed, 25 Aug 2021 14:06:59 GMT
    Content-Length: 224
    
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload","value":"rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic","dataType":0,"parameterCount":1,"message":"Success"}],"statusCode":200}
    
    root@RaspberryPi-Gateway:~# curl -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK' -i http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config?names=Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    X-Scytale-Build: 0.1.4-1
    X-Scytale-Flavor: mint
    X-Scytale-Region: east
    X-Scytale-Server: 54.148.37.189
    X-Scytale-Start-Time: 23 Jul 19 11:55 UTC
    X-Talaria-Build: 0.1.3-1
    X-Talaria-Flavor: mint
    X-Talaria-Region: east
    X-Talaria-Server: 54.148.37.189
    X-Talaria-Start-Time: 22 Jul 19 09:34 UTC
    X-Tr1d1um-Build: 0.1.2-1
    X-Tr1d1um-Flavor: mint
    X-Tr1d1um-Region: east
    X-Tr1d1um-Server: 54.148.37.189
    X-Tr1d1um-Start-Time: 22 Jul 19 07:07 UTC
    X-Webpa-Transaction-Id: MS7xPwO8ZsClcJpUSkqxjQ
    X-Xmidt-Span: "http://localhost:8080/api/v2/device/send","2021-08-25T14:10:13Z","253.576482ms"
    Date: Wed, 25 Aug 2021 14:10:13 GMT
    Content-Length: 171
    
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol","value":"HTTP","dataType":0,"parameterCount":1,"message":"Success"}],"statusCode":200}   root@RaspberryPi-Gateway:~# curl -H 'Authorization:Basic d3B1c2VyOndlYnBhQDEyMzQ1Njc4OTAK' -i http://54.148.37.189:9003/api/v2/device/mac:B8:27:EB:1B:56:4C/config?names=Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    X-Scytale-Build: 0.1.4-1
    X-Scytale-Flavor: mint
    X-Scytale-Region: east
    X-Scytale-Server: 54.148.37.189
    X-Scytale-Start-Time: 23 Jul 19 11:55 UTC
    X-Talaria-Build: 0.1.3-1
    X-Talaria-Flavor: mint
    X-Talaria-Region: east
    X-Talaria-Server: 54.148.37.189
    X-Talaria-Start-Time: 22 Jul 19 09:34 UTC
    X-Tr1d1um-Build: 0.1.2-1
    X-Tr1d1um-Flavor: mint
    X-Tr1d1um-Region: east
    X-Tr1d1um-Server: 54.148.37.189
    X-Tr1d1um-Start-Time: 22 Jul 19 07:07 UTC
    X-Webpa-Transaction-Id: PzFVh-jdOQoM4BkeJxz32Q
    X-Xmidt-Span: "http://localhost:8080/api/v2/device/send","2021-08-25T14:32:35Z","332.992262ms"
    Date: Wed, 25 Aug 2021 14:32:36 GMT
    Content-Length: 174
    
    {"parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus","value":"Completed","dataType":0,"parameterCount":1,"message":"Success"}],"statusCode":200}
    
    
    



    RPi - Board

    1. Flash the RDKB image supported for Firmware upgrade feature in the Rpi and verify the 2 partitions(ex. mmcblk0p1, mmcblk0p2) present under dev folder (use command ls /dev)
    2. Device auto-reboots and verify there are 2 more additional partitions are created (ex. mmcblk0p3, mmcblk0p4).
    3. Verify the image version ( cat /version.txt) displays the flashed image version
    4. Verify FwUpgradeManagerLog.txt file is generated in /rdklogs/logs directory.
    5. Verify the http download is happening by noticing the change of file size using below command : cd /firmware/imagedwld ls -lh(use this command frequently to verify the file size change)
    6. Once image download completed, the Rpi board will auto reboot and come up with downloaded image
    7.  Verify the version of booted image which shows the downloaded image version

    TroubleShooting


    1. check the status of RdkFwUpgradeManager service by using the below command,
      1.  systemctl status RdkFwUpgradeManager.service
    2. Check the RdkFwUpgradeManager logs in below path,
      1. cat /rdklogs/logs/FwUpgradeManagerLog.txt.0
    3. Successful logs

              

    Complete journalctl logs
    root@RaspberryPi-Gateway:~# journalctl -u RdkFwUpgradeManager
    -- Logs begin at Fri 2021-08-13 13:19:56 UTC, end at Fri 2021-08-20 10:40:45 UTC. --
    Aug 13 13:20:05 raspberrypi-rdk-broadband systemd[1]: Starting Firmware Upgrade Manager service...
    Aug 13 13:20:05 raspberrypi-rdk-broadband fwupgrademanager[732]: rdk_dyn_log_initg_dl_socket = 3 __progname = fwupgrademanager
    Aug 13 13:20:06 raspberrypi-rdk-broadband systemd[1]: Started Firmware Upgrade Manager service.
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_set_download_url
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_get_download_url
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[15453]: rm: can't remove '/tmp/xconf/dload_status': No such file or directory
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: fwupgrade_hal_set_download_url Stored HTTP download URL and filename to /tmp/httpDwnld.conf file
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_get_download_status
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_set_download_interface
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_download
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_get_download_url
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: fwupgrade_hal_get_download_url pfilename: rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: host->h_addrtype = 2, AF_INET
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: Host IP address: 192.168.0.7
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[14171]: download_image_from_server: Curl Command: curl -fgLo /firmware/imagedwld/rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic 'http://192.168.0.7/rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic';
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[15458]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    Aug 20 10:38:30 RaspberryPi-Gateway fwupgrademanager[15458]:                                  Dload  Upload   Total   Spent    Left  Speed
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[15458]: [2.4K blob data]
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[14171]: ### Debug ### Image download successful at /firmware/imagedwld/rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16197]: Checking available partition for bank switch and image upgrade...
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16197]: Creating additional partitions for Bank1 and storage area, box will go for reboot...
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16197]: Creating Bank1 rootfs partition mmc0blkp3...
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Welcome to fdisk (util-linux 2.35.1).
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Changes will remain in memory only, until you decide to write them.
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Be careful before using the write command.
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Command (m for help):
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Command (m for help): Partition type
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]:    p   primary (2 primary, 0 extended, 2 free)
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]:    e   extended (container for logical partitions)
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Select (default p): Partition number (3,4, default 3): First sector (2048-62333951, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (9822208-62333951, default 62333951):
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Created a new partition 3 of type 'Linux' and of size 2 GiB.
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Partition #3 contains a ext4 signature.
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Command (m for help):
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Disk /dev/mmcblk0: 29.74 GiB, 31914983424 bytes, 62333952 sectors
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Units: sectors of 1 * 512 = 512 bytes
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Sector size (logical/physical): 512 bytes / 512 bytes
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: I/O size (minimum/optimal): 512 bytes / 512 bytes
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Disklabel type: dos
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Disk identifier: 0x6da9139c
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Device         Boot   Start      End Sectors  Size Id Type
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: /dev/mmcblk0p1 *       8192   112525  104334   51M  c W95 FAT32 (LBA)
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: /dev/mmcblk0p2       114688  9822207 9707520  4.6G 83 Linux
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: /dev/mmcblk0p3      9822208 14016512 4194305    2G 83 Linux
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Command (m for help): The partition table has been altered.
    Aug 20 10:39:03 RaspberryPi-Gateway fwupgrademanager[16219]: Failed to add partition 3 to system: Device or resource busy
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16219]: The kernel still uses the old partitions. The new table will be used at the next reboot.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16219]: Syncing disks.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: Creating Storage partition mmc0blkp4...
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Welcome to fdisk (util-linux 2.35.1).
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Changes will remain in memory only, until you decide to write them.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Be careful before using the write command.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Command (m for help):
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Command (m for help): Partition type
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]:    p   primary (3 primary, 0 extended, 1 free)
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]:    e   extended (container for logical partitions)
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Select (default e):
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Selected partition 4
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: First sector (2048-62333951, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (14016513-62333951, default 62333951):
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Created a new partition 4 of type 'Linux' and of size 2 GiB.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Partition #4 contains a ext4 signature.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Command (m for help):
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Disk /dev/mmcblk0: 29.74 GiB, 31914983424 bytes, 62333952 sectors
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Units: sectors of 1 * 512 = 512 bytes
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Sector size (logical/physical): 512 bytes / 512 bytes
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: I/O size (minimum/optimal): 512 bytes / 512 bytes
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Disklabel type: dos
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Disk identifier: 0x6da9139c
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Device         Boot    Start      End Sectors  Size Id Type
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: /dev/mmcblk0p1 *        8192   112525  104334   51M  c W95 FAT32 (LBA)
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: /dev/mmcblk0p2        114688  9822207 9707520  4.6G 83 Linux
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: /dev/mmcblk0p3       9822208 14016512 4194305    2G 83 Linux
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: /dev/mmcblk0p4      14016513 18210817 4194305    2G 83 Linux
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Command (m for help): The partition table has been altered.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16299]: Syncing disks.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: file system type check count partition p3 is 1
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: File system available for partition mmcblk0p3
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: file system type check count partition p4 is 1
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: File system available for partition mmcblk0p4
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16324]: mount: /extblock: /dev/mmcblk0p4 already mounted on /extblock.
    Aug 20 10:39:06 RaspberryPi-Gateway fwupgrademanager[16197]: Downloaded image to be upgrade is rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic
    Aug 20 10:39:34 RaspberryPi-Gateway fwupgrademanager[16197]: Active bank partition is /dev/mmcblk0p3
    Aug 20 10:39:34 RaspberryPi-Gateway fwupgrademanager[16197]: Modifying Bank 0 partition mmcblk0p2 Content with downloaded image ...
    Aug 20 10:40:21 RaspberryPi-Gateway fwupgrademanager[16197]: Firmware upgrade successful
    Aug 20 10:40:21 RaspberryPi-Gateway fwupgrademanager[16197]: Rebooting with bank switch ....
    Aug 20 10:40:41 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_get_download_status
    Aug 20 10:40:41 RaspberryPi-Gateway fwupgrademanager[14171]: Entering fwupgrade_hal_reboot_ready
    Aug 20 10:40:41 RaspberryPi-Gateway fwupgrademanager[19110]: CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[19110]: subsystem_prefix eRT.
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[19110]: setv from/to component(eRT.com.cisco.spvtg.ccsp.pam): Device.DeviceInfo.X_RDKCENTRAL-COM_LastRebootReason
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[19110]: Execution succeed.
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[19110]: 
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[14171]: 
    Aug 20 10:40:42 RaspberryPi-Gateway fwupgrademanager[14171]: ntering fwupgrade_hal_download_reb### reboot now ###
    
    
    Complete Fwlogs
    root@RaspberryPi-Gateway:~# cat /rdklogs/logs/FwUpgradeManagerLog.txt.0 
    210805-16:04:07.534093 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] After daemonize before signal
    210805-16:04:07.535782 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] Connect to bus daemon... 
    210805-16:04:07.536150 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DBus is enabled 
    210805-16:04:07.549648 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] INFO: bus_handle: 0x 169ce08 
    210805-16:04:08.556185 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com. 
    210805-16:04:08.556397 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco. 
    210805-16:04:08.556525 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco.spvtg. 
    210805-16:04:08.556656 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Register empty object : com.cisco.spvtg.ccsp. 
    210805-16:04:08.558086 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DM Library module name = CCSP Base Data Model 
    210805-16:04:08.558481 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] Download_Control_Flag is 1 
    210805-16:04:08.558714 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=872] Current FW Version is rdkb-generic-broadband-image_rdk-next_20210813103706 
    210805-16:04:08.558846 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] syscfg_get failed 
    210805-16:04:08.566939 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] DM Library module name = TR181_RdkFirmwareUpgradeManager 
    210805-16:04:08.568084 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=872] Search for empty object in 'dslhCpeCheckEmptyObject'
    210820-10:11:02.271274 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=11399] DslhObjcoValidate: X_RDKCENTRAL-COM_FirmwareDownloadURL, bsUpdate = 3
    
    210820-10:11:05.001028 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=11399]  URL is http://192.168.0.7 
    210820-10:11:41.004477 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=11399] DslhObjcoValidate: X_RDKCENTRAL-COM_FirmwareToDownload, bsUpdate = 3
    
    210820-10:11:41.004713 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=11399]  FW DL is rdkb-generic-broadband-image_rdk-next_20210818080531.rootfs.wic 
    210820-10:12:14.157871 [mod=FWUPGRADEMANAGER, lvl=WARN] [tid=11399] DslhObjcoValidate: X_RDKCENTRAL-COM_FirmwareDownloadNow, bsUpdate = 3
    
    210820-10:12:14.158361 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=11399]  Converted image name = rdkb-generic-broadband-image_rdk-next_20210818080531 
    210820-10:12:14.171075 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=11399]  Image downloading triggered successfully
    210820-10:14:06.797110 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792]  Sleeping to prevent 500 error 
    210820-10:14:16.797612 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792] /tmp/wget.log doesn't exist. Sleeping an additional 10 seconds 
    210820-10:14:26.797962 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792]  Waiting for FW DL ... 
    210820-10:14:26.798406 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792]  FW DL is over 
    210820-10:14:26.798506 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792]  Waiting for reboot ready ... 
    210820-10:14:26.798670 [mod=FWUPGRADEMANAGER, lvl=INFO] [tid=14792]  Waiting for reboot ready over, setting last reboot reason 
    version txt
    root@RaspberryPi-Gateway:~# cat /version.txt 
    imagename:rdkb-generic-broadband-image_rdk-next_20210818080531
    BRANCH=rdk-next
    YOCTO_VERSION=dunfell
    VERSION=4.08.18.21
    SPIN=0
    BUILD_TIME="2021-08-18 08:05:31"
    Generated on Wed Aug 18  08:05:31 UTC 2021
    root@RaspberryPi-Gateway:~# 
    
    

    Limitation

                       Every Firmware Upgrade , it's boots with default values of all dmcli parameters & LastRebootReason value always return as "unknown" because rpi doesn't have the support of NVRAM.  


    • No labels