Skip to main content

System Configuration

1. Luckfox-config Configuration

  • Luckfox-config is a system configuration tool that comes with the official Core3566 image. To open the configuration tool, enter the following command in the terminal:

    sudo luckfox-config
  • Basic operations: Use the up and down keys on the keyboard to select menu items, press Enter to enter, use the left and right keys to select buttons such as OK, Select, and Cancel, and press Esc to cancel and return. Press the spacebar to select or deselect an option. Finally, select Finish to exit. There might be a reboot, and any changes will take effect after the system restarts.

1.1 Option List

  1. System Options
    • Password: Set or modify the login password.
    • Hostname: Modify the hostname of your device.
  2. Interface Options: In this submenu, you can enable/disable various interfaces such as SPI, I2C, UART, and PWM.
  3. Localisation Options
    • L1 Locale: Language and regional settings.
    • L2 Timezone: Set the timezone.
    • L3 WLAN Country: Set the country code.
  4. Update: It updates the local database that stores the list of available remote repositories before installing or upgrading packages.
  5. About luckfox-config: Information about the luckfox-config tool.

1.2 Language Setting

  1. Open the luckfox-config tool and select Localisation Options -> locale.

  2. Select zh_CN.UTF-8 and press the spacebar to check it, then press Enter to confirm.

  3. After setting it, reboot Core3566 for the changes to take effect,After a successful boot, the system will be in Chinese.:

    sudo reboot

1.3 Time Correction

  1. Open the luckfox-config tool and select Localisation Options -> Timezone.

  2. For example, if you are in China, select Asia -> Shanghai.

  1. After setting it, use the date command to check the date and time, the date and time should now be correctly set according to the chosen timezone.:

    linaro@linaro-alip:~$ date
    2023年 06月 12日 星期一 17:04:28 CST

2. Screen Rotation

2.1 Rotation

  1. Open the configuration file using the following command and change "normal" to "left" or "right". After restarting, the screen will rotate accordingly:

    sudo nano /etc/X11/xorg.conf.d/20-modesetting.conf

    ### Valid values for rotation are "normal", "left", "right"
    Section "Monitor"
    Identifier "Default Monitor"
    Option "Rotate" "normal"
    EndSection

2.1 Touchscreen Calibration

After rotating the display, the touchscreen might not be calibrated to match the new screen orientation. Therefore, adjustments need to be made to the touchscreen settings.

  1. Copy the file "40-libinput.conf" to the /etc/X11/xorg.conf.d/ directory:

    sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
  2. Edit the file:

    sudo nano /etc/X11/xorg.conf.d/40-libinput.conf 
  3. Find the section for the touchscreen and add the following lines inside it. Save the file after making the changes:

    Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"     #right
    Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1" #left

    ![](https://files.luckfox.com/wiki/Core3566/RK3566/Core3566-turn-touch.png)

3. Auto-Start Configuration

In this section, we'll use the example of auto-starting the "OLED_1in5_test.py" program, which has an absolute path of "/home/linaro/OLED_1in5/OLED_1in5_spi.py". Please adjust the file and path according to your specific requirements. (The "OLED_1in5_spi.py" program uses the SPI interface for external device connectivity.)

3.1 Desktop Auto-Start

  1. First, create a "startup.sh" file using the following command (Core3566 default directory is /home/linaro):

    sudo touch startup.sh
  2. Open the "startup.sh" script file and add the following content:

    #!/bin/sh
    sudo python3 OLED_1in5/OLED_1in5_spi.py
  3. Give executable permission to the "startup.sh" script file:

    sudo chmod 777 startup.sh
  4. Create an auto-start file:

    cd .config && mkdir autostart
    cd autostart && sudo nano start.desktop
  5. Add the following content:

    [Desktop Entry]
    Type=Application
    Exec=/home/linaro/startup.sh
  6. Reboot:

    sudo reboot

3.2 Adding Auto-Start in rc.local Script

  1. Open the /etc/rc.local script and add the following line before "exit 0":

    sudo python3 /home/linaro/OLED_1in5/OLED_1in5_spi.py &
  2. Reboot Core3566:

    sudo reboot

3.3 Auto-Start Configuration with System Manager

  1. Create a configuration file for the auto-start service in /etc/systemd/system/OLED_1in5_test.service and add the following content:

    [Unit]
    Description=start oled

    [Service]
    Type=simple
    Restart=always
    RestartSec=5
    ExecStart=/home/linaro/OLED_1in5/OLED_1in5_spi.py

    [Install]
    WantedBy=multi-user.target
  2. Enable a service to automatically start during system boot:

    sudo systemctl enable OLED_1in5_test.service
  3. Restart:

    sudo systemctl restart OLED_1in5_test.service
  4. Reboot Core3566:

    sudo reboot
  5. If you want to disable a service and prevent it from starting automatically during system boot:

    sudo systemctl disable OLED_1in5_test.service

4. Samba File Sharing

To transfer files between Windows and Core3566, you can use Samba to set up file sharing. This allows easy access to Core3566's file system from Windows' Network Neighborhood.

  1. Start by updating the sources with the following command:

    sudo apt-get update
  2. Install Samba by running the following command:

    sudo apt install samba samba-common-bin -y
  3. .After the installation is complete, modify the configuration file /etc/samba/smb.conf:

    sudo nano /etc/samba/smb.conf
    将 homes 下的 read only = yes 改成 read only = no
  4. Restart the Samba service:

    sudo /etc/init.d/samba-ad-dc restart
  5. Add the default user "linaro" to Samba by setting a password:

    sudo smbpasswd -a linaro
  6. Access Core3566 from Windows by entering the following in the Windows File Explorer address bar (replace the IP address with your actual IP address):

    \\192.168.15.102\linaro
  7. Enter the username "linaro" and the password you set earlier to access Core3566's directory.