Difference between revisions of "Getting Started with W2"

From Banana Pi Wiki
Jump to: navigation, search
(Prepare)
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
=Introduction=
 
=Introduction=
[[File:Banana Pi BPI-W2 1.JPG|thumb|Overview [[Banana Pi BPI-W2]] with Realtek RTD1296]]
+
[[File:Banana Pi BPI-W2 1.JPG|thumb|Overview [[Banana Pi BPI-W2]]]]
 
[[File:Android_6.0_1.jpg|thumb|Overview: BPI-W2 Android 6.0]]
 
[[File:Android_6.0_1.jpg|thumb|Overview: BPI-W2 Android 6.0]]
 
[[File:W2_debian.jpg|thumb|[http://forum.banana-pi.org/t/banana-pi-bpi-w2-new-image-debian-9-linux-image-release-2018-09-18/6797 Debian 9 Linux Image Release 2018-09-18]]]
 
[[File:W2_debian.jpg|thumb|[http://forum.banana-pi.org/t/banana-pi-bpi-w2-new-image-debian-9-linux-image-release-2018-09-18/6797 Debian 9 Linux Image Release 2018-09-18]]]
Line 15: Line 15:
  
 
==Basic Development==
 
==Basic Development==
===Prepare to develop===
+
===Prepare===
 
* Prepare 8G/above TF card, USB-Serial interface, PC with Ubuntu System
 
* Prepare 8G/above TF card, USB-Serial interface, PC with Ubuntu System
 
* Using your USB-Serial Connect debug console on W2
 
* Using your USB-Serial Connect debug console on W2
 
+
:Note: '''Debug Uart 3.3v TTL,Baud: 115200'''.
 +
* Default IP address for LAN port: '''192.168.1.1'''
 +
* User name/password: '''pi/bananapi''' ,'''root/bananapi'''.
 +
:Or the user is '''root without a password'''.
 +
* WIFI: '''Operwrt'''
 +
 
 
[[Image:Debug_console_wire.png]]
 
[[Image:Debug_console_wire.png]]
  
 
[[Image:W2_debug_console.jpg]]
 
[[Image:W2_debug_console.jpg]]
  
===Install Linux Image On W2===
+
===Install Linux Image to SD card===
====Install Image On SD Card On Windows====
+
Download the [http://wiki.banana-pi.org/Banana_Pi_BPI-W2#Image_Release latest Linux Images]
*Board SW4 switch to 1
+
 
*English:
+
'''Note: Board SW4 switch to 1 for sd boot'''
  1.Format SD card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#Format_your_SD_under_Windows_os
+
 
 +
 
 +
'''Install Image to SD Card with Etcher on Windows, Linux and MacOS'''
 +
 
 +
[https://balena.io/etcher Balena Etcher] is an opensource GUI flash tool by Balena, Flash OS images to SDcard or USB drive.
 +
 
 +
:1.Click on "Flash from file" to select image.
 +
 
 +
:2.Click on "Select target" to select USB device.
 +
 
 +
:3.Click on "Flash!" Start burning.
 +
 
 +
:[[File:etcher.jpg]]
 +
 
 +
 
 +
'''Install Image to SD Card On Linux PC with bpi-tools'''
 +
:1.Install bpi-tools on your linux. If you can't access this URL or any other problems, please go to [https://github.com/BPI-SINOVOIP/bpi-tools bpi-tools repo] and install this tools manually.
 +
    $ apt-get install pv
 +
    $ curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 +
 
 +
:2.After you download the image, insert your TF card into your Linux PC
 +
    $ bpi-copy xxx.img /dev/sdx
 +
 
 +
:3.After step 2, then you can insert your TF card into W2, and press power button setup W2.
 +
 
 +
 
 +
'''Install Image to SD Card with Win32 Disk Imager On Windows'''
 +
:[http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#Format_your_SD_under_Windows_os How to Format SD card on Windows]
 +
:[http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#how_to_write_Linux_image How to Install Image On SD Card with Win32 Disk Imager]
 +
 
 +
 
 +
===Install Linux Image to EMMC===
 +
 
 +
:1.Prepare a SDcard with Linux image flashed and bootup board with this SDcard.
 +
:2.Unzip the image and copy it to a USB drive, plug the udisk to board and mount it.(If automatically mounted, ignore this step)
 +
    mount /dev/sdx /mnt
 +
:3.There are two ways to install the linux image to board.
  
  2.Install Image On SD Card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#how_to_write_Linux_image
+
:*Install with dd command.
 +
    sudo dd if=/mnt/xxx.bpi-w2-xxx.img of=/dev/mmcblk0 bs=10M status=noxfer
 +
:*Install the linux image in udisk with bpi-tools command
 +
    sudo bpi-copy xxx-bpi-w2-xxx.img.zip /dev/mmcblk0
 +
:4.After download complete, power off safely and eject the SDcard.
  
*Chinese:
+
===Install Android image===
  https://www.cnblogs.com/topbin/p/10882992.html
+
Download the latest [http://wiki.banana-pi.org/Banana_Pi_BPI-W2#Android Android image]
  
====Install Image On SD Card On Ubuntu====
+
Download [https://download.banana-pi.dev/d/3ebbfa04265d4dddb81b/files/?p=%2FTools%2Fimage_download_tools%2Fw2_android_usb_download_tool.zip BPI-W2 USB flash tool]
*Board SW4 switch to 1
 
  1.Install bpi-tools on your system
 
  * apt-get install pv
 
  * curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 
 
 
  2.After you download the image, insert your TF card into your Ubuntu
 
  * Execute "bpi-copy xxx.img /dev/sdx" to install image on your TF card.
 
 
 
  3.After step 2, then you can insert your TF card into W2, and press power button setup W2.
 
  
====Install Image On EMMC On Ubuntu====
+
Note:
  1.Prepare a sd which is installed ubuntu image, the Board SW4 switch to 1, let W2 boot from sd card.
 
  2.Copy emmc image to udisk then plug in W2, then mount udisk.
 
  3.After mount udisk, use command "bpi-copy xxx-emmc-xxx.img" to install image on Emmc.
 
  4.After success to install, power off W2, switch SW4 to 0, power on W2.
 
  
===Load Android image on W2===
+
:1. BPI-W2 USB flash tool is a usb download tool for flashing android image to board emmc, and only support Windows platform.
====Install On SD Card====
+
:2. Make sure SW4 switch to '0' for emmc boot.
* Link: http://forum.banana-pi.org/t/bananapi-bpi-w2-android7-sd-image-release-2019-03-07/8626
+
:3. Read w2_android_usb_download_tool/document/bananapi_w2_usb_download_tool_guide.doc before flashing image.
  
====Install On EMMC====
+
[https://download.banana-pi.dev/d/3ebbfa04265d4dddb81b/files/?p=%2FImages%2FBPI-W2%2Fdocs%2FBananapi-W2-Android-Custom-IR-Remote.pdf How to support your IR Remote]
  1.Format SD Card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#Format_your_SD_under_Windows_os
 
  
  2.
+
[https://download.banana-pi.dev/d/3ebbfa04265d4dddb81b/files/?p=%2FImages%2FBPI-W2%2Fdocs%2FBananapi-W2-Android-Custom-Bootlogo.pdf How to custom your Boot Logo]
=====Ubuntu=====
 
  1.Download this image:
 
 
 
  * Google: https://drive.google.com/open?id=1BkkLcuNryVgwIpcrpX50G9kpQEcsFiDp
 
  * Baidu: https://pan.baidu.com/s/1fPSu8TyylN9wRP300WNs6A PinCode:z0wx
 
 
 
  2.Prepare a sd card which installed image.
 
  3.Switch SW4 to 1, boot w2 from sd card.
 
  4.Execute commands "cd / ","bpi-copy android7xxx.img", then this android image will be installed on Emmc
 
  5.Switch Sw4 to 0, remove sd card, power on W2
 
  
 
==Advanced Development==
 
==Advanced Development==

Latest revision as of 01:12, 4 January 2024

Introduction

Overview: BPI-W2 Android 6.0

Read more: Banana Pi BPI-W2

Development

Let's get start to develop on BPI-W2, see amazing things happen.

Old page:Getting Started with BPI-W2

Basic Development

Prepare

  • Prepare 8G/above TF card, USB-Serial interface, PC with Ubuntu System
  • Using your USB-Serial Connect debug console on W2
Note: Debug Uart 3.3v TTL,Baud: 115200.
  • Default IP address for LAN port: 192.168.1.1
  • User name/password: pi/bananapi ,root/bananapi.
Or the user is root without a password.
  • WIFI: Operwrt

Debug console wire.png

W2 debug console.jpg

Install Linux Image to SD card

Download the latest Linux Images

Note: Board SW4 switch to 1 for sd boot


Install Image to SD Card with Etcher on Windows, Linux and MacOS

Balena Etcher is an opensource GUI flash tool by Balena, Flash OS images to SDcard or USB drive.

1.Click on "Flash from file" to select image.
2.Click on "Select target" to select USB device.
3.Click on "Flash!" Start burning.
Etcher.jpg


Install Image to SD Card On Linux PC with bpi-tools

1.Install bpi-tools on your linux. If you can't access this URL or any other problems, please go to bpi-tools repo and install this tools manually.
    $ apt-get install pv
    $ curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
2.After you download the image, insert your TF card into your Linux PC
    $ bpi-copy xxx.img /dev/sdx
3.After step 2, then you can insert your TF card into W2, and press power button setup W2.


Install Image to SD Card with Win32 Disk Imager On Windows

How to Format SD card on Windows
How to Install Image On SD Card with Win32 Disk Imager


Install Linux Image to EMMC

1.Prepare a SDcard with Linux image flashed and bootup board with this SDcard.
2.Unzip the image and copy it to a USB drive, plug the udisk to board and mount it.(If automatically mounted, ignore this step)
   mount /dev/sdx /mnt
3.There are two ways to install the linux image to board.
  • Install with dd command.
   sudo dd if=/mnt/xxx.bpi-w2-xxx.img of=/dev/mmcblk0 bs=10M status=noxfer
  • Install the linux image in udisk with bpi-tools command
   sudo bpi-copy xxx-bpi-w2-xxx.img.zip /dev/mmcblk0
4.After download complete, power off safely and eject the SDcard.

Install Android image

Download the latest Android image

Download BPI-W2 USB flash tool

Note:

1. BPI-W2 USB flash tool is a usb download tool for flashing android image to board emmc, and only support Windows platform.
2. Make sure SW4 switch to '0' for emmc boot.
3. Read w2_android_usb_download_tool/document/bananapi_w2_usb_download_tool_guide.doc before flashing image.

How to support your IR Remote

How to custom your Boot Logo

Advanced Development

GPIO

GPIO Control

PWM Control

SATA

1. Mount dev on W2

  • After insert sata interface, execute "fdisk -l"
  • Then "mount /dev/sdx /mnt/xxx"
 W2 Sata.jpg

2. If you meet some errors when you mount SATA, try these following commands:

  • "fdisk /dev/sdx" to create new partition , set your partition numbers and size, after created partitions, input "wq" to save and quit.
  • "mkfs.ext2 /dev/sdx" to format the SATA
  • "mount /dev/sdx /mnt/xxx"

SSD

1. After you success to insert SATA, we could input following commands to test SATA interface:

  • "time dd if=/dev/xxx of=/dev/null bs=1M count=1000" to test read speed
  • "time dd if=/dev/zero of=/dev/sdx bs=1M count=1000" to test write speed
 W2 ssd test.jpg

HDD

1. After you success to insert SATA, we could input following commands to test SATA interface:

  • "time dd if=/dev/xxx of=/dev/null bs=1M count=1000" to test read speed
  • "time dd if=/dev/zero of=/dev/sdx bs=1M count=1000" to test write speed
 W2 hdd test.jpg

NetWork

GMAC

  • iperf3 -c [server]

W2 iperf3 c.jpg

  • iperf3 -u -c [server]

W2 iperf3 u c.jpg

  • iperf3 -s

W2 iperf3 s.jpg

WiFi & BT

1.If you want to use WiFi or BT, you could use RTL8822BE module.

RTL8822BE.jpg

STA

1. Use commands to setup WiFi client

  • ip link set wlan0 up
  • iw dev wlan0 scan | grep SSID
  • vim /etc/wpa_supplicant/wpa_supplicant.conf
network={    
ssid="ssid"    
psk="password"    
priority=1 
}
  • wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
  • dhclient wlan0

2. Use UI interface to setup WiFi Client

RTL8822BE STA.jpg

AP

Developing

Develop 4G module with W2

GPU

  • Execute "glmark2-es" to start OpenGL test
  • glmark2 Score: 30

M3 GPU Test.png

Make your own image