Skip to content

Configuration

maehw edited this page Nov 27, 2021 · 33 revisions

Operating system

There are at least three ways:

  • Using a Raspberry Pi single board computer
  • Using your Linux machine (laptop, desktop, etc.)

Cross reference: Hardware#computers.

Fresh Raspberry Pi OS installation

  • Load the image on an SD card and put it back into the Raspberry Pi
  • Boot the Raspberry Pi and follow the configuration guide (localization, password, WiFi, etc.)
  • Install software updates
  • Optionally run raspi-config to adjust the configuration (e.g. change the hostname), reboot
  • tbc

Configuration files

Environment variables

  • CAMLIBS environment variable related to libgphoto2 and/or gphoto2 (the script ./start.sh sets it to ./libs but that folder does not exist after cloning and building; not sure if this is really required); accessed by GphotoCamera::start()

Settings

  • /opt/.selfomat.type: has <box_type> as its contents (is read during run-time)
  • ./settings/: holds multiple JSON files
    • <box_type>.json:
      • setup-specific settings are stored in this JSON file; at startup the code tries to open the JSON file with where box_type is initialized to a hard-coded default value during compile-time but can be replaced by the contents of /opt/.selfomat.type (see above)
      • settings inside the file are: camera_type, has_flash, has_button, disable_watchdog, debug, button_port_name, image_dir , show_led_setup, force_image_dir_mountpoint, fullscreen.
        • You need to give a valid image_dir and specify whether it needs to be a mount point or not via force_image_dir_mountpoint (<HOME>/<USERNAME>/Pictures is a possibility).
  • inside <HOME>/
    • .selfomat_settings.json:
      • settings: trigger_counter, storage_enabled, printer_enabled, template_enabled, flash_enabled, show_agreement, filter_choice, filter_gain, debug_log_enabled, autofocus_before_trigger, frontend_language_choice)
      • acessed by BoothLogic::readSettings() and BoothLogic::readSettings()
      • BoothLogic::readSettings() tries to read settings from this file and otherwise (if the file does not exist) uses hard-coded default values
      • BoothLogic::readSettings() tries to write this file
  • internationalization ("i18n") is controlled by the files in ./i18n
    • related: frontend_language_choice as set in .selfomat_settings.json (see above) set the frontend language
    • [de|en|fr]_frontend.json: language definition files (German/English/French) for the photo booth's screen UI
    • [de|en.json]: language definition files (German/English) for the browser accessible settings app

Templates

Templates basically provide an overlay over the photo printouts. The idea is that you can frame the picture or overlay the final picture with a company logo. In order to create a template, you simply need to create a PNG frame with a transparent region. The photo booth software will detect the transparent region and insert the image there. Note that the image will be scaled in such a way that it's not stretched but covers the whole area.

Example:

An empty template image can be found here (1864 x 1228 pixels).

There are currently four template files:

  • /.template.png (accessed by ImageProcessor::loadTemplateImage())
  • /.template_screen.png (accessed by ImageProcessor::updateTemplate() and BoothGui::reloadTemplate())
  • /.template_props.json (accessed by ImageProcessor::loadTemplateImage() and ImageProcessor::updateTemplate())
  • /.template_screen_props.json (accessed by ImageProcessor::updateTemplate() and BoothGui::reloadTemplate())

All 4 files will be created by the software as soon as a template is uploaded using the website. The two .png files are the images: /.template.png is the full resolution template, the template_screen.png is the template scaled down for the user interface. This allows faster rendering since we don't need to scale it later. The two _prop.json files contain the rectangle where the image needs to be inserted in pixel coordinates. Again there is a file for the final print file as well as for the low resolution screen preview.

Template properties JSON files

Covers both /.template_props.json and /.template_screen_props.json.

Expected properties: offset_x, offset_y, offset_w, offset_h

Web app

The self-o-mat software provides a configuration website via built-in web server. The web server uses port 9080, i.e. it can be accessed using the URL http://<IP>:9080 or http://localhost:9080 on the local machine.

The interface between the web server and the standalone photo booth application is Protocol Buffers (Protobuf) - a free and open-source cross-platform data format used to serialize structured data. The message definitions can be found in ap.proto.

Settings changes made via the web server applied to the standalone photo booth application are applied instantly since the web server directly calls C++ functions. All settings are stored on photo booth power off.

CUPS

CUPS (formerly an acronym for Common UNIX Printing System) is a modular printing system for Unix-like computer operating systems which allows a computer to act as a print server. It also provides a web interface. It can be accessed using the URL http://<IP>:631 or http://localhost:631 on the local machine.

Clone this wiki locally