Difference between revisions of "Getting Started with M2M"

From Banana Pi Wiki
Jump to: navigation, search
(WiFi Client)
(Update rootfs & kernal)
Line 45: Line 45:
  
 
===Update your image===
 
===Update your image===
====Update rootfs & kernal====
+
====Update rootfs & kernel====
 
After we succeed to the code, Bootloader, kernel, rootfs will be generated in "SD" directory, then how to update the image?
 
After we succeed to the code, Bootloader, kernel, rootfs will be generated in "SD" directory, then how to update the image?
  

Revision as of 00:16, 26 December 2018

Introduction

BPI-M2M

Overview: BPI-M2M ubuntu linux
  Banana Pi M2M is another ARM SoC powered development board that offers great computing performance in an ultra portable form factor. It is a 51mm square with Allwinner A33 Quad-core A7 SoC and 512MB DDR3 RAM. 

Key Features

  • Quad Core ARM Cortex A7 CPU. R16
  • 512MB DDR3 SDRAM
  • WiFi (AP6212) & Bluetooth onboard

Development

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 M2M
 
 M2M debug console.png  M2M pin define.png

Install Bpi tools

Load your first Linux image on SD card

  • Ex: my sd card is recognised as /dev/sdf
  • I can use "bpi-copy xxx.img /dev/sdf" to install image on my SD card.

Compile code

Error creating thumbnail: Unable to save thumbnail to destination

After download code, execute "./build.sh" to compile it.

  • ./build.sh
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

Update your image

Update rootfs & kernel

After we succeed to the code, Bootloader, kernel, rootfs will be generated in "SD" directory, then how to update the image?

  • cd SD/bpi-m2m
Error creating thumbnail: Unable to save thumbnail to destination

Plug in your SD card to Ubuntu PC, then execute "fdisk -l" to check which /dev/sdX were generated by system

Error creating thumbnail: Unable to save thumbnail to destination
  • bpi-update -c bpi-m2m.conf -d /dev/sde
Error creating thumbnail: Unable to save thumbnail to destination

Update boot

  • cd 100MB

Execute "df -l" to check which /dev/sdX is "BPI-BOOT"

  • df -l
Error creating thumbnail: Unable to save thumbnail to destination
  • bpi-bootsel BPI-M2M-LCD7-8k.img.gz /dev/sd1
Error creating thumbnail: Unable to save thumbnail to destination

Make your own image

Bluetooth

  • Use bluetoothctl tool to operate BT
  • Execute "bluetoothctl"
  • If you don't know how to use bluetoothctl, type "help", you will see more commands
  • Execute these commands:
Error creating thumbnail: Unable to save thumbnail to destination

WiFi Client

You have two ways to setup WiFi Client

1. Use commands to setup WiFi client

  • ip link set wlan0 up
  • iw dev wlan0 scan | grep SSID
  • vim /etc/wpasupplicant/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

NAS Application

1. Usb hub + sata to usb

  • HDD is supported
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
  • SSD is supported
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

Camara function

We use HDF5640 camara.

Error creating thumbnail: Unable to save thumbnail to destination

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

BPI-Tools

Install Bpi-tools

Update Bpi-tools

  • Execute "bpi-tools"
Error creating thumbnail: Unable to save thumbnail to destination

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
Error creating thumbnail: Unable to save thumbnail to destination

WiringPi

How to Update WiringPi

  • Execute "bpi-update -c pkglist.conf"
Error creating thumbnail: Unable to save thumbnail to destination
  • Execute "bpi-update -c bpi-pkg-bpi-wiringpi.conf"
Error creating thumbnail: Unable to save thumbnail to destination

RGB 1602 LCD

  • Execute "/usr/local/bin/bpi_test_lcd1602.sh"
Error creating thumbnail: Unable to save thumbnail to destination

0.96 Inch OLED Display

  • Execute "/usr/local/bin/bpi_test_52pi.sh"

8x8 RGB LED Martix

  • Firstly you need a GPIO Extend Board for 8x8 LED Martix
Error creating thumbnail: Unable to save thumbnail to destination
  • Execute "/usr/local/bin/bpi_test_gpio40.sh"
Error creating thumbnail: Unable to save thumbnail to destination