User Manual Orange Pi Zero 3

  Features   |  Use   |    Linux     |  Linux SDK   |  Android   |  Android SRC   |

RU          EN  

Chapt 3. Instructions for use of Debian/Ubuntu Server and Xfce desktop system
Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122  


3.7.5. The method of setting the Linux system to automatically connect to the network for the first time

The development board has an Ethernet port. If you want to remotely log in to the Linux system of the development board through the Ethernet port, you only need to plug in a network cable that can access the Internet normally to the Ethernet port. Assign an IP address, and then we can obtain the IP address of the Ethernet port through the HDMI screen, serial port or view the background of the router, and then we can log in to the Linux system remotely.

The development board also has wireless WIFI. If you want to remotely log in to the Linux system of the development board through WIFI, you need to remotely log in to the Linux system through the IP address of the Ethernet port ssh and then connect to WIFI through commands, or through commands on the HDMI screen or serial port. Connect to WIFI. But if there is no HDMI screen and serial port module, although there is a network cable, the IP address of the development board cannot be checked through the background of the router.

Or there is no HDMI screen, serial port module and network cable, and only WIFI can be connected, then you can use the method introduced in this section to automatically connect to WIFI and also set the static IP address of WIFI or automatically set the static IP address of the Ethernet port.

To use the method in this section, you first need to prepare a Linux system machine. For example, a computer or a virtual machine with Ubuntu system installed. Why do you need a Linux system machine, because the root file system of the development board Linux system burned in the TF card is in ext4 format, and the Linux system machine can mount it normally, and then modify the configuration files in it.

If you want to modify it in the Windows system, you can use the software Paragon ExtFS for Windows. Since this software needs to be paid, and there is no similar free software that is easy to use, I will not demonstrate it here. In addition, if you have any problems with Paragon ExtFS for Windows software, please solve it yourself, we will not answer questions.

  • 1) First burn the Linux image of the development board you want to use into the TF card, and then use a card reader to insert the TF card that has burned the Linux image of the development board into a machine with a Linux system (such as a machine with an Ubuntu system installed) computer, the following uses Ubuntu computer as an example to demonstrate)

  • 2) When the TF card is inserted into the Ubuntu computer, the Ubuntu computer will generally automatically mount the partition of the Linux root file system in the TF card. You can know from the following command that /media/test/opi_root is the Linux root file in the TF card The path where the system is mounted.

    test@test:~$ df -h | grep "media"
    /dev/sdd1 1.4G 1.2G 167M 88% /media/test/opi_root
    test@test:~$ ls /media/test/opi_root
    bin
    boot dev etc home lib lost+found media
    mnt
    opt
    proc root run
    sbin
    selinux srv sys tmp usr var

  • 3) Then enter the /boot directory of the Linux system burned in the TF card

    test@test:~$ cd /media/test/opi_root/boot/ 

  • 4) Then copy the orangepi_first_run.txt.template to orangepi_first_run.txt. Through the orangepi_first_run.txt configuration file, you can set the Linux system on the development board to automatically connect to a WIFI hotspot when it starts for the first time, and you can also set the WIFI or Ethernet port static IP address

    test@test:/media/test/opi_root/boot$ sudo cp orangepi_first_run.txt.template \
    orangepi_first_run.txt

  • 5) You can open the orangepi_first_run.txt file with the following command, and then you can view and modify the contents

    test@test:/media/test/opi_root/boot$ sudo vim orangepi_first_run.txt

  • 6) Instructions for using variables in the orangepi_first_run.txt file

    a. FR_general_delete_this_file_after_completion variable is used to set whether to delete the orangepi_first_run.txt file after the first startup. The default is 1, that is, delete. If it is set to 0, orangepi_first_run.txt will be renamed to orangepi_first_run.txt after the first startup old, generally keep the default value

    b. FR_net_change_defaults variable is used to set whether to change the default network settings, this must be set to 1, otherwise all network settings will not take effect

    c. FR_net_ethernet_enabled variable is used to control whether to enable the configuration of the Ethernet port. If you need to set the static IP address of the Ethernet port, please set it to 1

    d. FR_net_wifi_enabled variable is used to control whether to enable WIFI configuration. If you need to set the development board to automatically connect to WIFI hotspots, you must set it to 1. In addition, please note that if this variable is set to 1, the setting of the Ethernet port will be will fail. That is to say, the WIFI and Ethernet ports cannot be set at the same time (why, because it is not necessary...)

    e. FR_net_wifi_ssid variable is used to set the name of the WIFI hotspot you want to connect to

    f. FR_net_wifi_key variable is used to set the password of the WIFI hotspot you want to connect to

    g. FR_net_use_static variable is used to set whether to set the static IP address of WIFI or Ethernet port

    h. FR_net_static_ip variable is used to set static IP address, please set according to your actual situation

    i. FR_net_static_gateway variable is used to set the gateway, please set it according to your actual situation

  • 7) The following demonstrates several specific setting examples:

    a. For example, ifyou want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, you can set it like this:

    a) Set FR_net_change_defaults to 1 b) Set FR_net_wifi_enabled to 1 c) Set FR_net_wifi_ssid to the name of the WIFI hotspot you want to connect to d) Set FR_net_wifi_key to the password of the WIFI hotspot you want to connect to

    b. For example, ifyou want the Linux system of the development board to automatically connect to the WIFI hotspot after the first startup, and set the IP address of the WIFI to a specific static IP address (so that when the Linux system is started, you can directly use the set static IP address to ssh remotely Log in to the development board without checking the IP address of the development board through the background of the router), you can set it like this:

    a) Set FR_net_change_defaults to 1 b) Set FR_net_wifi_enabled to 1

    c) Set FR_net_wifi_ssid to the name of the WIFI hotspot you want to connect to d) Set FR_net_wifi_key to the password of the WIFI hotspot you want to connect to e) Set FR_net_use_static to 1 f) Set FR_net_static_ip to the desired IP address g) Set FR_net_static_gateway to the corresponding gateway address

    c. For example, ifyou want to automatically set the IP address of the Ethernet port to the desired static IP address after the Linux system of the development board starts for the first time, you can set it like this:

    a) Set FR_net_change_defaults to 1 b) Set FR_net_ethernet_enabled to 1 c) Set FR_net_use_static to 1 d) Set FR_net_static_ip to the desired IP address e) Set FR_net_static_gateway to the corresponding gateway address

  • 8) After modifying the orangepi_first_run.txt file, you can exit the /boot directory of the development board Linux system in the TF card, uninstall the TF card, and then insert the TF card into the development board to start

  • 9) If you have not set a static IP address, you still need to check the IP address through the background of the router. If you have set a static IP address, you can ping the set static IP address on the computer. If you can ping, it means that the system has started normally, and The network has also been set correctly, and then you can use the set IP address ssh to remotely log in to the Linux system of the development board

    After the Linux system of the development board is started for the first time, orangepi_first_run.txt will be deleted or renamed to orangepi_first_run.txt.old. At this time, the orangepi_first_run.txt configuration file will be reset, and then the Linux system of the development board will be restarted, orangepi_first_run. The configuration in txt will not take effect again, because this configuration will only be effective when the Linux system is started for the first time after burning, please pay special attention to this point.


     <         > 


  • Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122