Difference between revisions of "Template:DebianJessieGeneral"

From FriendlyELEC WiKi
Jump to: navigation, search
(Created page with "==Working with Debian== ===Ethernet Connection=== * If the board is connected to a network via Ethernet before it is powered on, it will automatically obtain an IP after it is...")
 
(updated by API)
 
(9 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
For more details refer to:[[Use NetworkManager to configure network settings|NetworkManager]].<br />
 
For more details refer to:[[Use NetworkManager to configure network settings|NetworkManager]].<br />
  
===Setup Wi-Fi AP===
+
{{Linux-WiFi}}
Follow the steps below. Since our OS image by default already has the NetworkManager utility you will be prompted to uninstall it first:<br />
+
<syntaxhighlight lang="bash">
+
sudo turn-wifi-into-apmode yes
+
</syntaxhighlight>
+
After you uninstall the NetworkManager reboot your board.<br />
+
After your board is rebooted run the above commands again and you will be prompted to type in a WIFI's name and password. Type in your wanted name and password<br />
+
<br />
+
If this is successful you will be able to find and connect your board to a WIFI. Login to your board at 192.168.8.1:
+
<syntaxhighlight lang="bash">
+
ssh root@192.168.8.1
+
</syntaxhighlight>
+
Type in a password. In our system the password is "fa".<br />
+
<br />
+
To login smoothly via SSH we recommend you turning off WIFI's power save mode by running the following commands:
+
<syntaxhighlight lang="bash">
+
sudo iwconfig wlan0 power off
+
</syntaxhighlight>
+
You can check your WiFi's mode by running the following command:<br />
+
<syntaxhighlight lang="bash">
+
sudo cat /sys/module/bcmdhd/parameters/op_mode
+
</syntaxhighlight>
+
Number 2 means your WiFi is in AP mode. You can switch to the Station mode by running the following command:<br />
+
<syntaxhighlight lang="bash">
+
sudo turn-wifi-into-apmode no
+
</syntaxhighlight>
+
  
 +
{{#switch: {{{1}}}
 +
| NanoPi-M1-Plus = {{Allwinner-APmode}}<br>
 +
| NanoPi-NEO-Air = {{Allwinner-APmode}}<br>
 +
| NanoPi-NEO-Plus2 = {{Allwinner-APmode}}<br>
 +
| NanoPC-T2 = {{S5Pxx18-APmode}}<br>
 +
| SOM-4418 = {{S5Pxx18-APmode}}<br>
 +
| NanoPC-T3 = {{S5Pxx18-APmode}}<br>
 +
| NanoPC-T3-Plus = {{S5Pxx18-APmode}}<br>
 +
| NanoPi2 = {{S5Pxx18-APmode}}<br>
 +
| NanoPi_K2 = {{S5Pxx18-APmode}}<br>
 +
| NanoPi_M3 = {{S5Pxx18-APmode}}<br>
 +
}}
 +
<!--
 
===Bluetooth===
 
===Bluetooth===
 
Here are the steps to transfer a file from T2 to a mobile phone. Run the following command to search a surrounding Bluetooth device:<br />
 
Here are the steps to transfer a file from T2 to a mobile phone. Run the following command to search a surrounding Bluetooth device:<br />
Line 82: Line 70:
 
apt-get install bluetooth bluez obexftp openobex-apps python-gobject ussp-push
 
apt-get install bluetooth bluez obexftp openobex-apps python-gobject ussp-push
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
-->
 
===Install Debian Packages===
 
===Install Debian Packages===
 
We provide a Debian Jessie image. You can install Jessie's packages by commanding "apt-get". If this is your first installation you need to update the package list by running the following command
 
We provide a Debian Jessie image. You can install Jessie's packages by commanding "apt-get". If this is your first installation you need to update the package list by running the following command
Line 94: Line 82:
 
Note: you can change your download server by editting "/etc/apt/sources.list". You can get a complete server list from [http://www.debian.org/mirror/list]. You need to select the one with "armhf".
 
Note: you can change your download server by editting "/etc/apt/sources.list". You can get a complete server list from [http://www.debian.org/mirror/list]. You need to select the one with "armhf".
  
===Audio Output from HDMI or 3.5mm Jack under Debian===
+
{{SelectAudio}}
Our default Debian image doesn't support audio output. If you want to enable this function you need to install the alsa package.
+
* Make sure your Debian OS is our latest version and your board has access to the internet;
+
* Power up your board and run the following commands on your board's commandline utility to install the alsa package:
+
<syntaxhighlight lang="bash">
+
apt-get update
+
apt-get install libasound2
+
apt-get install alsa-base
+
apt-get install alsa-utils
+
</syntaxhighlight>
+
* After the installation is done copy a ".wav" audio file to your board, connect your board to a earphone or speaker and try playing this audio file(By default Debian's audio output is from the 3.5mm audio jack):
+
<syntaxhighlight lang="bash">
+
aplay music.wav
+
</syntaxhighlight>
+
* By default Debian's audio output is from the 3.5mm audio jack. If you want audio output from the HDMI you need to change the setting by editing the "/etc/asound.conf" file:
+
<syntaxhighlight lang="bash">
+
pcm.!default {
+
    type hw
+
    card 1
+
    device 0}
+
+
ctl.!default {
+
    type hw
+
    card 1}
+
</syntaxhighlight>
+
card 0 stands for the 3.5mm audio jack and card 1 stands for the HDMI audio. After you make your change reboot your board to make it effective.
+
 
+
  
 
===Login via VNC and SSH===
 
===Login via VNC and SSH===
Line 132: Line 94:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
The password is fa.
 
The password is fa.
 
===Test USB WiFi===
 
Our OS system has support for popular USB WiFi drivers. Many USB WiFi modules are plug and play with our system. Here is a list of models we tested;
 
::{| class="wikitable"
 
|-
 
|Number||Model     
 
|-
 
|1  ||  RTL8188CUS 802.11n WLAN Adapter   
 
|-
 
|2  ||  RT2070 Wireless Adapter   
 
|-
 
|3  ||  RT2870/RT3070 Wireless Adapter
 
|-
 
|4  ||  RTL8192CU Wireless Adapter
 
|-
 
|5  ||  mi WiFi mt7601
 
|}
 
* Check device list
 
<syntaxhighlight lang="bash">
 
$ nmcli dev
 
DEVICE  TYPE      STATE        CONNECTION       
 
eth0    ethernet  connected    Wired connection 1
 
wlan0  wifi      disconnected  --                                 
 
lo      loopback  unmanaged    --
 
</syntaxhighlight>
 
Note: if the status of a device is "unmanaged" it means that device cannot be accessed by NetworkManager. To make is accessed you need to clear the settings under "/etc/network/interfaces" and reboot your system.
 
 
* Start WiFi
 
<syntaxhighlight lang="bash">
 
$ nmcli r wifi on
 
</syntaxhighlight>
 
 
* Scan Surrounding WiFi Sources
 
<syntaxhighlight lang="bash">
 
$ nmcli dev wifi
 
</syntaxhighlight>
 
 
* Connect to a WiFi Source
 
<syntaxhighlight lang="bash">
 
$ nmcli dev wifi connect "SSID" password "PASSWORD"
 
</syntaxhighlight>
 
The "SSID" and "PASSWORD" need to be replaced with your actual SSID and password.<br />
 
If a connection succeeds it will be automatically setup on next system reboot.<br />
 
<br />
 
For more details about NetworkManager refer to this link:[[Use NetworkManager to configure network settings]]<br />
 
  
 
===Connect to USB Camera(FA-CAM202)===
 
===Connect to USB Camera(FA-CAM202)===

Latest revision as of 11:01, 4 September 2023

1 Working with Debian

1.1 Ethernet Connection

  • If the board is connected to a network via Ethernet before it is powered on, it will automatically obtain an IP after it is powered up.

1.2 Wireless Connection

Under Debian you can manage your network with NetworkManager.
After Debian boots click on the network icon on the bottom right of the task bar a NetworkManger menu will pop up and all the available networks will be listed. If there is an active wireless network you will see something similar to the following screenshot:
NetworkManagerIcon
You can click on a WiFI AP and connect your board to it.
For more details refer to:NetworkManager.

For either an SD WiFi or a USB WiFi you can connect it to your board in the same way. The APXX series WiFi chips are SD WiFi chips. By default FriendlyElec's system supports most popular USB WiFi modules. Here is a list of the USB WiFi modules we tested:

Index Model
1 RTL8188CUS/8188EU 802.11n WLAN Adapter
2 RT2070 Wireless Adapter
3 RT2870/RT3070 Wireless Adapter
4 RTL8192CU Wireless Adapter
5 mi WiFi mt7601
6 5G USB WiFi RTL8821CU
7 5G USB WiFi RTL8812AU

You can use the NetworkManager utility to manage network. You can run "nmcli" in the commandline utility to start it. Here are the commands to start a WiFi connection:

  • Change to root
$ su root
  • Check device list
$ nmcli dev

Note: if the status of a device is "unmanaged" it means that device cannot be accessed by NetworkManager. To make it accessed you need to clear the settings under "/etc/network/interfaces" and reboot your system.

  • Start WiFi
$ nmcli r wifi on
  • Scan Surrounding WiFi Sources
$ nmcli dev wifi
  • Connect to a WiFi Source
$ nmcli dev wifi connect "SSID" password "PASSWORD" ifname wlan0

The "SSID" and "PASSWORD" need to be replaced with your actual SSID and password.If you have multiple WiFi devices you need to specify the one you want to connect to a WiFi source with iface
If a connection succeeds it will be automatically setup on next system reboot.

For more details about NetworkManager refer to this link: Use NetworkManager to configure network settings

If your USB WiFi module doesn't work most likely your system doesn't have its driver. For a Debian system you can get a driver from Debian-WiFi and install it on your system. For a Ubuntu system you can install a driver by running the following commands:

$ apt-get install linux-firmware

In general all WiFi drivers are located at the "/lib/firmware" directory.


1.3 Install Debian Packages

We provide a Debian Jessie image. You can install Jessie's packages by commanding "apt-get". If this is your first installation you need to update the package list by running the following command

apt-get update

You can install your preferred packages. For example if you want to install an FTP server you can do this:

apt-get install vsftpd

Note: you can change your download server by editting "/etc/apt/sources.list". You can get a complete server list from [1]. You need to select the one with "armhf".

1.4 Set Audio Device

If your system has multiple audio devices such as HDMI-Audio, 3.5mm audio jack and I2S-Codec you can set system's default audio device by running the following commands.

  • After your board is booted run the following commands to install alsa packages:
$ apt-get update
$ apt-get install libasound2
$ apt-get install alsa-base
$ apt-get install alsa-utils
  • After installation is done you can list all the audio devices by running the following command. Here is a similar list you may see after you run the command:
$ aplay -l
card 0: HDMI
card 1: 3.5mm codec
card 2: I2S codec

"card 0" is HDMI-Audio, "card 1" is 3.5mm audio jack and "card 2" is I2S-Codec. You can set default audio device to HDMI-Audio by changing the "/etc/asound.conf" file as follows:

pcm.!default {
    type hw
    card 0
    device 0
}
 
ctl.!default {
    type hw
    card 0
}

If you change "card 0" to "card 1" the 3.5mm audio jack will be set to the default device.
Copy a .wav file to your board and test it by running the following command:

$ aplay /root/Music/test.wav

You will hear sounds from system's default audio device.
If you are using H3/H5/H2+ series board with mainline kernel, the easier way is using npi-config

1.5 Login via VNC and SSH

If your board is not connected to a display device you can login to your board from a mobile phone. You need to download and install a "VNC Viewer" from here on a mobile phone and login to the board via VNC at port 1. Its default password is "fa123456".
Here is a screenshot which shows how it looks like when users login to the board from an iPhone via VNC:
VNC to NanoPi2
In our case our board's IP address is 192.168.1.230. You can login via SSH by running the following commands:

$ ssh root@192.168.1.230

The password is fa.

1.6 Connect to USB Camera(FA-CAM202)

The FA-CAM202 is a 200M USB camera.
Refer to this link for more details on how to connect to a FA-CAM202: Connect NanoPi M1 to DVP Camera CAM500B
In Debian, click on "other"-->"xawtv" on the left bottom of the GUI and the USB Camera application will be started. After enter "welcome to xawtv!" click on "OK" to start exploring.

1.7 Use OpenCV to Access Camera

  • The full name of "OpenCV" is Open Source Computer Vision Library and it is a cross platform vision library.
  • Make sure your board is connected to the internet and an HDMI monitor, Boot Debian and login.
  • Install OpenCV libraries:
$ apt-get update
$ apt-get install libcv-dev libopencv-dev
  • Refer to the instructions in the previous sections to make sure the camera works
  • Compile and run a code sample(Official Code Sample in C++ provided by the OpenCV organization):
$ cd /home/fa/Documents/opencv-demo
$ make
$ ./demo