Introduction

  • PSM (Persistent Storage Manager) component is responsible for the storage of default/system configurations.
  • Provides software interfaces and abstractions to read/write variables stored in persistent storage and read factory config variables.
  • PSM holds mainly parameters related to hardware configuration.
  • In dual processor architecture a process running in peer processor can access PSM DB over DBUS.
  • All defaults/system configuration which are not modified during runtime are part of PSM.
  • PSM should be up and running for normal configuration of RDKB unit.
  • For WiFi initialization, PSM holds all default values of OEM specific custom parameters which is fetched through PSM HAL.

Architecture

 

Figure 1 - Architectural view of PSM sub-system

Code Flow

Initialization

Figure 2 - Initialization of PSM sub-system

Current and default configuration files

PSM properties files

Configuration files are saved as below on the device:

  • /fss/gw/usr/ccsp/config/bbhm_def_cfg.xml
  • /nvram/bbhm_bak_cfg.xml
  • /nvram/bbhm_cur_cfg.xml

Factory reset removes the configuration files from nvram and copies default file to nvram.

 To prevent system configuration file from becoming corrupted or lost when the device is suddenly rebooted or power loss conditions, following counter-measures are in place:

  • First copy the current system file into the backup file
  • Then flush the configuration into the current file

Reading configuration

Figure 3 - Reading Configuration

  • PsmSysroCfmReadCurConfig/PsmSysroCfmReadDefConfig - This function is called to read the current or default Psm configuration into the memory.
  • AnscReadFile - performs a sequential read

Restore configuration is tried first from the current system file. If it passes the verification, read is done otherwise restore configuration is tried from the backup system file. If it passes the verification, read is done otherwise restores the factory default configuration. This step has to succeed since there is no any other plan to back it up.

Get values from PSM

Figure 4 - Retrieving Parameter

Using CLI utility:
psmcli get <parameter name as in bbhm file>
Eg: psmcli get eRT.com.cisco.spvtg.ccsp.Device.WiFi.NotifyWiFiChanges

Set values for PSM

Figure 5 - Setting Parameter

Using CLI utility:
psmcli set <parameter name as in bbhm file>
Eg: psmcli set eRT.com.cisco.spvtg.ccsp.Device.WiFi.NotifyWiFiChanges true


PSM CLIENT Operation

PSM CLI operation information captured here PSM CLI Operations.

  • No labels

14 Comments

  1. Suggestion: document psmcli on this page.

  2. hi,how to synchronize PSM configuration with HOSTAPD configuration(WIFI releated configuration)?

    1. Hi Z-wenjun.guan 

      The Hostapd configurations are updated by HAL layers API, During WiFi initialization the psm configurations are pushed to Hostapd through HAL APIs. 

      1. thanks for your reply.

        After wifi has been initialized, the configuration of Hostapd has changed. How is it synchronized to PSM?

        1. Configuration changes, and I understand that there are two scenarios, please check if they are correct:

          1、WEBUI/TR181->PSM->HAL->hostapd→hostapd.conf 

          2、prplmesh->hostpad→hostapd.conf

          If they are right:

          case one:  Does the initialization API need to be called to trigger configuration synchronization from PSM to hostapd every time a configuration change occurs?

          case two: The configuration is handed over to Hostapd first, and then how to synchronize this part of the configuration to PSM?

      2. For example,psm configure(eRT.com.cisco.spvtg.ccsp.Device.WiFi.Radio.SSID.%d.WLANEnable),how does this configuration of PSM synchronize with hostapd when other modules change wlan enable status via HAL API?

        1. Hi Z-wenjun.guan 

          The parameter "Device.WiFi.Radio.SSID.%d.WLANEnable" is read only parameter ,during Factory Reset it will override the current Wifi configuration.
          For your reference https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/CcspWifiAgent/+/rdk-next/source/TR-181/sbapi/cosa_wifi_apis.c#1766

  3. Hi,

    If we modify Wifi settings such as the SSID name and password  in the GUI, are these setting also stored in the PSM? If not, do we have a general method to know if one setting from GUI is stored in the PSM or not? Thank you!

    1. Hi Z-Tony He 

      PSM (Persistent Storage Manager) will hold the default values. If you modify Wifi settings such as the SSID name and password ,it will not reflect in PSM ,but it will reflect in hostapd.


      1. Hi Deepika Ganapathi Bhat

        Thanks for your answer.  I have a question. If RDK-B  will support a Wifi setting in the GUI(for example beacon interval) that is not controlled by hostapd and this setting need to set at run time via a command from Wifi chip vendor to set into the Wifi driver. How do we deal with this case? Where do we keep the setting? Have RDK-B team considered/discussed this case? Thank you!

        1. Hi Z-Tony He 

          For some configuration which needs to be applied at driver laver will be handled at WiFi HAL Layer .

          1. Hi Deepika Ganapathi Bhat 


            1.  I want to confirm with you. In current  code, are there any such configurations ?
            2.  If  we handle at WiFi HAL Layer, where/how do we keep the configurations that user can set in the GUI in the storage? I mean after rebooting, CcspWifiSsp needs to call WiFi HAL API, the configuration is passed in the argument of API, how does the CcspWifiSsp gets the configuration and its value? Or are you saying no argument is passed and WiFi HAL Layer knows the configuration and its value? In other words , are you saying WiFi HAL Layer needs to handle how to keep the configuration by itself?
            1. yes, I have the same quesiton.

              Look like the RDKB wifi stack does not support to save the current wifi parameters configuration well. 

              case 1) , for the paramters saved in hostapd.conf, they are ok , because the values are updated in /nvarm/xxx.conf, and survive from the rebooting.

                           that's to say, the previous values will be recovered.   [OK]

              case 2),  for the most wifi paramters that are not managed in hostapd.conf,  for example, if we set Radio.Enable as "false", but this value are not saved. 

                           so the Radio will be enabled UP  which is not expected.  [NOK].

              if all the wifi paramters are handled by WIFI Hal layer, it's a huge task.   

              do you have any good ideas about this limitation ? thanks! 

  4. PSM CLI Operations link mentioned above seems to be broken. Kindly check. 

    https://wiki.rdkcentral.com/display/RDK/CcspPsm