socketBLACK

Respeaker Core는 MRAAUPM 을 이용해 GPIO와 Grove Socket을 컨트롤합니다. 하지만 아두이노 나노를 Servo Controller로 사용하고 TX-RX포트로 통신하여 제어하도록 하겠다.

System Diagram of Respeaker Core v2.0

SYS

Dependancies 설치

#Java
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-set-default
sudo apt-get install librxtx-java

#install numpy
pip install numpy

install ArduinoIDE

#설치
sudo apt-get install arduino

#실행
sudo arduino

serial 권한 설정

$ ls -l /dev/ttyACM*
/dev/ttyACM0

#<username> = linux username
sudo usermod -a -G dialout <username>

Connect Arduino Nano

  1. USB에 Arduino Nano 연결
  2. 포트 확인
$ sudo dmesg
...
[ 6866.439375] usb 1-11: ch341-uart converter now attached to ttyUSB0

Arduino Nano는 ttyUSB0에 연결됬습니다.

Configure Arduino Nano

Board = Arduino Nano
Processor = ATmega328T
Serial Port = /dev/ttyUSB0

직접 GPIO에 연결하는 방법?

  1. Update MRAA and UPM libraries to latest version
sudo apt install  python-mraa python-upm libmraa1 libupm1 mraa-tools
  1. Check your platform information
#only have bus 0 and id=03(/dev/i2c-3), 0 is the i2c number for mraa and upm
respeaker@v2:~$ mraa-i2c list
Bus   0: id=03 type=linux

#mraa gpio numbers and system gpio numbers and it's pinmux
respeaker@v2:~$ mraa-gpio list
00      GPIO91: GPIO
01         VCC:
02      GPIO43: GPIO
03     GPIO127: GPIO
04      GPIO17: GPIO
05      GPIO67: GPIO
06         GND:
07      GPIO13: GPIO
08    I2C2_SCL: I2C  
09    I2C2_SDA: I2C  
10         VCC:
11         GND:
12      GPIO66: GPIO

만약 라즈베리파이라면?

WiringPi2-python 라이브러리 설치하기

sudo apt-get install -y python-dev python-setuptools
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

#설치 테스트
gpio -v

output

gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Model A, Revision: 00, Memory: 256MB, Maker: Sony
  * Device tree is enabled.
  *--> RK3229 ReSpeaker Board V1.0
  * Root or sudo required for GPIO access.

RPi.GPIO 설치

참고 : sourceforge

sudo apt-get install python-dev python3-dev
sudo apt-get install mercurial
sudo apt-get install python-pip python3-pip
sudo apt-get remove python-rpi.gpio python3-rpi.gpio
sudo pip install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
sudo pip-3.2 install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO

Comments

Eungbean Lee's Picture

About Eungbean Lee

Lee is a Student, Programmer, Engineer, Designer and a DJ

Seoul, South Korea https://eungbean.github.io