Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  •  Install Apache2 package
    •      sudo apt update
    •     sudo apt install apache2
  •    Check the firewall application profiles
    •     sudo ufw app list
  •    Modify firewall rules to allow Apache2
    •       sudo ufw allow 'Apache'   
  • Verify the status
    • sudo ufw status
  • Verify Apache2 service is running using systemd command
    • sudo systemctl status apache2
  • Server can be connected using http request, http://<ip of device> (ex: http://192.168.2.8)

  • Configuration files for Apache2 can be found in /etc/apache2/.
  • We should place tar file to document root folder for accessing it. Check document root folder mentioned in conf file. This can be found in path /etc/apache2/sites-available/. 


    Ex: vim /etc/apache2/sites-available/000-default.conf

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>



Enabling the FirmwareControl Plugin:

...

  • Flash the image supported with FirmwareControl plugin feature in the RPI board and verify the 2 partitions(ex. mmcblk0p1, mmcblk0p2) present under dev folder (use command fdisk -l)
  • By default image tar file will be downloaded to /var/lib/ and the timeout value for downloading the image tar file is 600000. This can be changed in /etc/WPEFramework/plugins/FirmwareControl.json file. If value is modified, we have to restart wepframework, else changes will not be reflected.
  • cat /etc/WPEFramework/plugins/FirmwareControl.json
    {
    "locator":"libWPEFrameworkFirmwareControl.so",
    "classname":"FirmwareControl",
    "autostart":false,
    "configuration":{
    "download":"/var/lib",
    "waittime":600000
    }
    }root@raspberrypi-rdk-hybrid-thunder:~#
  • Execute curl request for firmware update

    • Eg: curl --data-binary '{"jsonrpc": "2.0", "id": 1234567890, "method": "FirmwareControl.1.upgrade","params": { "name": "mediaclient.tar.gz", "location": "http://192.168.2.118/", "type": "CDL", "progressinterval": 10, "hmac": "21dd673fad68fbfd418e7bd9f0f16cb359c5743b4724c9af7347278e3183f2e4" } }' -H 'content-type:text/plain;' http://192.168.2.103/jsonrpc).
  •  In the curl request , hmac is the sha256sum of the image tar file. This is generated using sha256sum command.
Eg: sha256sum mediaclient.tar.gz
21dd673fad68fbfd418e7bd9f0f16cb359c5743b4724c9af7347278e3183f2e4 mediaclient.tar.gz
  •   During first time execution, firmware update request creates one two more partition partitions in memory(mmcblk0p3, mmcblk0p4) and auto reboots to update partition table. This happens only on the first request, further requests will not result in board reboot before firmware update.
  • Once device boots up verify there are 3 4 partitions in /dev (ex. mmcblk0p1, mmcblk0p2, mmcblk0p3, mmcblk0p4) (use command fdisk -l to verify) .
  • Enable FirmwareControl plugin in Metrological UI
  • Execute curl request for firmware update for second time.
  • Image tar file will be downloaded to a file in /tmp folder (ex. ImageTemp)var/lib folder as ImageTemp. Verify image is downloaded to /tmpvar/lib
  • Reboot RPI board once firmware update process is completed manually using reboot -f command.
  • Once board boots up verify the current image version ( cat /version.txt)
  •  Verify the version of booted image which shows the downloaded image version

...