LogUpload in RPI (RDK-V) using XConf Simulator

Created on June 21, 2022


Step 1: Update Settings

Update the logUpload url and other settings. (from any REST client) 

To ‘updateSettings’, use the below curl command: (for a particular mac)

 curl -X POST -H 'Content-Type: application/json' -d '{"estbMacAddress":"B8:27:EB:AE:57:B7","logUploadSettings":{"uploadOnReboot":true,"uploadRepositoryUrl":"https://ssr.ccp.xcal.tv/cgi-bin/rdkvlogupload.cgi","uploadProtocol":"HTTP","uploadScheduleCron":"*/5 * * * *"},"telemetrySettings":{"scheduleCron":"*/7 * * * *","uploadUrl":"https://stbrtl.r53.xcal.tv","uploadProtocol":"HTTP","telemetryProfile":[{"header" : "err_LSA_E_RES_TIMEOUT","content" : "RBI LSA-E: Status Event Response Timeout","type" : "ocapri_log.txt","pollingFrequency":"0"},{"header" : "err_LSA_P_InsertionFailed","content" : "RBI LSA-P: Insertion Failure","type" : "ocapri_log.txt","pollingFrequency":"0"},{"header" : "err_LSA_E_InsertionFailed","content" : "LSA-E: Status Event Insertion Failed","type" : "ocapri_log.txt","pollingFrequency":"0"},{"header" : "err_LSA_SP _InsertionAttempt","content" : "RBI LSA-SP : Insertion Attempt","type" : "rbiDaemon.log","pollingFrequency":"0"}]}}' http://<xconf_simulator_ip>:<port>/xconf/logUploader/updateSettings

 

Now,  running dcm-log.service in RPI should get the settings and invoke log upload scripts to do the necessary action.

 

In RPI:  

(Some work-arounds are needed to make DCM work)

1. Change in /etc/dcm.properties

DCM_LOG_SERVER_URL=http://<xconf_simulator_ip>:<port>/xconf/logUploader/getSettings/ 

2. cp /etc/dcm.properties /opt/dcm.properties 

3. /etc/device.properties

RDK_EMULATOR=false


4. Change required in /lib/rdk/utils.sh for returning MAC address correctly

getEstbMacAddress()                                                  
{ 
- - - mac=`awk < /proc/cmdline '{ for (i=1; i<=NF; i++) print $i}' | grep comcast[.]stbmacaddr | cut -d'=' -f 2`
+++ mac=`awk < /proc/cmdline '{ for (i=1; i<=NF; i++) print $i}' | grep [.]macaddr | cut -d'=' -f 2`
echo $mac          
}
 
5. Added this function in /lib/rdk/DCMscript.sh 

getModel()
{
    echo "RPI"
}

6. Change  line 380 in /lib/rdk/DCMscript.sh 

nice sh $RDK_PATH/uploadSTBLogs.sh $tftp_server 1 1 1 $upload_protocol $upload_httplink & to

sh $RDK_PATH/uploadSTBLogs.sh $tftp_server 1 1 1 $upload_protocol $upload_httplink & 

 as "nice: Command not found"

systemctl stop dcm-log

systemctl start dcm-log

This invokes /lib/rdk/StartDCM.sh which further invokes /lib/rdk/DCMscript.sh

 

Output (/opt/logs/dcmscript.log)

17.05.2018_19:18.50 Starting execution of DCMscript.sh
17.05.2018_19:18.50 URL: http://192.168.30.171:8081/xconf/logUploader/getSettings/
17.05.2018_19:18.50 DCM_TFTP_SERVER: 172.29.75.22
17.05.2018_19:18.50 REBOOT_FLAG: 0
17.05.2018_19:18.50 CHECK_ON_REBOOT: 1
TFTP_SERVER: 172.29.75.22
Inside get ip address
17.05.2018_19:18.50 ——— box got an ip 192.168.30.188
17.05.2018_19:18.57 CURL_CMD: curl -w ‘%{http_code}n’ –connect-timeout 10 -m 10 -o “tmp/mnt/diska3/DCMresponse.txt” ‘http://192.168.30.171:8081/xconf/logUploader/getSettings/?estbMacAddress=B8:27:EB:58:C4:89&firmwareVersion=rdk-generic-hybrid-westeros-wpe-image_default_20180518060455&env=dev&model=RPI&ecmMacAddress=&controllerId=2504&channelMapId=2345&vodId=15660
17.05.2018_19:19.07 ret = 0 http_code: 200
17.05.2018_19:19.07 HTTP request success. Processing response..
17.05.2018_19:19.07 processJsonResponse returned 0
17.05.2018_19:19.07 resp = 0
17.05.2018_19:19.07 sendHttpRequestToServer returned 0
17.05.2018_19:19.07 upload_protocol: HTTP
17.05.2018_19:19.07 upload_httplink is https://ssr.ccp.xcal.tv/cgi-bin/rdkvlogupload.cgi
17.05.2018_19:19.07 The value of ‘UploadOnReboot’ is ‘true’, executing script uploadSTBLogs.sh
17.05.2018_19:19.07 Build Type: dev Log file: B827EB58C489_Logs_05-17-18-07-19PM.tgz TFTP Server: 172.29.75.22 Protocol: HTTP UploadHttpLink: https://ssr.ccp.xcal.tv/cgi-bin/rdkvlogupload.cgi
17.05.2018_19:19.07 Uploading Logs with DCM UploadOnReboot set to true
17.05.2018_19:19.07 Sleeping for seven minutes
17.05.2018_19:26.07 Done sleeping
17.05.2018_19:26.11 Processing file…reboot.log
05-17-18-07-26PM-applications.log
05-17-18-07-26PM-card_status.log
05-17-18-07-26PM-core_log.txt
05-17-18-07-26PM-dcmscript.log
05-17-18-07-26PM-disk_cleanup.log
05-17-18-07-26PM-diskinfo.log
05-17-18-07-26PM-ocapri_log.txt
05-17-18-07-26PM-ocapri_log.txt.0
05-17-18-07-26PM-rebootInfo.log
05-17-18-07-26PM-rf4ce_log.txt
05-17-18-07-26PM-rfcscript.log
05-17-18-07-26PM-startup_stdout_log.txt
05-17-18-07-26PM-swupdate.log
05-17-18-07-26PM-system.log
05-17-18-07-26PM-top_log.txt
05-17-18-07-26PM-version.txt
last_reboot
reboot.log
17.05.2018_19:26.11 Uploading logs B827EB58C489_Logs_05-17-18-07-19PM.tgz onto 172.29.75.22
tftp: timeout
17.05.2018_19:27.25 Done Uploading Logs
17.05.2018_19:27.25 Moving to Previous Logs Backup Folder

  

Updated settings can be seen in: /tmp/ DCMSettings.conf

urn:settings:GroupName=RPI_V3
urn:settings:CheckOnReboot=false
urn:settings:CheckSchedule:cron=33 5 * * *
urn:settings:CheckSchedule:DurationMinutes=180
urn:settings:LogUploadSettings:Message=Don’t upload your logs, but check for updates on this schedule.
urn:settings:LogUploadSettings:Name=null
urn:settings:LogUploadSettings:NumberOfDays=null
urn:settings:LogUploadSettings:UploadRepositoryName=null
urn:settings:LogUploadSettings:UploadImmediately=false
urn:settings:LogUploadSettings:upload=false
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=null
urn:settings:VODSettings:Name=null
urn:settings:VODSettings:LocationsURL=null
urn:settings:VODSettings:SRMIPList=null
urn:settings:LogUploadSettings:UploadRepository:uploadProtocol=HTTP
urn:settings:LogUploadSettings:UploadRepository:URL=https://ssr.ccp.xcal.tv/cgi-bin/rdkvlogupload.cgi
urn:settings:LogUploadSettings:UploadSchedule:cron=*/5 * * * *
urn:settings:LogUploadSettings:UploadOnReboot=true
urn:settings:TelemetryProfile=id=1575d508-5082-4b41-925e-a31fb5a566a4,expires=0,telemetryProfile:name=RDKV_RPI,telemetryProfile=[header=SYS_INFO_bootup,c…

etc…

Go To Top