티스토리 뷰

OS/Banana Pi /BPI-Bit

BPI-M2 Berry

파란크리스마스 2017. 8. 28. 23:17
728x90

BPI-M2 Berry

출처 : BPI-M2+
【BPI-M2+】之mjpg-streamer测试和体验- Bananap讨论区- 烽火社区 ...
http://forum.banana-pi.org/c/Banana-pi-BPI-M2

SD 확장

SD 확장전 용량확인

$ df -l
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root        7155064 4430272   2344940  66% /
devtmpfs          380080       0    380080   0% /dev
tmpfs             511300     340    510960   1% /dev/shm
tmpfs             511300    7652    503648   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             511300       0    511300   0% /sys/fs/cgroup
tmpfs             102260      24    102236   1% /run/user/1000
/dev/mmcblk0p1    261868    6740    255128   3% /media/pi/BPI-BOOT

SD FDisk

pi@bpi-iot-ros-ai:~$ sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x540302a1

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      729088 15267839 14538752    7G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31116287, default 2048): 729088
Last sector, +sectors or +size{K,M,G,T,P} (729088-31116287, default 31116287): 

Created a new partition 2 of type 'Linux' and of size 14.5 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

pi@bpi-iot-ros-ai:~$ sudo shutdown -r now

SD 확장

$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3798400 (4k) blocks long.

SD 확장 확인

$ df -l
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root       14956880 4432300   9830596  32% /
devtmpfs          380080       0    380080   0% /dev
tmpfs             511300     204    511096   1% /dev/shm
tmpfs             511300    7664    503636   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             511300       0    511300   0% /sys/fs/cgroup
tmpfs             102260      24    102236   1% /run/user/1000
/dev/mmcblk0p1    261868    6740    255128   3% /media/pi/BPI-BOOT

GPIO사용 (BPI-WiringPi)

출처 : Supports BananaPi BPI -M1 / M1Plus / M2 / M2P / M3

기존 설치된 wiringpi 삭제

$ sudo apt-get remove wiringpi
$ sudo apt autoremove

wiringpi 설치

$ git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi2.git
$ cd BPI-WiringPi2/
$ chmod +x ./build
$ sudo ./build

GPIO 확인

$ gpio -v
gpio version: 2.44
Copyright (c) 2012-2017 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
 
Raspberry Pi Details:
  Type: Banana Pi M2 Ultra[R40], Revision: 01, Memory: 2048MB, Maker: BPI-Sinovoip 
  * Device tree is enabled.
  *--> sun8iw11p1
  * Root or sudo required for GPIO access.
$ gpio readall
 +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |  53 |   8 |   SDA.1 | ALT5 | 0 |  3 || 4  |   |      | 5v      |     |     |
 |  52 |   9 |   SCL.1 | ALT5 | 0 |  5 || 6  |   |      | 0v      |     |     |
 |  35 |   7 | GPIO. 7 | ALT3 | 0 |  7 || 8  | 0 | ALT4 | TxD     | 15  | 274 |
 |     |     |      0v |      |   |  9 || 10 | 0 | ALT4 | RxD     | 16  | 275 |
 | 276 |   0 | GPIO. 0 | ALT3 | 0 | 11 || 12 | 0 | ALT3 | GPIO. 1 | 1   | 273 |
 | 277 |   2 | GPIO. 2 | ALT3 | 0 | 13 || 14 |   |      | 0v      |     |     |
 | 249 |   3 | GPIO. 3 | ALT2 | 0 | 15 || 16 | 0 | ALT3 | GPIO. 4 | 4   | 272 |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | ALT2 | GPIO. 5 | 5   | 250 |
 |  64 |  12 |    MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |  65 |  13 |    MISO | ALT4 | 0 | 21 || 22 | 0 | ALT2 | GPIO. 6 | 6   | 251 |
 |  66 |  14 |    SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0     | 10  | 87  |
 |     |     |      0v |      |   | 25 || 26 | 0 | ALT2 | CE1     | 11  | 248 |
 | 257 |  30 |   SDA.0 | ALT3 | 0 | 27 || 28 | 0 | ALT3 | SCL.0   | 31  | 256 |
 | 224 |  21 | GPIO.21 | ALT4 | 0 | 29 || 30 |   |      | 0v      |     |     |
 | 225 |  22 | GPIO.22 | ALT4 | 0 | 31 || 32 | 0 | ALT3 | GPIO.26 | 26  | 116 |
 | 226 |  23 | GPIO.23 | ALT4 | 0 | 33 || 34 |   |      | 0v      |     |     |
 | 227 |  24 | GPIO.24 | ALT4 | 0 | 35 || 36 | 0 | ALT4 | GPIO.27 | 27  | 231 |
 | 228 |  25 | GPIO.25 | ALT4 | 0 | 37 || 38 | 0 | ALT4 | GPIO.28 | 28  | 230 |
 |     |     |      0v |      |   | 39 || 40 | 0 | ALT4 | GPIO.29 | 29  | 229 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+

detect I2C chips

출처 : i2cdetect(8): detect I2C chips - Linux man page

$ ls /dev/*i2c*
/dev/i2c-0  /dev/i2c-1  /dev/i2c-2  /dev/i2c-4
$ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

pi4j

촐처 : Java I/O library for Raspberry Pi (GPIO, I2C, SPI, UART) http://www.pi4j.com
BUILDING AN EXECUTABLE PI4J JAR

$ sudo apt install maven
$ git clone https://github.com/Pi4J/pi4j.git
$ cd pi4j/pi4j-native
$ mvn package

pi4j pwm 오류

촐처 : How to: banana pi BPI-M3 install BPI-WiringPi - Linux - banana pi ...

PWM 관련 오류가 있어 수정해 보려고 했으나 포기

val pwmWrite 0 <= X <= 1024
Or you can set new range by yourself by pwmSetRange(range
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함