# User Guides

A collection of product specific user guides are to be found here.
For programming guides please refer to the [](sys_description) to find the appropriate documentation.
If you do not find a guide for the operating system try looking at the [Raspberry Pi OS Docs](https://www.raspberrypi.com/documentation/computers/os.html)

```{contents} Topics
:local:
:depth: 2
```
   
## Illumination Selection
This guide will explain how to enable/disable the epc670 ToF HAT+ 150° LED and the epc670 ToF HAT+ 80° LED:
1. Open a terminal
2. Check the current state:
    ```bash
    pinctrl get EN_LED_1,EN_LED_2
    ```
3. Select one line to copy:
    ```bash
    pinctrl EN_LED_1 op dh          # Enable 150° LED
    pinctrl EN_LED_2 op dh          # Enable 80° LED
    pinctrl EN_LED_1,EN_LED_2 op dh # Enable 150° and 80° LED
    pinctrl EN_LED_1 op dl          # Disable 150° LED
    pinctrl EN_LED_2 op dl          # Disable 80° LED
    pinctrl EN_LED_1,EN_LED_2 op dl # Disable 150° and 80° LED
    ```
4. Paste into terminal and execute by hitting 'Enter'
5. Close terminal
   
```{important} Any pinctrl change is not permanent and will be lost upon reboot.
```
## Remote connection
Requires:
- Internet Access (via built-in Wi-Fi or Ethernet)
  
It is also possible to connect remotely either through SSH or using [Raspberry Pi Connect](https://www.raspberrypi.com/software/connect/).

### Remote using Raspberry Pi Connect
Refer to the [Raspberry Pi Connect Documentation](https://www.raspberrypi.com/documentation/services/connect.html).

### Remote using SSH
Refer to the [Access a remote terminal with SSH](https://www.raspberrypi.com/documentation/computers/remote-access.html#ssh) from the official raspberry pi documentation.

(user_guides_update-packages)=
## Update Packages
Requires:
- Internet Access (via built-in Wi-Fi or Ethernet)

To get the latest version of the epc670 softwares run the command below from the terminal or execute epc670 SW Update desktop program.

```bash
epc-update
``` 

![GUI_Explained](_static/images/rpios-sw-update.drawio.png)

## HDMI Resolution Selection
This guide will explain how to set a different resolution than the automatically detected resolution.
```{note} The epc670 Starter Kit will automatically reduce the resolution to FullHD or lower to avoid performance drop. This occurs upon boot or when connecting a screen.
```
1. Open a terminal
2. Check available output and sizes
    ```bash
    wlr-randr
    ```
    The output will look similar to this:
    ```bash
        HDMI-A-1 "Dell Inc. DELL S2721DS DJ81VY3 (HDMI-A-1)"
        Make: Dell Inc.
        Model: DELL S2721DS
        Serial: DJ81VY3
        Physical size: 590x330 mm
        Enabled: yes
        Modes:
            2560x1440 px, 59.951000 Hz (preferred)
            1280x1024 px, 60.020000 Hz
            1152x864 px, 75.000000 Hz
            1280x720 px, 60.000000 Hz (current)
            1280x720 px, 59.939999 Hzz
            800x600 px, 75.000000 Hz
            640x480 px, 60.000000 Hz
            720x400 px, 70.082001 Hz
        Position: 0,0
        Transform: normal
        Scale: 1.000000
        Adaptive Sync: disabled
    ```
3. Set desired mode
    ```bash
    wlr-randr --output HDMI-A-<output_nr> --mode <width>x<height> # Replace output number (1 or 2), width and height with available mode listed above.
    ```
4. Close terminal

## GUI autostart disable
By default the GUI starts upon a boot.
1. Open a terminal
2. Run following command:
```bash
sudo rm -f /home/epc/.config/autostart/TOFcam670.desktop
```

To re-enable the autostart proceed as follows:
1. Open a terminal
3. Run following command:
```bash
echo "[Desktop Entry]
Version=1.0
Name=GUI-TOFcam-670
Comment=Autostart GUI-TOFcam670
Exec=lxterminal -e /usr/lib/epc670/tofcam670-startup.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true" | sudo tee /home/epc/.config/autostart/TOFcam670.desktop
```