Overview

To validate lightning refapp on rdk 4.0 (rdk-generic-hybrid-image-raspberrypi) along with video playback, need to do some necessary code customizations/modifications in lightning refapp side for video player implementation provided by lightning-sdk framework and rdk library side for variable setting and url configurations.

Please follow the below instructions to validate lightning refapp on rdk-generic-hybrid-image.

Prerequisites

Before you follow the steps below, make sure you have installed all the required prerequisites in your dev PC Node.js , npm, Lightning-CLI

$ npm install -g @lightningjs/cli


reference image for Lightning-CLI install

Build instructions

  • Create Lightning refapp dev build

    1. pull code from source repo using below command

      $ git clone https://github.com/naseemshekh20/refapp.git
    2. goto refapp directory

      $ cd refapp
    3. checkout to branch refapp-vid-playback-validation-on-rdk-4.0

      $ git checkout refapp-vid-playback-validation-on-rdk-4.0
    4. install the NPM dependencies by running below command

      $ npm install
    5. run copyAssets.sh command to create static folder and copy images, json files etc

      $./copyAssets.sh
    6.  run below command for testing in browser 

      $ lng dev

refer below screenshots for reference

reference images for build instructions-1

reference images for build instructions-2

once npm install complete, you will get message at the end "Do you want us to automatically check for old Lightning-SDK imports and update them in your project files? y/n

press n and hit enter button because on pressing y it gets hanged or stuck, in this case press ctrl+c 


reference images for build instructions-3

reference images for build instructions-4

Running refapp

by default vscode launch generated url on chrome browser in dev pc.

reference image for running app on browser

  • Pre-build refapp code

Download customized pre-build refapp code which has lightning sdk video player integrated: build.zip

(or)

  • Create dist (build)

    • run below command to make build.


$ lng dist


reference image for dist creation

Hosting Lighting refapp

  1. copy the lighting build app from dist folder.
  2. host build folder into any http server.
  3. test the hosted application on browser 

Lighting refapp integration 


  • Pre-build rdk-generic-hybrid-image-raspberrypi image

Download pre-build rdk-generic-hybrid-image-raspberrypi image from here: rdk-generic-hybrid-image-raspberrypi-rdk-hybrid.zip

(or)

  • Build rdk-generic-hybrid-image-raspberrypi follow below instructions


$ repo init -u https://code.rdkcentral.com/r/manifests -b yocto-dunfell-upgrade -m rdkv-nosrc.xml
$ repo sync -j4 --no-clone-bundle
$ MACHINE=raspberrypi-rdk-hybrid source meta-cmf-raspberrypi/setup-environment
$ bitbake rdk-generic-hybrid-image


  • Flash image on the SD card 

    • Execute the following command to flash the image on the SD card


# sudo dd if=<r-pi sdimg> of=<SD card device> bs=1M 
  
for ex: # sudo dd if=rdk-mc-rpi.sdimg of=/dev/sdb bs=1M

(or)

Windows user can download and install Balena Etcher to write the Raspberry Pi SD card: https://www.balena.io/etcher/


  • Lighting refapp integration into rdk-generic-hybrid-image-raspberrypi


    • Method 1:
  1. login into raspberrypi and change directory:


$ ssh root@<<IP address>>

# after login into box 
$ cd /lib/rdk/

 

2. add startup_app_conf variable into referenceApp.sh config file, if referenceApp.sh file is not available in /lib/rdk then refer method 2 below to validate refapp.


startup_app_conf=/opt/residentapp.conf 


        3. add below line to avoid loading default app  


url="http://192.168.0.106:8080/"
echo $url


       

4. replace exting url https://px-apps.sys.comcast.net/lightning_apps/SwitcherApp/dist/index.html in /opt/residentapp.conf with lighting app url which is hosted on server

       for example your server providing url http://192.168.56.1:8080


     

5. reboot the box 

     

  • Method 2:

Validated on rdk-generic-hybrid-wpe-image_rdk-next image, download image link: https://drive.google.com/file/d/1_VgFDk_lRWLoMwv0JKQrZ4HUifN-F6Qa/view?usp=sharing

step 1: login to box $ ssh root@<your box ip>

step 2: copy refapp build into /opt/www

step3: $ cd /lib/rdk

step 4: $ vi residentApp.sh

step 5: configure refapp url into residentApp.sh > find in residentApp.sh line "offlineApp="http://127.0.0.1:50050/lxresui/index.html" and replace with refapp url, Example: "offlineApp="http://127.0.0.1:50050/refapp/index.html"

Note: if you are downloading prebuild refapp from download link: build.zip after extract you will see build/build/<files>, you can copy build folder as it is and in this case url will be "offlineApp="http://127.0.0.1:50050/build/build/index.html".

step 6: After reboot app come up with a splash screen. Lighting application will launch instead of switcher app. Main menu screen is displayed which allows users to launch apps, vod, and play video content.


RefApp Video Playback

  • RDK 4.0 (rdk-generic-hybrid-image) Vs LGI  RefApp (rdk-generic-hybrid-refapp-image)



Dependencies

  • Lightning RefApp on Operator reference image (rdk-generic-hybrid-refapp-image)


 Reference Video

  • No labels

14 Comments

  1.  rdk-generic-hybrid-image-raspberrypi-rdk-hybrid.zip

    Somehow this image is not booting up either with RPI3 or RPI4

    I tried hybrid image from download page but doesnot show referenceApp.sh in /lib/rdk/


    Can someone help?

    Z-Mohammad Naseem Shekh Any Suggestions?

    1. Hi Ravindra Gawade 

      As i can understand from your comment, "rdk-generic-hybrid-image-raspberrypi-rdk-hybrid.zip" image is not booting up on RPI3 or RPI4.  then how you are accessing the file path?



      1. "I tried hybrid image from download page but doesnot show referenceApp.sh in /lib/rdk/"

        https://rdkcentral.com/download-instructions/?caller=hybrid

        The above image works but doesn't have the said file in the path.


        And as you correctly said

        "rdk-generic-hybrid-image-raspberrypi-rdk-hybrid.zip" image is not booting up on RPI3 or RPI4.


        You can call me on +91 9731223464 in case more information can help resolve this.

        We are kind of stuck for last 2/3 days.

        Really appreciate your help Z-Mohammad Naseem Shekh 

  2. Am I the only one facing this issue?

    Can someone please help here?


    Z-Mohammad Naseem Shekh 

  3. Ravindra Gawade 

    I have tested same image which i have uploaded in wiki, for me it is working fine. you can see in shared screen shot referenceApp.sh file is available and image version also you can see.

    check in latest images for /lib/rdk/residentApp.sh

  4. Z-Mohammad Naseem Shekh Thank you so much for validating and confirming the same.

    But somehow with following the exact same steps, we are not able to make this image working.

    What can be done next?

    1. Can you please with the image file instead of zip. that will help remove any issues with extraction. In case this also didn't work,
    2. Can we get onto quick call with screen sharing ad video to see if wee can resolve this. We are stuck without this working image. 

    Really appreciate your help in this.


    I'm not in lab today but my colleague Z-Mude Krishna Naick  will help get through the testing.


    I'm reachable on +91 9731223464 in case you need more information.

    Thank you once again.

  5. Hi Team,

    I'm able to find /lib/rdk/residentApp.sh file but I couldn't able to locate "/opt/residentapp.conf" file.


    4.replace exting url https://px-apps.sys.comcast.net/lightning_apps/SwitcherApp/dist/index.html in /opt/residentapp.conf with lighting app url which is hosted on server

    for example your server providing url http://192.168.56.1:8080


    1. Ravindra Gawade below changes is required to validate refapp

      step 1: login to box $ ssh root@<your box ip>

      step 2: copy refapp build into /opt/www

      step3: $ cd /lib/rdk

      step 4: $ vi residentApp.sh

      step 5: configure refapp url into residentApp.sh > find in residentApp.sh line "offlineApp="http://127.0.0.1:50050/lxresui/index.html" and replace with refapp url, Example: "offlineApp="http://127.0.0.1:50050/refapp/index.html"

      Note: if you are downloading prebuild refapp from download link: build.zip after extract you will see build/build/<files>, you can copy build folder as it is and in this case url will be "offlineApp="http://127.0.0.1:50050/build/build/index.html" or you can rename folder name using $mv /build /refapp and in this case url will be "offlineApp="http://127.0.0.1:50050/refapp/build/index.html"

      step 6: reboot the box

      on bootup refapp ui will be launched

      I hope this will resolve the issue.

  6. Hi Team,

    can we run the lightningjs application using pm2 server ?

    Please suggest us more information same.


    Thank you in advance.


    Thanks & Regards,

    Krishna.

    1. Hi Krishna, do you have any specific requirements in running the application with pm2 server?

    2. In theory it's possible but we have not tried to run lightningjs using pm2.

      1. Hi Ganesh,

        Thank you your response and currently we running the application in alternate method.


        Thanks & Regards,

        Krishna.

  7. Hi Team,

    We were able to get subtitles on lighting video player by adding textTracks to it and they were working fine on web browsers but they doesn’t come up with RDK image on Raspberry pi(3b+) and Skyworth  device .

    So, are the TextTracks supported by RDK or some different configuration is required for them?

    Please suggest us any further inputs on the same.


    Thank you in advance.


    1. WebVTT may not be fully supported currently with the WPE browser