Versions Compared

Key

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

Table of Contents


Webconfig is a configuration management server from which RDK devices download configurations during bootup or when updates are available. The project is written in Go and has been open-sourced to the RDK community. You can find it here: https://github.com/rdkcentral/webconfig/blob/develop/README.md. The objective is to set up the Webconfig server using the open-sourced repository, so that it can be used by the RDK reference platform."


How To Setup


  • GO version 1.17 and above 
  • Cassandra should be running
  • Java ( openjdk > 11.0 ) 


Code Block
~$ sudo wget https://golang.org/dl/go1.20.3.linux-amd64.tar.gz
~$ sudo tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz
~$ ls /usr/local/go/bin/
go  gofmt
~# go version
go version go1.20.3 linux/amd64  


~# java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment (build 11.0.18+10-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
~#
~# echo "deb https://debian.cassandra.apache.org 41x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
deb https://debian.cassandra.apache.org 41x main
~#
~# curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
100  274k  100  274k    0     0   193k      0  0:00:01  0:00:01 --:--:--  193k
OK
~# sudo apt-get update
~# sudo apt-get install cassandra
~# ls /usr/sbin/cassandra
~# cassandra -v
4.1.1

:~# ps -ef | grep cassa
cassand+  222987       1  0 May04 ?        02:01:43 /usr/bin/java

Build And Run Application


Code Block
$ export WEBCONFIG_KEY=`head -c 32 /dev/random | base64`
$ mkdir -p /app/logs/webconfig
$ cd /go/src/github.com/rdkcentral/webconfig
$ make
$ bin/webconfig-linux-amd64 -f config/sample_webconfig.conf

** Note:  

After build, modify "config/sample_webconfig.conf" based on the server ip and port detail


Set Data to DB 


Code Block
curl -s -i "http://webconfig.rdkcentral.com:9007/api/v1/device/d83add0d178f/document/privatessid" -H 'Content-type: application/msgpack' --data-binary @privatessid.msgpack -X POST

curl -s -i "http://webconfig.rdkcentral.com:9007/api/v1/device/d83add0d178f/document/moca" -H 'Content-type: application/msgpack' --data-binary @moca.msgpack -X POST


Verify data in DB

Code Block
cqlsh:webconfig>  select * from xpc_group_config where cpe_mac='D83ADD0D178F';

 cpe_mac      | group_id    | error_code | error_details | expiry | params | payload                                                                                                                            | state | updated_time                    | version
--------------+-------------+------------+---------------+--------+--------+------------------------------------------------------------------------------------------------------------------------------------+-------+---------------------------------+-----------
 D83ADD0D178F |        moca |       null |          null |   null |   null |                                                                                                       0x81a6456e61626c65a474727565 |     2 | 2023-05-16 23:48:41.941000+0000 | 683076856
 D83ADD0D178F | privatessid |          0 |               |   null |   null | 0x8c105971de71bd30ae8a6d0fb10973174a97a0da0bd372b87f2342c132c554421de36916a06721d18cc1226d2a830b4af4297aa91611af89de4bf78b59859707 |     2 | 2023-05-16 23:48:24.845000+0000 | 563331257

(2 rows)
cqlsh:webconfig>


RDK Device downloads data

Code Block
~# curl -s "http://webconfig.rdkcentral.com:9007/api/v1/device/d83add0d178f/config"                                                                
--2xKIxjfJuErFW+hmNCwEoMoY8I+ECM9efrV6EI4efSSW9QjI
Content-type: application/msgpack
Etag: 683076856
Namespace: moca

▒▒Enable▒true
--2xKIxjfJuErFW+hmNCwEoMoY8I+ECM9efrV6EI4efSSW9QjI
Content-type: application/msgpack
Etag: 563331257
Namespace: privatessid

▒▒2.4▒rdkm_2.4▒5▒rdkm_5
--2xKIxjfJuErFW+hmNCwEoMoY8I+ECM9efrV6EI4efSSW9QjI--

RDK Device Log


Code Block
root@RaspberryPi-Gateway:~# cat /rdklogs/logs/WEBCONFIGlog.txt.0
230512-19:23:24.866983 [mod=WEBCONFIG, lvl=INFO] [tid=19031] WEBCONFIG: ********** Starting component: webconfig **********
 230512-19:23:24.867832 CR component name is: eRT.com.cisco.spvtg.ccsp.CR
subsystem_prefix eRT.
setv from/to component(webconfig): Device.X_RDK_WebConfig.ForceSync
Execution succeed.

root@RaspberryPi-Gateway:~# 230518-19:59:56.595249 [mod=WEBCONFIG, lvl=INFO] [tid=190315737] WEBCONFIG: NonRootReceived featurepoke is enabledrequest, droppingproceed root privileges for webconfig process
230512to parseForceSyncJson
230518-19:2359:2456.877486595416 [mod=WEBCONFIG, lvl=INFO] [tid=190315737] WEBCONFIG: webconfigRbusInitForce issync success.json ret is 0
230512parsed: [privatessid]
230518-19:2359:2456.877605595493 [mod=WEBCONFIG, lvl=INFO] [tid=190315737] WEBCONFIG: RegisteringTrigger parameters Device.X_RDK_WebConfig.RfcEnable, Device.X_RDK_WebConfig.ForceSync, Device.X_RDK_WebConfig.URL Device.X_RDK_WebConfig.SupplementaryServiceUrls.Telemetry
230512-19:23:24.891403 [mod=WEBCONFIG, lvl=force sync
230518-19:59:56.595644 [mod=WEBCONFIG, lvl=INFO] [tid=190315878] WEBCONFIG: psm_getForceSyncDoc success ret 0 for parameter Device.X_RDK_WebConfig.RfcEnable and value true
230512-19:23:24.891498privatessid ForceSyncTransID.
230518-19:59:56.622941 WEBCONFIG: read file script is called
230518-19:59:56.631238 WEBCONFIG: CURL_RESPONSE path is /tmp/.cURLresponse
230518-19:59:56.634573 [mod=WEBCONFIG, lvl=INFO] [tid=190315878] WEBCONFIG: rbusFailed regto status returned is 0
230512-19:23:24.893344 [mod=WEBCONFIG, lvl=INFO] [tid=19031] WEBCONFIG: Checked CR - System is ready, proceed with webconfig startup
230512-19:23:24.893605 [mod=WEBCONFIG, lvl=INFO] [tid=19031] WEBCONFIG: systemReadyTime is 1683919404
230512-19:23:24.893694read token from /etc/parodus/parodus_read_file.sh. Proceeding to create new token.
230518-19:59:56.670815 WEBCONFIG: No /nvram/certs/devicecert_1.pk12 using static cert
230518-19:59:56.680418 WEBCONFIG: No /usr/bin/GetConfigFile to fetch /tmp/.cfgStaticxpki
230518-19:59:56.689169 WEBCONFIG: Failure configuration file missing
230518-19:59:56.691845 [mod=WEBCONFIG, lvl=ERROR] [tid=190315878] WEBCONFIG: WaitingFailed forto Webconfig.Upstreamcreate event subscription for 300s
230512new token
230518-19:2359:4956.974359691963 [mod=WEBCONFIG, lvl=INFO] [tid=190335878] WEBCONFIG: reboot eventSubHandler: action=subscribe eventName=Webconfig.Upstream
230512reason is unknown
230518-19:2359:5456.896324692087 [mod=WEBCONFIG, lvl=INFO] [tid=190315878] WEBCONFIG: WebConfigversionsList Rfc is enabled, starting initWebConfigMultipartTask.
230512NONE-REBOOT
230518-19:2359:5456.896679692158 [mod=WEBCONFIG, lvl=INFO] [tid=190315878] WEBCONFIG: WebConfigMultipartTaskversion_header Thread created Successfully.
230512formed IF-NONE-MATCH:NONE-REBOOT
230518-19:2359:5456.901241692225 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: Webconfigschema_header Notification thread created Successfully
230512formed Schema-Version: v1.0
230518-19:2359:5456.902217692289 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: ProducersupportedVersion addedfetched webcfgdb->name root, webcfg->version 0, success_doc_count 1
230512is NULL
230518-19:2359:5456.932167692352 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: FirmwaresupportedDocs_header Upgrade start time is 0
230512-19:23:54.932275formed X-System-Supported-Docs: 16777247,33554435,50331649,67108865,83886081,100663297,117440513,134217729,201326594,218103809,251658241
230518-19:59:56.692427 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: FirmwarebootTime_header Upgrade end time is 10800
230512formed X-System-Boot-Time: 1684439782
230518-19:2359:5456.932349692494 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: Starting initEventHandlingTask
230512FwVersion_header formed X-System-Firmware-Version: rdkb-generic-broadband-image_rdk-next_20230511162210
230518-19:2359:5456.932633692560 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: Webconfigstatus_header event handling thread created Successfully
230512formed X-System-Status: Operational
230518-19:2359:5456.932796692631 [mod=WEBCONFIG, lvl=INFO] [tid=195255878] WEBCONFIG: RegisteringcurrentTime_header RBUS event Element
230512formed X-System-Current-Time: 1684439996
230518-19:2359:5456.932903692697 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: processWebcfgEventssystemReadyTime_header thread created Successfully
230512formed X-System-Ready-Time: 1684439892
230518-19:2359:5456.932983692827 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: Webconfiguuid_header is ready to process requests. set webcfgReady to true
230512-19:23:54.933904formed Transaction-ID: 825e8635-2f91-4bcf-88d7-97c92b588e40
230518-19:59:56.692894 [mod=WEBCONFIG, lvl=INFO] [tid=195255878] WEBCONFIG: registerWebcfgEvent success
230512 productClass_header formed X-System-Product-Class: XB3
230518-19:2359:5456.935766692963 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: getSerialNumber
230512ModelName_header formed X-System-Model-Name: RPI
230518-19:2359:54.97889956.693028 [mod=WEBCONFIG, lvl=INFO] [tid=5878] WEBCONFIG: read file scriptThe get_global_supplementarySync() is called0
230512230518-19:2359:54.98715556.697086 [mod=WEBCONFIG, lvl=INFO] [tid=5878] WEBCONFIG: CURL_RESPONSE pathdocList is /tmp/.cURLresponse
230512root
230518-19:2359:5456.989856697189 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: FailedWebconfig toroot readConfigURL tokenis from http:/etc/parodus/parodus_read_file.sh. Proceeding to create new token.
230512-19:23:55.026802 WEBCONFIG: No /nvram/certs/devicecert_1.pk12 using static cert
230512-19:23:55.035109 WEBCONFIG: No /usr/bin/GetConfigFile to fetch /tmp/.cfgStaticxpki
230512-19:23:55.043432 WEBCONFIG: Failure configuration file missing
230512-19:23:55.046095/webconfig.rdkcentral.com:9007/api/v1/device/e45f0156ff0e/config?group_id=root
230518-19:59:56.697265 [mod=WEBCONFIG, lvl=INFO] [tid=5878] WEBCONFIG: g_interface fetched is erouter0
230518-19:59:56.697343 [mod=WEBCONFIG, lvl=ERRORINFO] [tid=195215878] WEBCONFIG: Failedcurl toIp create new token
230512resolve option set as default mode
230518-19:2359:5557.048610023404 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: reboot reason g_ETAG updated for primary sync is unknown1883965250
230512230518-19:2359:5557.048779023608 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: versionsList is NONE-REBOOT
230512 webConfig curl response 0 http_code 200
230518-19:2359:5557.048851023767 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: version_headercurl formed IF-NONE-MATCH:NONE-REBOOT
230512response Time: 0.3 seconds
230518-19:2359:5557.048919023847 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: schema_header formed Schema-Version: v1.0
230512-19:23:55.048982 ct is multipart/mixed; boundary=2xKIxjfJuErFW+hmNCwEoMoY8I+ECM9efrV6EI4efSSW9QjI, content_res is 0
230518-19:59:57.023912 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: supportedVersionContent-Type fetched is NULL
230512is multipart/mixed. Valid
230518-19:2359:5557.049047024303 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: supportedDocs_header formed X-System-Supported-Docs: 16777247,33554435,50331649,67108865,83886081,100663297,117440513,134217729,201326594,218103809,251658241
230512-19:23:55.051273 Size of the docs is :1
230518-19:59:57.024415 [mod=WEBCONFIG, lvl=INFOERROR] [tid=195215878] WEBCONFIG: bootTime_headerMultipart formed X-System-Boot-Time: 1683918788
230512list is empty
230518-19:2359:5557.066136024518 [mod=WEBCONFIG, lvl=INFO] [tid=195215879] WEBCONFIG: dest FwVersion_header formed X-System-Firmware-Version: rdkb-generic-broadband-image_rdk-next_20230511162210
230512-19:23:55.066239is event:subdoc-report/privatessid/mac:e45f0156ff0e/status
230518-19:59:57.024638 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: The status_headerMaintenance formed X-System-Status: Operational
230512-19:23:55.066309 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: currentTime_header formed X-System-Current-Time: 1683919435
230512-19:23:55.066376Sync triggers at Fri 230519 02:01:29
230518-19:59:57.024728 [mod=WEBCONFIG, lvl=INFO] [tid=195215879] WEBCONFIG: systemReadyTime_headerstringifiedNotifyPayload formed X-System-Ready-Time: 1683919404
230512-19:23:55.066571is {"device_id":"mac:e45f0156ff0e","namespace":"privatessid","application_status":"failed","error_code":311,"error_details":"multipart_cache_NULL","transaction_uuid":"unknown","version":"0"}
230518-19:59:57.024792 [mod=WEBCONFIG, lvl=INFO] [tid=195215878] WEBCONFIG: uuid_headerreset formed Transaction-ID: fb00cd07-4c80-469f-9eb3-274207052570
230512maintenanceSync to false
230518-19:2359:5557.068773025021 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: productClass_header formed X-System-Product-Class: XB3
230512-19:23:55.088049 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: ModelName_header formed X-System-Model-Name: RPI
230512-19:23:55.088163 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: The get_global_supplementarySync() is 0
230512-19:23:55.091787 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: docList is root
230512-19:23:55.091871 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: Webconfig root ConfigURL is http://webconfig.rdkcentral.com?group_id=root
230512-19:23:55.092049 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: Interface fetched from Device.properties is erouter0
230512-19:23:55.092117 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: g_interface fetched is erouter0
230512-19:23:55.092180 [mod=WEBCONFIG, lvl=INFO] [tid=19521] WEBCONFIG: curl Ip resolve option set as default mode
root@RaspberryPi-Gateway:~# lvl=INFO] [tid=5879] WEBCONFIG: Notification successfully sent to Webconfig.Upstream
[  216.048167] sh[9497]: device wlan0 is already a member of a bridge; can't enslave it to bridge brlan0.
[  216.074517] sh[9498]: interface wlan1 does not exist!
[  226.262396] sh[10157]: device wlan0 is already a member of a bridge; can't enslave it to bridge brlan0.
[  226.289465] sh[10158]: interface wlan1 does not exist!
[  236.478289] sh[10362]: device wlan0 is already a member of a bridge; can't enslave it to bridge brlan0.
[  236.503898] sh[10363]: interface wlan1 does not exist!
[  239.775543] audit: type=1701 audit(1684440023.027:82): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=10420 comm="irq0" exe="/home/root/irq0" sig=11 res=1
[  239.807159] audit: type=1701 audit(1684440023.057

ToDo  ( In Progress )


RDK Feature test 

  •  Bootup sync
  •  On demand Sync
  •  Supplementary Service