1. Required equipment's


  • Raspberry pi device

  • Ethernet cable

  • SD card

  • Standard USB keyboard

  • TV/Monitor with HDMI input

2. Telemetry


Telemetry is the automatic recording and transmission of data from remote or inaccessible sources to an IT system in a different location for monitoring and analysis.

3. Telemetry Components


  • Xconf Server
  • Rpi Board with RDK Broadband image
  • Tftp Server

4. Steps to build code 


  • repo init -u https://code.rdkcentral.com/r/manifests -b rdk-next -m rdkb-extsrc.xml
  • repo sync -j4 --no-clone-bundle
  • source meta-cmf-raspberrypi/setup-environment
  • choose option 8: meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-broadband.conf
  • bitbake rdk-generic-broadband-image

5. Steps to flash image


  • The image will be available under build-raspberrypi-rdk-broadband/tmp/deploy/images/raspberrypi-rdk-broadband
  • Copy the image rdkb-generic-broadband-image_default_<xx>.rootfs.rpi-sdimg to your server.
  • To flash the image
        dmesg
        mount
        umount <partition-mountpoint>
        sudo dd if=<rpi sdimg> of=/dev/sdb bs=1M
  • Remove the SD card and insert it to the Raspberry Pi SD card slot
  • Bring up the device

6. Xconf server


6.1.1. Define Environments   

                 URL : http://35.155.171.121:9093/admin/ux/#/environment/all
                 Flow : Xconf-server -> Common -> Environments

                           

6.1.2. Define Models 

                            URL : http://35.155.171.121:9093/admin/ux/#/model/all
                            Flow : Xconf-server -> Common -> Models

                           

6.1.3. Define MAC List

                         URL : http://35.155.171.121:9093/admin/ux/#/namespacedlist/MAC_LIST
                         Flow : Xconf-server -> Common -> MAC Lists -> Select the Id -> Add your MAC                            

7. Configuring Telemetry on Xconf server


7.1. Log upload

  • 7.1.1. Change Application to stb in top right corner of the window

         
  • 7.1.2. Defining the formula

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Flow

Xconf-server ->DCM -> Formulas -> Create

Name

<Unique name  for log upload >

Description

<Enter a short description>

Percentage

100

Priority

4

Build condition

estbMacAddress is <MAC-Address> 

               Sample 

              
              

  • As soon as the formula is saved , displays the device settings and Log upload settings options
       
  • 7.1.3. Device settings

    Name

    RDKB_telemetry

    CheckOnReboot

    true

    Are active

    true

    Expression

    2 1 2 1 1

      

    7.1.4. Defining the Upload repositories

    URL

    http://35.155.171.121:9093/admin/ux/#/uploadrepository

    Flow

    Xconf-server ->DCM -> Upload repositories

    Name

    RDKB_telemetry

    Description

    RDKB_telemetry

    URL

    tftp    : 35.155.171.121

    HTTP :  http://35.155.171.121/xconf/logupload.php

    7.1.5. Log upload settings

    Name

    <Enter the name given during Log upload formula creation>

    Upload On Reboot

    true

    Number of Days

    1

    Are settings active

    true

    Upload Repository

    RDKB_telemetry

    Cron Expression

    2 1 1 1 1

    7.1.6. Test Page

    URL

    http://35.155.171.121:9093/admin/ux/#/formulas/all

    Path

    Xconf-server-> DCM -> Test Page

          

7.2. Telemetry

7.2.1. Defining Telemetry profile

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Permanent Profiles -> Create

                Sample :
               

               

7.2.2. Create Targeting rule 

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Targeting rule -> Create

  1. Give the Unique rule name
  2. Select the rule. Here , used estbMacAddress as the rule
  3. Select the Bound profile (Telemetry Permanent Profile Name)

         Sample

    

7.2.3. Test Page

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Test Page

  1. To test whether the configured profile details are retrieved properly from xconf-server
  2. Give the rule specified in “Targeting Rule” section i.e., estbMacAddress here   

       Sample:

       

8. Configuring Telemetry on Raspberry pi


  • Once the board is up , go to /etc/dcm.properties and add the below details

LOG_SERVER=35.155.171.121

DCM_LOG_SERVER=http://35.155.171.121/xconf/logupload.php

DCM_LOG_SERVER_URL=http://35.155.171.121:9092/loguploader/getSettings

DCM_SCP_SERVER=35.155.171.121

DCM_HTTP_SERVER_URL=http://35.155.171.121/xconf/telemetry_upload.php

DCM_LA_SERVER_URL=http://35.155.171.121/xconf/logupload.php

  • Restart the dcm-log service using “systemctl restart dcm-log
  • To check the status of the service “systemctl status dcm-log
  • By triggering the service , rpi starts uploading the logs to the xconf-server
  • The log upload and Telemetry markers can be uploaded via tftp and http
  • The profile can be verified using curl, conf file , through logs and in server as below

1.  CURL

  • Syntax : curl -i 'http://<ip>:9092/loguploader/getSettings?estbMacAddress=<MAC>’

Sample: 1  TFTP

root@RaspberryPi-Gateway:~# ifconfig erouter0
erouter0  Link encap:Ethernet  HWaddr B8:27:EB:22:16:36
          inet addr:192.168.30.125  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe22:1636/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18748 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3081 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2614475 (2.4 MiB)  TX bytes:590848 (577.0 KiB)

root@RaspberryPi-Gateway:~# curl -i 'http://35.155.171.121:9092/loguploader/getSettings?estbMacAddress=B8:27:EB:22:16:36'
HTTP/1.1 200 OK

Date: Fri, 31 Jan 2020 10:59:09 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(9.2.1.v20140609)

{"urn:settings:GroupName":"RDKB_telemetry","urn:settings:CheckOnReboot":true,"urn:settings:CheckSchedule:cron":"2 1 2 1 1","urn:settings:CheckSchedule:DurationMinutes":0,"urn:settings:LogUploadSettings:Message":null,"urn:settings:LogUploadSettings:Name":"RDKB_telemetry","urn:settings:LogUploadSettings:NumberOfDays":0,"urn:settings:LogUploadSettings:UploadRepositoryName":"RDKB_telemetry","urn:settings:LogUploadSettings:RepositoryURL":"tftp://35.155.171.121","urn:settings:LogUploadSettings:UploadOnReboot":true,"urn:settings:LogUploadSettings:UploadImmediately":false,"urn:settings:LogUploadSettings:upload":true,"urn:settings:LogUploadSettings:UploadSchedule:cron":"2 1 1 1 1","urn:settings:LogUploadSettings:UploadSchedule:levelone:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes":0,"urn:settings:VODSettings:Name":null,"urn:settings:VODSettings:LocationsURL":null,"urn:settings:VODSettings:SRMIPList":null,"urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header":"Firewall","content":"starting firewall service","type":"FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele","uploadRepository:URL":"35.155.171.121","uploadRepository:uploadProtocol":"TFTP"}}

Sample: 2  HTTP

root@RaspberryPi-Gateway:~# curl -i 'http://35.155.171.121:9092/loguploader/getSettings?estbMacAddress=B8:27:EB:22:16:36'
HTTP/1.1 200 OK

Date: Fri, 31 Jan 2020 12:15:26 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(9.2.1.v20140609)

{"urn:settings:GroupName":"RDKB_telemetry","urn:settings:CheckOnReboot":true,"urn:settings:CheckSchedule:cron":"2 1 2 1 1","urn:settings:CheckSchedule:DurationMinutes":0,"urn:settings:LogUploadSettings:Message":null,"urn:settings:LogUploadSettings:Name":"RDKB_telemetry","urn:settings:LogUploadSettings:NumberOfDays":0,"urn:settings:LogUploadSettings:UploadRepositoryName":"RDKB_telemetry","urn:settings:LogUploadSettings:RepositoryURL":"http://35.155.171.121/xconf/logupload.php","urn:settings:LogUploadSettings:UploadOnReboot":true,"urn:settings:LogUploadSettings:UploadImmediately":false,"urn:settings:LogUploadSettings:upload":true,"urn:settings:LogUploadSettings:UploadSchedule:cron":"2 1 1 1 1","urn:settings:LogUploadSettings:UploadSchedule:levelone:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes":0,"urn:settings:VODSettings:Name":null,"urn:settings:VODSettings:LocationsURL":null,"urn:settings:VODSettings:SRMIPList":null,"urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header":"Firewall","content":"starting firewall service","type":"FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele","uploadRepository:URL":"http://35.155.171.121/xconf/telemetry_upload.php","uploadRepository:uploadProtocol":"HTTP"}}


2. Configuration file

  • Once the profile details are successfully retrieved , the conf file will be created under /tmp which has the server configurations 
  • The telemetry markers are compared with the corresponding log files and if the match is found then the markers are uploaded to the http://35.155.171.121/xconf/upload/
  • Sample 1: tftp
    root@RaspberryPi-Gateway:~# cat /tmp/DCMSettings.conf

    urn:settings:GroupName=RDKB_telemetry
    urn:settings:CheckOnReboot=true
    urn:settings:CheckSchedule:cron=2 1 2 1 1
    urn:settings:CheckSchedule:DurationMinutes=0
    urn:settings:LogUploadSettings:Message=null
    urn:settings:LogUploadSettings:Name=RDKB_telemetry
    urn:settings:LogUploadSettings:NumberOfDays=0
    urn:settings:LogUploadSettings:UploadRepositoryName=RDKB_telemetry
    urn:settings:LogUploadSettings:RepositoryURL=tftp://35.155.171.121
    urn:settings:LogUploadSettings:UploadOnReboot=true
    urn:settings:LogUploadSettings:UploadImmediately=false
    urn:settings:LogUploadSettings:upload=true
    urn:settings:LogUploadSettings:UploadSchedule:cron=2 1 1 1 1
    urn:settings:LogUploadSettings:UploadSchedule:levelone:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes=0
    urn:settings:VODSettings:Name=null
    urn:settings:VODSettings:LocationsURL=null
    urn:settings:VODSettings:SRMIPList=null
    "urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header" : "Firewall","content" : "staring firewall service","type" : "FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele,"uploadRepository:URL":"35.155.171.121","uploadRepository:uploadProtocol":"TFTP"}


    Sample 2:  http

    root@RaspberryPi-Gateway:~# cat /tmp/DCMSettings.conf

    urn:settings:GroupName=RDKB_telemetry
    urn:settings:CheckOnReboot=true
    urn:settings:CheckSchedule:cron=2 1 2 1 1
    urn:settings:CheckSchedule:DurationMinutes=0
    urn:settings:LogUploadSettings:Message=null
    urn:settings:LogUploadSettings:Name=RDKB_telemetry
    urn:settings:LogUploadSettings:NumberOfDays=0
    urn:settings:LogUploadSettings:UploadRepositoryName=RDKB_telemetry
    urn:settings:LogUploadSettings:RepositoryURL=http://35.155.171.121/xconf/logupload.php
    urn:settings:LogUploadSettings:UploadOnReboot=true
    urn:settings:LogUploadSettings:UploadImmediately=false
    urn:settings:LogUploadSettings:upload=true
    urn:settings:LogUploadSettings:UploadSchedule:cron=2 1 1 1 1
    urn:settings:LogUploadSettings:UploadSchedule:levelone:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron=null
    urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes=0
    urn:settings:VODSettings:Name=null
    urn:settings:VODSettings:LocationsURL=null
    urn:settings:VODSettings:SRMIPList=null
    "urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header" : "Firewall","content" : "starting firewall service","type" : "FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele","uploadRepository:URL":"http://35.155.171.121/xconf/telemetry_upload.php","uploadRepository:uploadProtocol":"HTTP"}

 3. Logs

  • Log file to monitor and analyze the files which are uploaded to server
  • /rdklogs/logs/dcmscript.log
    TFTP 


    HTTP


  • /rdklogs/logs/telemetry.log
    TFTP


    HTTP


4. Xconf-Server

           HTTP   
          

9. Configuring more entries to a profile


  • Go to Telemetry -> Permanent Profile
  • Under “Telemetry Profile entries” add your new required markers
  • Here, added 2 new markers for wifihealth.txt file

                1. WIFI_MAC_2 with the profile name as “Wifihealth_1” and polling frequency as 1
                2. WIFI_BYTESSENTCLIENTS with the profile name as “Wifihealth_2” and polling frequency as 1

  • Save
  • In Rpi , make sure that you stopped the rdkbLogMontior service , in order to stop the log rotation process (systemctl stop rdkbLogMonitor)
  • Now restart the dcm-log service using systemctl restart dcm-log
  • With successful response , tar file and JSON file gets uploaded to the xconf-server
  • Open the upload JSON file in the browser
  • We could see the profile entries with the number of times the specified marker has appeared in the file.

    Sample:

    {"searchResult":[{"Firewall":"1"},{"Wifihealth_1":"2"},{"Wifihealth_2":"2"},{"Profile":"RDKB"},{"mac":"B8:27:EB:22:16:36"},{"erouterIpv4":"192.168.30.125"},{"erouterIpv6":"null"},{"PartnerId":"RDKM"},{"AccountId":"Unknown"},{"Version":"rdkb-generic-broadband-image_default_20200224150713"},{"Time":"2020-02-26 12:23:51"}]}


    NOTE : JSON file holds only the number of times the particular marker has appeared in the respective log file. To see the complete log file, need to download the tar file uploaded and extract the files to see the complete logs or value of the parameters

10. Observations :

  • Pushing script from XConf

Currently pushing the script from xconf to the target device is not possible due to the security issue , as it may lead to downloading the licensed file to the vulnerable device. The pushing may also lead to removal of file from rootfs , so this is not advised to do for now. Whereas , we can initiate the download from device through tftp/curl command either from the script or from console.

  • telemetry target type

 Target type is provided to handle dynamic parameters change . We have 4 target types .

         1.  # 0 if as part of normal execution

         2.  # 1 if initiated due to an XCONF update

        3.  # 2 if forced execution before log upload

        4.  # 3 if modify the cron schedule 

During boot-up or service start , target type update will be initiated .

On each initiation , Whenever it finds the markers in the log files , it provides the search results with marker details , when it doesn't find , it just provides the basic RDKB profile details(without markers). It all depends on the markers availability in the log files.

Currently Type 1 and 2 are supported .

  • Empty JSON message

On having the Schedule type in DCM either as "ActNow" or "CronExpression" , with the expression in schedule under telemetry profile . JSON messages are seen with generic RDKB profile details on every 5 min / 10 mins (Expression : /5 * * * *  or */10 * * * * ) . Once in a day uploads JSON with markers to the server .

This is seen due to the schedule expression . As a workaround , we can give the schedule in numbers (Example : 2 / 5 / 10)

The ticket is in place to implement the cron expression support in RPi. Once it is in place , the empty JSON messages will not be seen .


                        


  • No labels

6 Comments

  1. Hi,

    Please help!!

    I am not able to receive the telemetry marker json file. I am using the tftp protocol and using my vm ubuntu machine as tftp server.  I am able to get complete logs .tgz file but not marker file. 

    I have configured the Xconf server correctly for the telemetry marker. Below is my dcm.properties file configuration :


    #HTTP_UPLOAD_LINK=https://ssr.ccp.xcal.tv/cgi-bin/S3.cgi
    #DCA_UPLOAD_URL=https://stbrtl.xcal.tv
    DCA_UPLOAD_URL=192.168.18.39



    1. Can you try with a HTTP upload end-point and also check whether there are any error logs from device end.

  2. Hi Ganesh,


    There is no error from device side. But don't get file copied in path /tmp/DCMSettings.conf.

    I am struggling to get telemetry working at my side. Can you please help me to provide access to your xconf server http://35.155.171.121:9093/admin/ux/#/ ?



    1. Hi Z-Mohammad Imran 

      Please refer Xconf Server - User guide for configuration and feature validation for the validation part.

      Steps mentioned in above wiki are mostly performed on RDKV device  so you may expect slight differences for RDK-B devices.

      Also , if you still need access to the rdkcentral Xconf server please create an issue in project specific Jira with the usecase.

      logupload.php & telemetry_upload.php are sample scripts to verify http(s) upload of the data to server. you can also have any equivalent upload endpoint configured with the rule or re-use the same.

      Thanks

      Ganesh

  3. Hi,

    How can i get 'DCA_BINARY="/usr/bin/dca" binary.


    Regards,

    Imran.

    1. Hi Z-Mohammad Imran ,

      Could you please confirm the below details 

      • Are you not seeing dca binary under /usr/bin ?
      • If yes , do you see dca repository or recipe file masked in your code ?
      • Is dca available in your packaging file ? (packagegroup-rdk-ccsp-broadband*) 

      Regards,
      Priyankaa KVB