Difference between pages "Getting Started with M2 Zero" and "Getting Started with W2"

From Banana Pi Wiki
(Difference between pages)
Jump to: navigation, search
(WiFi Client)
 
(Install On SD Card)
 
Line 1: Line 1:
[[zh:快速上手 香蕉派 BPI-M2 Zero]]
 
 
=Introduction=
 
=Introduction=
[[File:M2Zero_raspbian.png|thumb|Overview: BPI-M2Z raspbian]]
 
[[File:BPI-M2_zero_android_4.4.JPG|thumb|Android 4.4]]
 
[[File:BPI-M2_zero_ubuntu.JPG|thumb|Ubuntu Linux]]
 
  
*Read more about : [[Banana Pi BPI-ZERO]]
+
[[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_ubuntu.jpg|thumb|[http://forum.banana-pi.org/t/bananapi-w2-ubuntu-18-04-new-image-release-2018-09-17/6790 BananaPI-W2 Ubuntu 18.04 New Image Release 2018-09-17]]]
 +
[[File:W2_rasbian.jpg|thumb|[http://forum.banana-pi.org/t/banana-pi-bpi-w2-new-image-raspbian-9-4-new-image-release-2018-09-17/6824 BananaPI-W2 Raspbian 9.4 New Image Release 2018-09-17]]]
 +
[[File:Rpitc.jpg|thumb|[http://forum.banana-pi.org/t/bpi-w2-new-iamge-rpitcv3-1-12-demo-bpi-w2-beta-2018-09-03/6686 RPiTCv3_1.12-demo-bpi-w2-beta-2018-09-03]]]
  
==BPI-M2 Zero==
+
Read more: [[Banana Pi BPI-W2]]
  
Banana Pi M2 Zero is an ultra compact single board computer measures only 60mm*30mm. It uses quad-core Cortex A7 allwinner H2+ processor, with 512MB RAM memory. It's ideal for light-weight systems with some space-limited applications. Like other members of Banana Pi, it supports both linux and android operating system.
+
=Development=
 +
Let's get start to develop on BPI-W2, see amazing things happen.
  
===Key Features===
+
Old page:[[Getting Started with BPI-W2]]
* Quad Core ARM Cortex A7 CPU H2+
 
* 512MB SDRAM.
 
* WiFi (AP6212) & Bluetooth onboard.
 
* Mini HDMI.
 
  
=Development=
 
 
==Basic Development==
 
==Basic Development==
 
===Prepare to develop===
 
===Prepare to develop===
  * 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 M2 Zero
+
* Using your USB-Serial Connect debug console on W2
 
    
 
    
  [[Image:Debug_console_wire.png]]
+
[[Image:Debug_console_wire.png]]
 +
 
 +
[[Image:W2_debug_console.jpg]]
 +
 
 +
===Install Linux Image On W2===
 +
====Install On SD Card====
 +
=====Windows=====
 +
  *English:
 +
  1.Format SD card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#Format_your_SD_under_Windows_os
  
   [[Image:M2_Zero_debug_console.png]]
+
   2.Install Image On SD Card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#how_to_write_Linux_image
  
===Load your first image on M2 Zero===
+
   *Chinese:
   1.You could download latest image from our forum
+
   https://www.cnblogs.com/topbin/p/10882992.html
   * Here is the example: http://forum.banana-pi.org/t/bananapi-bpi-m2z-h2-new-image-raspbian-ubuntu-release-2018-07-09/6221
+
=====Ubuntu=====
 
+
   1.Install bpi-tools on your system
   2.Install bpi-tools on your system
 
 
   * apt-get install pv
 
   * apt-get install pv
 
   * curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 
   * curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 
    
 
    
   3.After you download the image, insert your TF card into your Ubuntu
+
   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.
 
   * Execute "bpi-copy xxx.img /dev/sdx" to install image on your TF card.
 
    
 
    
   4.After step 3, then you can insert your TF card into M2 Zero, and press power button setup M2 Zero
+
   3.After step 2, then you can insert your TF card into W2, and press power button setup W2.
  
===Update your image===
+
====Install On EMMC====
  1.Clone M2Z repo: https://github.com/BPI-SINOVOIP/BPI-M2Z-bsp
 
  * git clone https://github.com/BPI-SINOVOIP/BPI-M2Z-bsp
 
  
  2.Build your project
+
===Load Android image on W2===
  * ./build.sh BPI-M2Z-720P
+
====Install On SD Card====
  
  3.After finish built, Execute "cd SD", plug your Ubuntu TFcard in PC, then check your TFcard was recognised as /dev/sdX by Ubuntu.
+
====Install On EMMC====
 
  4. Execute "bpi-update -c bpi-m2z.conf -d /dev/sdX", to update the compiled kernel to your TFcard
 
  
 
==Advanced Development==
 
==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"
 +
  [[Image:W2_Sata.jpg]]
  
===How to create an image ===
+
2. If you meet some errors when you mount SATA, try these following commands:
* Prepare a SD card which have installed system(Ubuntu/Raspbian/..)
+
* "fdisk /dev/sdx" to create new partition , set your partition numbers and size, after created partitions, input "wq" to save and quit.
* Boot your SD card with M2 Zero, after M2 Zero finish starting, copy your files and config your system, then poweroff M2 Zero. [If you don't want to config your system, you can skip this step]
+
* "mkfs.ext2 /dev/sdx" to format the SATA
* Plug your SD card in PC(which is running Linux), "cd /media", then "ln -s <your account> pi"
+
* "mount /dev/sdx /mnt/xxx"
* Execute "bpi-migrate -c bpi-m2z.conf -c ubuntu-mate-from-sd.conf -d /dev/sdx"
 
* Then you could get your own image now
 
  
===OTG===
+
====SSD====
1. On M2 Zero console:
+
1. After you success to insert SATA, we could input following commands to test SATA interface:
* Execute "./adbd.sh", then execute "ps -ax | grep adbd" to see if adbd is set up
+
* "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
 +
  [[Image:W2_ssd_test.jpg]]
  
2. On PC terminal:
+
====HDD====
* If adbd was succeed to set up, insert OTG-USB interface to M2 Zero and PC(with Ubuntu system)
+
1. After you success to insert SATA, we could input following commands to test SATA interface:
* Execute "adb devices" to see if PC has recognised M2 ZeroP OTG
+
* "time dd if=/dev/xxx of=/dev/null bs=1M count=1000" to test read speed
* If yes, we could execute "adb shell" to connect M2 Zero by adb now
+
* "time dd if=/dev/zero of=/dev/sdx bs=1M count=1000" to test write speed
 +
  [[Image:W2_hdd_test.jpg]]
  
===USB Ethernet===
+
===NetWork===
* Prepare a USB to OTG wire, usb ethernet adapter
+
====GMAC====
 +
*iperf3 -c [server]
 +
[[Image:w2_iperf3_c.jpg]]
  
[[Image:M2Zero_usb_network_wire.png]]
+
*iperf3 -u -c [server]
 +
[[Image:w2_iperf3_u_c.jpg]]
  
* Use iperf3 to test network
+
*iperf3 -s
[[Image:M2Zero_network.png]]
+
[[Image:w2_iperf3_s.jpg]]
  
===Bluetooth===
+
====WiFi & BT====
* Use bluetoothctl tool to operate BT
+
1.If you want to use WiFi or BT, you could use RTL8822BE module.
* Execute "bluetoothctl"
 
* If you don't know how to use bluetoothctl, type "help", you will see more commands
 
* Execute these commands:
 
[[Image:M2Zero_bluetooth.png]]
 
  
===WiFi Client===
+
[[Image:RTL8822BE.jpg]]
'''You have two ways to setup WiFi Client'''
 
  
 +
=====STA=====
 
1. Use commands to setup WiFi client
 
1. Use commands to setup WiFi client
 
* ip link set wlan0 up
 
* ip link set wlan0 up
 
* iw dev wlan0 scan | grep SSID
 
* iw dev wlan0 scan | grep SSID
* vim /etc/wpasupplicant/wpa_supplicant.conf  
+
* vim /etc/wpa_supplicant/wpa_supplicant.conf  
 
  network={     
 
  network={     
 
  ssid="ssid"     
 
  ssid="ssid"     
Line 101: Line 113:
 
2. Use UI interface to setup WiFi Client
 
2. Use UI interface to setup WiFi Client
  
===Clear boot===
+
[[Image:RTL8822BE_STA.jpg]]
* git clone https://github.com/BPI-SINOVOIP/BPI-files/tree/master/SD/100MB
+
=====AP=====
* bpi-bootsel BPI-cleanboot-8k.img.gz /dev/sdX
+
Developing
 
 
===Camara function===
 
We use HDF5640 camara.
 
 
 
[[Image:ov5640_camara.png]]
 
====Guvcview====
 
* Use your UI interface to operate camara
 
* Applications -> Sound & Video -> guvcview
 
====Shell====
 
* We also have built-in command in /usr/local/bin to test camara
 
* "./test_ov5640_image_mode.sh" to test picture taking function
 
* "./cameratest.sh" to test video recording function
 
 
 
===Display===
 
====How to change display resolution====
 
For Example: we change M2Z HDMI display 1080P.
 
 
 
1. First, mount /dev/mmcblk0p1  /mnt, then enter to /mnt/bananapi/bpi-m2z/linux, find "sys_config.fex";
 
 
 
2. "vim sys_config.fex", change "screen0_output_mode = 5" to "screen0_output_mode = 10"
 
 
 
[[Image: display_output.png]]
 
 
 
3. After save changed, use "fex2bin" command to transfer sys_config.fex to bin file, "fex2bin sys_config.fex script.bin ", reboot.
 
 
 
parameters meaning:
 
 
 
[[Image: display_mode.png]]
 
 
 
===BPI-Tools===
 
====Install Bpi-tools====
 
* Execute "curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash - "
 
 
 
====Update Bpi-tools====
 
* Execute "bpi-tools"
 
[[Image: Bpi-tools.png]]
 
 
 
===RPi.GPIO===
 
====Install RPi.GPIO====
 
* Execute "git clone https://github.com/BPI-SINOVOIP/RPi.GPIO"
 
* after clone the repo, cd RPi,GPIO
 
* Execute "sudo apt-get update"
 
* Execute "sudo apt-get install python-dev python3-dev"
 
* Execute "sudo python setup.py install" or "sudo python3 setup.py install" to install the module
 
 
 
====Using RPi.GPIO====
 
* cd /usr/local/bin
 
* Execute "./bpi_test_g40.py" to test RPi.GPIO
 
 
 
[[Image: RPi_GPIO.png]]
 
  
===WiringPi===
+
===Develop 4G module with W2===
* GitHub: https://github.com/BPI-SINOVOIP/BPI-WiringPi2.git
 
* We also have built-in test command in "/usr/local/bin"
 
  
====How to Update WiringPi====
 
* Execute "bpi-update -c pkglist.conf"
 
[[Image: Update_Pkglist.png]]
 
  
* Execute "bpi-update -c bpi-pkg-bpi-wiringpi.conf"
 
[[Image: Update_WringPi.png]]
 
  
====RGB 1602 LCD====
 
* Execute "/usr/local/bin/bpi_test_lcd1602.sh"
 
  
====0.96 Inch OLED Display====
 
* Execute "/usr/local/bin/bpi_test_52pi.sh"
 
  
====8x8 RGB LED Martix====
+
===GPU===
* Firstly you need a GPIO Extend Board for 8x8 LED Martix
+
* Execute "glmark2-es" to start OpenGL test
[[Image: WringPi_LED_Martix_Extend_Board.png]]
+
* glmark2 Score: 30
 +
[[Image:M3_GPU_Test.png | 320px]]
  
* Execute "/usr/local/bin/bpi_test_gpio40.sh"
+
===Make your own image===

Revision as of 22:38, 23 May 2019

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 to develop

  • Prepare 8G/above TF card, USB-Serial interface, PC with Ubuntu System
  • Using your USB-Serial Connect debug console on W2

Debug console wire.png

W2 debug console.jpg

Install Linux Image On W2

Install On SD Card

Windows
 *English:
 1.Format SD card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#Format_your_SD_under_Windows_os
 2.Install Image On SD Card: http://wiki.banana-pi.org/Quick_Start_Banana_pi_SBC#how_to_write_Linux_image
 *Chinese:
 https://www.cnblogs.com/topbin/p/10882992.html
Ubuntu
 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 On EMMC

Load Android image on W2

Install On SD Card

Install On EMMC

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