Difference between revisions of "Template:OpenWrt1"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(updated by API)
 
(47 intermediate revisions by 4 users not shown)
Line 4: Line 4:
  
 
===System Login===
 
===System Login===
* Login via Serial Communication
+
* <strong>Login via Serial Port</strong>
Here is a hardware setup<br />
+
<!-- copy frome FriendlyCoreGeneral-zh.txt -->
Connect the following serial communication board to your board and power on the whole system from the serial board's DC or MicroUSB port:<br />
+
When you do kernel development you'd better get a serial communication board. After you connect your board to a serial communication board you will be able to do development work from a commandline utility.<br />
 +
{{#switch: {{{1}}}
 +
| NanoPi-NEO2 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-NEO2.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-NEO.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Plus2 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-NEO-Plus2.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Core =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-NEO-Core.jpg|frameless|400px]]<br>
 +
| NanoPi-M1 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-M1.jpg|frameless|400px]]<br>
 +
| NanoPi-M1-Plus =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 
[[File:PSU-ONECOM-NanoPi-M1-Plus.jpg|frameless|400px]]<br>
 
[[File:PSU-ONECOM-NanoPi-M1-Plus.jpg|frameless|400px]]<br>
 +
| NanoPi-A64 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-A64.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Air =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-AIR.jpg|frameless|400px]]<br>
 +
| NanoPi-R1 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-R1.jpg|frameless|500px]]<br>
 +
| NanoPi-R1S-H3 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-R1S.jpg|frameless|500px]]<br>
 +
| NanoPi-R1S-H5 =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-R1S.jpg|frameless|500px]]<br>
 +
| NanoPi-NEO2-Black =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:<br />
 +
[[File:PSU-ONECOM-NEO2-Black.jpg|frameless|500px]]<br>
 +
| NanoPi-Duo =
 +
| NanoPi-Duo2 =
 +
    <!-- Duox not support ONECOM -->
 +
| #default =
 +
Here is a hardware setup:<br>
 +
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:}}
  
By default you will login as root without a password. You can set your password by commanding "passwd".<br />
+
{{#switch: {{{1}}}
[[File:R1-login.jpg|frameless|500px|R1-login]]<br>
+
| NanoPC-T4 =
When your board loads OS for the first time the TF card's rootfs system in your board will be automatically partitioned to its max capacity:<br>
+
{{{1}}}you need to use a USB to serial board and here is a hardware setup:<br>[[File:T4usb2serialport.jpg|frameless|500px]]<br>
[[File:resize_rootfs.png|frameless|500px|resize_rootfs]]<br>
+
| NanoPi-M4 =
Be patient for this process to be done.
+
{{{1}}}you need to use a USB to serial board and here is a hardware setup:<br>[[File:m4usb2serialport.jpg|frameless|500px]]<br>
 +
| NanoPi-M4V2 =
 +
{{{1}}}you need to use a USB to serial board and here is a hardware setup:<br>[[File:m4usb2serialport.jpg|frameless|500px]]<br>
 +
| NanoPi-M4B =
 +
{{{1}}}you need to use a USB to serial board and here is a hardware setup:<br>[[File:m4usb2serialport.jpg|frameless|500px]]<br>
 +
| NanoPi-NEO4 =
 +
{{{1}}}you need to use a USB to serial board and here is a hardware setup:<br>[[File:neo4usb2serialport.jpg|frameless|500px]]<br>
 +
| NanoPi-NEO2 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-NEO2.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Core =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-NEO-Core.jpg|frameless|400px]]<br>
 +
| NanoPi-M1 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-M1.jpg|frameless|400px]]<br>
 +
| NanoPi-M1-Plus =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-M1-Plus.jpg|frameless|400px]]<br>
 +
| NanoPi-Duo =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-Duo.jpg|frameless|400px]]<br>
 +
| NanoPi-Duo2 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-Duo2.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Plus2 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:USB2UART-NEO-Plus2.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_nanopi_NEO.jpg|frameless|400px]]<br>
 +
| NanoPi-NEO-Air =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_NEO_Air.jpg|frameless|500px]]<br>
 +
| NanoPi-R1 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_nanopi_R1.jpg|frameless|500px]]<br>
 +
| NanoPi-R1S-H3 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_nanopi_R1S-H3.jpg|frameless|500px]]<br>
 +
| NanoPi-R1S-H5 =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_nanopi_R1S-H3.jpg|frameless|500px]]<br>
 +
| NanoPi-NEO2-Black =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power:<br>
 +
[[File:Matrix-USB2UART_nanopi_NEO2-Black.jpg|frameless|500px]]<br>
 +
| #default =
 +
or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power.
 +
}}
  
* Login via SSH
+
By default you will login as root without a password. You can use "passwd" to set a password for root.<br />
Make sure you connect your board to the internet and your board's eth0 is set to WAN and wlan0 is set to LAN.<br>
+
[[File:op_login.jpg|frameless|500px|op_login]]<br>
Before you proceed make sure you connect your board to a master router's LAN and your board can get an IP address via DHCP.<br>
+
On first boot the system will automatically extend the file system on the TF card to the max capacity:<br>
<!--
+
[[File:resize_rootfs_userdata.png|frameless|500px|resize_rootfs_userdata]]<br>
[[File:r1_lan_connected.png|frameless|500px|r1_lan_connected]]<br>
+
Please wait for this to be done.
-->
+
 
We assume the board's (eth0) IP address is 192.168.1.163. You can login via SSH by running the following command:
+
* <strong>Login via SSH</strong>
 +
{{#switch: {{{1}}}
 +
| NanoPi-R1
 +
| NanoPi-R1S-H3
 +
| NanoPi-R1S-H5
 +
| NanoPi-M1-Plus
 +
| NanoPi-M1
 +
| NanoPi-NEO
 +
| NanoPi-NEO-Core
 +
| NanoPi-K1-Plus
 +
| NanoPi-NEO-Core2
 +
| NanoPi-NEO-Plus2
 +
| NanoPi-NEO2
 +
| NanoPi-NEO2-Black =
 +
In FriendlyElec's OpenWrt system the Ethernet(eth0) is configured as WAN.<br>
 +
Before power on your board make sure your board is connected to a master router's LAN with an Ethernet cable and the eth0 will be assigned an IP address by DHCP.<br>
 +
For example, if your eth0 is assigned an IP address 192.168.1.163 you can login with SSH by running the following command:
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
$ ssh root@192.168.1.163
 
$ ssh root@192.168.1.163
 
</syntaxhighlight>
 
</syntaxhighlight>
By default you will login as root without a password.
+
You can login without a password.
 +
| NanoPi-NEO-Air
 +
| NanoPi-Duo2
 +
| NanoPi-Duo =
 +
By default in FriendlyElec's OpenWrt system the WiFi AP hotspot's name is like "OpenWrt-10:d0:7a:de:3d:92" and the network segment is 192.168.2.x. You can connect your device to it and login with SSH without a password by running the following command:
 +
<syntaxhighlight lang="text">
 +
$ ssh root@192.168.2.1
 +
</syntaxhighlight>
 +
You can login without a password.
 +
}}
  
* Login via Web
+
* <strong>Login via Web</strong>
 
+
You can login OpenWrt via a LuCI Web page.<br>
OpenWrt supports web login via the LuCI Web GUI. Configure your system following the steps in <Login via SSH>. In our test the board's IP address was 192.168.1.163. Type your IP address in a browser and you will be able to load the OpenWrt-LuCI page:<br>
+
{{#switch: {{{1}}}
 +
| NanoPi-R1
 +
| NanoPi-R1S-H3
 +
| NanoPi-R1S-H5
 +
| NanoPi-M1-Plus
 +
| NanoPi-M1
 +
| NanoPi-NEO
 +
| NanoPi-NEO-Core
 +
| NanoPi-K1-Plus
 +
| NanoPi-NEO-Core2
 +
| NanoPi-NEO-Plus2
 +
| NanoPi-NEO2
 +
| NanoPi-NEO2-Black =
 +
After you go through all the steps in <Login via SSH> and get an IP address e.g. 192.168.1.163 for the Ethernet connection, type this IP address in a browser's address bar and you will be able to login OpenWrt-LuCI:<br>
 
[[File:R1-OpenWrt-LuCI.jpg|frameless|600px|R1-OpenWrt-LuCI]]<br>
 
[[File:R1-OpenWrt-LuCI.jpg|frameless|600px|R1-OpenWrt-LuCI]]<br>
By default you will login as root without a password. After click on "Login" you will sign in.
+
| NanoPi-NEO-Air
 
+
| NanoPi-Duo2
===Connect to WiFi Hotspot from Smart Phone===
+
| NanoPi-Duo =  
* Make sure you install a WiFi antenna on your board.
+
After you go through all the steps in <Login via SSH> and get an IP address e.g. 192.168.2.1 for the Ethernet connection, type this IP address in a browser's address bar and you will be able to login OpenWrt-LuCI:<br>
* By default the board with OpenWrt is configured as a secondary router and its WiFi module AP6212 is set to AP mode. The default WiFi AP hotspot's name is like "OpenWrt-10:d0:7a:de:3d:92" and it doesn't have a password. You can connect a smart phone or PC to it.<br>
+
[[File:OpenWrt-LuCI_wlan0.jpg|frameless|600px|OpenWrt-LuCI_wlan0]]<br>
* The board's WiFi hotspot IP address falls into 192.168.2.x. Open a browser in your phone or PC, type 192.168.2.1 in the address bar and you will be able to visit the LuCI GUI:<br>
+
}}
[[File:phone_luci.png|frameless|300px|phone_luci]] <br>
+
By default you will login as root without a password, just click on "Login" to login.
* After your phone is successfully connected to the board's WiFi hotspot, load the LuCI page, go to "Netwrok ---> Wireless" and you will see all connected devices:<br>
+
[[File:openwrt_wifiap_connected.png|frameless|600px|openwrt_wifiap_connected]] <br>
+
  
 
===Manage Software Packages===
 
===Manage Software Packages===
Line 112: Line 250:
  
 
===Check System Status===
 
===Check System Status===
* Check CPU Temperature & Frequency:
+
* <strong>Check CPU Temperature & Frequency via Commandline</strong>
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
$ cpu_freq
+
$ cpu_freq  
CPU0 online=1 temp=26581 governor=ondemand cur_freq=480000
+
Aavailable frequency(KHz):
CPU1 online=1 temp=26581 governor=ondemand cur_freq=480000
+
        480000 624000 816000 1008000
CPU2 online=1 temp=26581 governor=ondemand cur_freq=480000
+
Current frequency(KHz):
CPU3 online=1 temp=26581 governor=ondemand cur_freq=480000
+
        CPU0 online=1 temp=26548C governor=ondemand freq=624000KHz
 +
        CPU1 online=1 temp=26548C governor=ondemand freq=624000KHz
 +
        CPU2 online=1 temp=26548C governor=ondemand freq=624000KHz
 +
        CPU3 online=1 temp=26548C governor=ondemand freq=624000KHz
 +
</syntaxhighlight>
 +
These messages mean that there are four CPU cores working online simultaneously. Each core's temperature is 26.5 degrees in Celsius, the scheduling policy is on-demand and the working frequency is 624MHz. You can set the frequency by running the following command:
 +
<syntaxhighlight lang="text">
 +
$ cpu_freq -s 1008000
 +
Aavailable frequency(KHz):
 +
        480000 624000 816000 1008000
 +
Current frequency(KHz):
 +
        CPU0 online=1 temp=36702C governor=userspace freq=1008000KHz
 +
        CPU1 online=1 temp=36702C governor=userspace freq=1008000KHz
 +
        CPU2 online=1 temp=36702C governor=userspace freq=1008000KHz
 +
        CPU3 online=1 temp=36702C governor=userspace freq=1008000KHz
 
</syntaxhighlight>
 
</syntaxhighlight>
 
These messages mean four CPU cores are working online. Each core's temperature is 26.5 degrees. Each core's governor is on demand and the frequency is 480 MHz.
 
These messages mean four CPU cores are working online. Each core's temperature is 26.5 degrees. Each core's governor is on demand and the frequency is 480 MHz.
  
* Check System Status on OpenWrt-LuCI Web Page:
+
* <strong>Check System Status on OpenWrt-LuCI Web Page</strong>
After you load the OpenWrt-LuCI page, click on "Statistics ---> Graphs" and you will be able to check all the statistics:<br>
+
After open the OpenWrt-LuCI page, go to "Statistics ---> Graphs" and you will see various system statistics e.g.:<br>
 
1) System Load:<br>
 
1) System Load:<br>
 
[[File:statistics_system_load.png|frameless|600px|statistics_system_load]] <br>
 
[[File:statistics_system_load.png|frameless|600px|statistics_system_load]] <br>
Line 130: Line 282:
 
3) CPU Temperature:<br>
 
3) CPU Temperature:<br>
 
[[File:statistics_thermal.png|frameless|600px|statistics_thermal]] <br>
 
[[File:statistics_thermal.png|frameless|600px|statistics_thermal]] <br>
"Statistics" is collected by the luci-app-statistics package. The luci-app-statistics package uses the Collectd utility to collect statistics and presents them using the RRDtool utility.<br>
+
All the statistics listed on the Statistics page are presented by the luci-app-statistics package which uses the Collectd utility to collect data and presents them with the RRDtool utility.<br>
If you want to get more statistics you can install various collectd-mod-* packages.  
+
If you want to get more statistics you can install other collectd-mod-* packages.
 
<!--
 
<!--
 
The statistics package uses Collectd to gather data and RRDtool to render diagram images.
 
The statistics package uses Collectd to gather data and RRDtool to render diagram images.
Line 144: Line 296:
  
 
===Check Network->Interfaces Configurations===
 
===Check Network->Interfaces Configurations===
* Login OpenWrt-LuCI, go to "Network ---> Interfaces" and you will see all the configurations: <br>
+
* After open the OpenWrt-LuCI page, go to "Network" ---> "Interfaces" and you will see the current network's configurations: <br>
[[File:R1_Interfaces.png|frameless|600px|R1_Interfaces]] <br>
+
{{#switch: {{{1}}}
The Gbps Ethernet eth0 is configured as WAN and wlan0 is configured as LAN.<br>
+
| NanoPi-R1
* You can set WAN or LAN by clicking on "WAN" or "LAN".<br>
+
| NanoPi-R1S-H3
[[File:R1_Interfaces_WAN.jpg|frameless|600px|R1_Interfaces_WAN]]  [[File:R1_Interfaces_LAN.jpg|frameless|600px|R1_Interfaces_LAN]]<br>
+
| NanoPi-R1S-H5
* All the configurations on the Network->Interfaces page will be saved in the "/etc/config/network" file.<br>
+
| NanoPi-M1-Plus
 +
| NanoPi-NEO-Plus2
 +
| NanoPi-Duo2
 +
| NanoPi-Duo
 +
| NanoPi-K1-Plus =
 +
[[File:op_interface_eth0_br.png|frameless|600px|op_interface_eth0_br]] <br>
 +
| NanoPi-M1
 +
| NanoPi-NEO
 +
| NanoPi-NEO-Core
 +
| NanoPi-NEO-Core2
 +
| NanoPi-NEO2
 +
| NanoPi-NEO2-Black =
 +
[[File:op_interface_eth0.png|frameless|600px|op_interface_eth0]] <br>
 +
| NanoPi-NEO-Air =
 +
  [[File:op_interface_br.png|frameless|600px|op_interface_br]] <br>
 +
}}
 +
* All the configurations listed on the Network->Interfaces page are stored in the "/etc/config/network" file.<br>
  
 +
{{#switch: {{{1}}}
 +
| NanoPi-R1
 +
| NanoPi-R1S-H3
 +
| NanoPi-R1S-H5
 +
| NanoPi-M1-Plus
 +
| NanoPi-NEO-Plus2
 +
| NanoPi-Duo2
 +
| NanoPi-Duo
 +
| NanoPi-NEO-Air =
 
===Check Netwrok->Wireless Configurations===
 
===Check Netwrok->Wireless Configurations===
* Login OpenWrt-LuCI, go to "Network ---> Wireless" and you will see all the WiFi hotspot configurations:<br>
+
* After open the OpenWrt-LuCI page, go to Network ---> Wireless and you will see the WiFi hotspot's configurations:<br>
[[File:R1-Wireless1.jpg|frameless|600px|R1-Wireless]]<br>
+
[[File:op_wireless.jpg|frameless|600px|op_wireless]]<br>
By default the WiFi AP's hotspot name is like "OpenWrt-10:d0:7a:de:3d:92" without a password. You can connect a smart phone to the WiFi hotspot.<br>
+
A default WiFi AP's hotspot name looks like "OpenWrt-10:d0:7a:de:3d:92". It doesn't have a password. You can connect your smart phone to it and browse the internet.<br>
* Click on "Edit", type a new name in Interface Configuration ---> General Setup ---> ESSID and click on Save & Apply.<br>
+
* All the configurations listed on the Network->Wireless page are stored in the "/etc/config/wireless" file.<br>
[[File:R1-Wireless-ESSID.jpg|frameless|600px|R1-Wireless-ESSID]]<br>
+
}}
* You can set a new encryption in Interface Configuration ---> Wireless Security, a new password in Key and click on Save & Apply.<br>
+
 
[[File:R1-Wireless-Key.jpg|frameless|600px|R1-Wireless-Key]]<br>
+
{{#switch: {{{1}}}
* You can see all the connected devices in Associated Stations on the Network ---> Wireless page.<br>
+
| NanoPi-R1
[[File:R1-Wireless-Associated_Stations.jpg|frameless|600px|R1-Wireless-Associated Stations]]<br>
+
| NanoPi-R1S-H3
* All the configurations on the Network->Wireless page will be saved in the /etc/config/wireless file.<br>
+
| NanoPi-R1S-H5 =
 +
===Check LED Configurations===
 +
* After open the OpenWrt-LuCI page, go to System ---> LED Configuration and you will see the LED's configurations: <br>
 +
[[File:R1_openwrt_led.png|frameless|600px|R1_openwrt_led]] <br>
 +
* By default the LED is configured as follows:
 +
LED1: heart-beat LED. If this LED doesn't blink it means the system is dead and it needs to be restarted.<br>
 +
LED2: status LED for Gbps Ethernet eth0 WAN. If WAN works this LED will be solid on otherwise it will be off. You can check the "Transmit" / "Receive" box to set the LED to blink when WAN transmits / receives data.<br>
 +
LED3: status LED for Fast Ethernet eth1 LAN. If LAN works this LED will be solid on otherwise it will be off. You can check the "Transmit" / "Receive" box to set the LED to blink when LAN transmits / receives data.<br>
 +
* Reference Links:
 +
** [https://openwrt.org/docs/guide-user/base-system/led_configuration openwrt led_configuration]
 +
}}
 +
 
 +
{{#switch: {{{1}}}
 +
| NanoPi-R1
 +
| NanoPi-R1S-H3
 +
| NanoPi-R1S-H5 =
 +
===Check BUTTON Configurations===
 +
FriendlyElec's OpenWrt system uses the triggerhappy utility to configure BUTTON's functions. By default when BUTTON is pressed a reboot will be triggered.
 +
If the system needs to be rebooted we suggest you use BUTTON to trigger a reboot. This prevents the file system from being damaged by accidental system shutdown.<br>
 +
The configurations for the triggerhappy utility are stored in the "/etc/triggerhappy/triggers.d/example.conf" file.
 +
 
 +
* Reference Links:
 +
** [https://openwrt.org/docs/guide-user/hardware/hardware.button openwrt hardware.button]
 +
}}
 +
 
 +
===USB WiFi===
 +
Currently the NanoPi NEO2 Black only works with a RTL8821CU USB WiFi dongle, plug and play. After this module is connected to the board it will by default work under AP mode and the hotspot's name is "rtl8821cu-mac address" and the password is "password";
 +
 
 +
===Huawei's WiFi 2 mini(E8372H-155) Module===
 +
After this module is connected to the board it will be plug and play. The hotspot's name is "HUAWEI-8DA5". You can connect a device to the internet by connecting to this hotspot.

Latest revision as of 06:35, 27 November 2019

1 Work with OpenWrt

1.1 Introduction

OpenWrt is a highly extensible GNU/Linux distribution for embedded devices.Unlike many other distributions for routers, OpenWrt is built from the ground up to be a full-featured, easily modifiable operating system for embedded devices. In practice, this means that you can have all the features you need with none of the bloat, powered by a modern Linux kernel. For more details you can refer to:OpenWrt Website.

1.2 System Login

  • Login via Serial Port

When you do kernel development you'd better get a serial communication board. After you connect your board to a serial communication board you will be able to do development work from a commandline utility.
Here is a hardware setup:
After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:

or you can use a USB to serial board and power on the whole system at the MicroUSB port with a 5V/2A power.

By default you will login as root without a password. You can use "passwd" to set a password for root.
op_login
On first boot the system will automatically extend the file system on the TF card to the max capacity:
resize_rootfs_userdata
Please wait for this to be done.

  • Login via SSH


  • Login via Web

You can login OpenWrt via a LuCI Web page.

By default you will login as root without a password, just click on "Login" to login.

1.3 Manage Software Packages

OpenWrt has a package management utility: opkg. You can get its details by running the following command:

$ opkg
Package Manipulation:
        update                  Update list of available packages
        upgrade <pkgs>          Upgrade packages
        install <pkgs>          Install package(s)
        configure <pkgs>        Configure unpacked package(s)
        remove <pkgs|regexp>    Remove package(s)
        flag <flag> <pkgs>      Flag package(s)
         <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)
 
Informational Commands:
        list                    List available packages
        list-installed          List installed packages
        list-upgradable         List installed and upgradable packages
        list-changed-conffiles  List user modified configuration files
        files <pkg>             List files belonging to <pkg>
        search <file|regexp>    List package providing <file>
        find <regexp>           List packages whose name or description matches <regexp>
        info [pkg|regexp]       Display all info for <pkg>
        status [pkg|regexp]     Display all status for <pkg>
        download <pkg>          Download <pkg> to current directory
...

These are just part of the manual. Here are some popular opkg commands.

  • Update Package List

Before you install a package you'd better update the package list:

$ opkg update
  • Check Available Packages
$ opkg list

At the time of writing there are 3241 packages available.

  • Check Installed Packages:
$ opkg list-installed

At the time of writing 124 packages have been installed.

  • Install/Delete Packages:
$ opkg install <pkgs>
$ opkg remove <pkgs>
  • Check Files Contained in Installed Packages:
$ opkg files <pkg>
  • Install Chinese Language Package for LuCI
$ opkg install luci-i18n-base-zh-cn
  • Check Changed Files:
$ opkg list-changed-conffiles

1.4 Check System Status

  • Check CPU Temperature & Frequency via Commandline
$ cpu_freq 
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU1 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU2 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU3 online=1 temp=26548C governor=ondemand freq=624000KHz

These messages mean that there are four CPU cores working online simultaneously. Each core's temperature is 26.5 degrees in Celsius, the scheduling policy is on-demand and the working frequency is 624MHz. You can set the frequency by running the following command:

$ cpu_freq -s 1008000
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU1 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU2 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU3 online=1 temp=36702C governor=userspace freq=1008000KHz

These messages mean four CPU cores are working online. Each core's temperature is 26.5 degrees. Each core's governor is on demand and the frequency is 480 MHz.

  • Check System Status on OpenWrt-LuCI Web Page

After open the OpenWrt-LuCI page, go to "Statistics ---> Graphs" and you will see various system statistics e.g.:
1) System Load:
statistics_system_load
2) RAM:
statistics_memory
3) CPU Temperature:
statistics_thermal
All the statistics listed on the Statistics page are presented by the luci-app-statistics package which uses the Collectd utility to collect data and presents them with the RRDtool utility.
If you want to get more statistics you can install other collectd-mod-* packages. All collectd-mod-* packages use the same configuration file: /etc/config/luci_statistics.

1.5 Check Network->Interfaces Configurations

  • After open the OpenWrt-LuCI page, go to "Network" ---> "Interfaces" and you will see the current network's configurations:
  • All the configurations listed on the Network->Interfaces page are stored in the "/etc/config/network" file.




1.6 USB WiFi

Currently the NanoPi NEO2 Black only works with a RTL8821CU USB WiFi dongle, plug and play. After this module is connected to the board it will by default work under AP mode and the hotspot's name is "rtl8821cu-mac address" and the password is "password";

1.7 Huawei's WiFi 2 mini(E8372H-155) Module

After this module is connected to the board it will be plug and play. The hotspot's name is "HUAWEI-8DA5". You can connect a device to the internet by connecting to this hotspot.