Configure cameras and sensors on the reference image

The reference image is configured to boot the Camera MUX example application. If you change your hardware configuration because you want to run another application, you often must change the sensor configuration file and the order in which SLM starts different services.

To simplify the changes, the reference image provides multiple SLM configuration files that specify different service startup orders based on different hardware and that use predefined sensor configuration files, which are used by the Sensor service.

You may need to modify the sensor configuration file based on what you want to use with your image. This file is located at /etc/system/config/ on the reference image. For information about the Sensor service and sensor configuration files, see the Sensor chapter in the Sensor Framework Services guide.

Here are the SLM configuration files provided with the reference image, which are located in the /etc directory:

Change the configuration

To change the configuration, you can copy predefined changes from the SLM configuration files or modify both the SLM and sensor configuration files. You can do one of the following series of steps:
  • Determine the SLM configuration from the previous list that matches your configuration and copy that configuration over the slm-config-platform.xml file.
  • If your setup requires you to change an existing SLM configuration file, we recommend that you:

    1. If you haven't already, run mount -uw /base to allow you to write to the filesystem.
    2. Create a copy of the SLM configuration that points to a sensor configuration file and that's close to what you want.
    3. Create a custom sensor configuration file under /etc/system/config.
    4. Configure your version of the SLM configuration file to point to your custom file.

    For example, if you want to connect two cameras, you must:

    • Create a new sensor configuration file called /etc/system/config/two_cameras_surround.conf based on the /etc/system/config/cogent_surround_cameras.conf file.
    • Create a copy of the slm-config-platform-default.xml file and call it slm-config-platform-two-surround-view.xml.
    • In the new SLM configuration file, modify the following block to point to your sensor configuration file as follows:
      <SLM:component name="sensor">
          <SLM:args>-U 521:521,1001 -r /accounts/1000/shared/sensor
                     -c /base/etc/system/config//etc/system/config/two_cameras_surround.conf</SLM:args>
          <SLM:waitfor wait="pathname">/dev/sensor/camera</SLM:waitfor>
          <SLM:stop stop="signal">SIGTERM</SLM:stop>
    • Copy your custom SLM configuration to replace the slm-config-platform.xml file and type shutdown:
      # cp /etc/slm-config-platform-two-surround-view.xml /etc/slm-config-platform.xml
      # shutdown