AI-MAKERS-KIT에 올라가는 이미지는 KT API LINK에서 받아서 쉽게 이용할 수 있다.

하지만 여기서는 라즈베리파이 홈페이지에서 Raspian OS를 다운받아서 라즈베리 파이 3B 보드에 설치 후, KT Library를 올려서 KT API LINK의 image와 동일한 상태를 구현하는게 목표이다.

우선 Raspberry(라즈베리) 홈페이지에서 OS를 다운로드 한다. 참고로, 오른쪽에 있는 공식 OS를 받을 것이다.

클릭을 하면 하기와 같이 3가지 종류의 OS를 볼수 있다.

첫번째 "Raspbian Buster with desktop an recommended software" 이미지는 모든 필요한 프로그램까지 다 수록을 한 Full package 버젼이라고 보면 되겠고, 두번째 "Raspbian Buster with desktop" 이미지는 첫번째 이미지에서 필요한 프로그램들을 뺀 경량 버젼이라고 보면 되겠으며, 마지막 "Raspbian Buster Lite"는 대화형 창으로 구동하는 최소 버젼의 image로 보면되겠다.

첫번째 또는 두번째를 받는 것을 추천하는데, 본인은 첫번째 이미지를 다운로드 했다. 하기는 일반적인 다운로드를 할 수 있는 페이지 링크이다.

https://www.raspberrypi.org/downloads/raspbian/

 

Download Raspbian for Raspberry Pi

Raspbian is the Foundation's official supported operating system. You can install it with NOOBS or download the image below.

www.raspberrypi.org

하지만, 우리는 ai-makers-kit-master\driver\AIMakersKit-DriverPackage 폴더 안에 있는 readme.txt 파일을 참고해서 그 파일에 언급된 버젼의 Respberry OS를 Download 한다.

readme.txt
 :
 :

#NOTICE
AI Makers Kit - audio driver add-on package
This package is tested on kernel of "RASPBIAN Stretch 2017-09-07 Version"
Please check RASPBIAN version before installation.

즉, Raspbian stretch 2017-09-07 version으로 다운 받아 사용할 필요가 있다.

다음 링크에서 해당 version을 Download 할 수 있다.

https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-09-08/

 

Index of /raspbian/images/raspbian-2017-09-08

 

downloads.raspberrypi.org

본인이 다운로드한 이미지는 2017-09-07-raspbian-stretch.zip 이다.

다운로드한 이미지는 SD card에 구우면 되는데, 이때 사용하는 Tool은 "balenaEtcher" 프로그램 또는 "Win32DiskImager"를 이용하면 되겠다. 굽는 방법은 이미지를 선택하고 Write를 클릭하여 진행하기만 하면 되므로 Skip 하도록 하겠다.

이미지를 SD card로 구운 다음 Raspberry 3B 보드에 넣은 후 부팅하기만 하면 끝.

다음과 같은 화면을 HDMI 케이블에 연결한 모니터를 통해 볼 수 있다.

자 여기까지는 쉽다면 쉬운데... 이제 KT Library를 설치할 차례다.... 난관이 예상이 되지만 해봐야지.

우선 하기 KT SDK를 공유한 링크에서 파일을 Download 받는다.

https://github.com/gigagenie/ai-makers-kit

 

gigagenie/ai-makers-kit

GiGA Genie AI Makers Kit for Raspberry Pi. Contribute to gigagenie/ai-makers-kit development by creating an account on GitHub.

github.com

여기에서 하기 붉은 네모의 버튼을 클릭하면 AI-MAKER-KIT에 대한 SDK를 다운 받을 수 있다.

본인은 Zip 형태로 압축해서 다운로드 받았는데, 이것을 압축 해제 하고 적당한 위치에 놓았다(/home/pi 경로에 ai-makers-kit-master).

Driver를 우선적으로 설치해야 하므로, ai-makers-kit-master 폴더 안에 Driver 폴더로 진입하여 README_md 파일을 더블 클릭해서 열어본다.

README.md 파일에 Driver를 설치하는 방법이 아래와 같이 잘 설명되어 있으며, CMD 창을 열어서 그대로 따라서 하면 된다.

AI Makers Kit을 이용하기 위해 필요한 드라이버 설치 가이드입니다.

1. 라즈비안 설치 후, 패키지를 적절한 폴더에 풀어줍니다. (ex, /home/pi/install)

	$ gzip -cd AIMakersKit-DriverPackage.tgz | tar xf -

2. 설치 전에 네트워크가 정상적인 지 확인합니다.

3. 패키지 내부에 쉘 스크립트에 실행 퍼미션이 없으면 추가합니다.

	$ chmod a+x aimk-install.sh after-install.sh

4. “aimk-install.sh”파일을 아래와 같이 실행합니다.

	$ ./aimk-install.sh

5. 인스톨이 완료까지 기다리면 재부팅 합니다..

6. 재부팅이 되면 “after-install.sh" 파일을 아래와 같이 실행합니다

	$ ./after-install.sh

실행 완료 후 재부팅이 되면 정상적으로 음성이 출력되는지 확인합니다.

$ sh /home/pi/.genie-kit/bin/CheckAudio.sh

1번을 다음과 같이 실행한다.

해당 폴더에 압축되어 있는 파일이 압축 해제 되어 있음을 확인할 수 있다.

2번의 네트워크와 관련된 부분은 본인의 경우 오른쪽 상단의 와이파이 아이콘을 클릭하여 와이파이를 잡아 주었다.

3번은 다음과 같이 실행을 했다.

우선 압축이 풀린 해당 페이지로 이동.

그 다음 3번에 해당되는 명령어를 실행한다.

4번 명령어를 실행.

pi@raspberrypi:~/ai-makers-kit-master/driver/AIMakersKit-DriverPackage $ ./aimk-install.sh

This script will install everything needed to use
aimakerkit i2s amplifier

--- Warning ---

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

Do you wish to continue? [y/N] y

Checking hardware requirements...

Adding Device Tree Entry to /boot/config.txt
dtparam=i2s=on
dtparam=i2c_arm=on
dtoverlay=i2s-mmap

Commenting out Blacklist entry in 
/etc/modprobe.d/raspi-blacklist.conf
blacklist snd_bcm2835

Disabling default sound driver
Package install
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB]  
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [220 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [45.0 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian stretch/contrib armhf Packages [56.9 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian stretch/non-free armhf Packages [95.5 kB]
Fetched 12.1 MB in 28s (419 kB/s)                        
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libasound2 libasound2-data
Suggested packages:
  libasound2-plugins libasound2-doc
The following NEW packages will be installed:
  libasound2-dev
The following packages will be upgraded:
  libasound2 libasound2-data
2 upgraded, 1 newly installed, 0 to remove and 411 not upgraded.
Need to get 877 kB of archives.
After this operation, 665 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian stretch/main armhf libasound2 armhf 1.1.3-5+rpt4 [441 kB]
Get:2 http://archive.raspberrypi.org/debian stretch/main armhf libasound2-data all 1.1.3-5+rpt4 [173 kB]
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf libasound2-dev armhf 1.1.3-5+rpt4 [262 kB]
Fetched 877 kB in 5s (163 kB/s)          
apt-listchanges: Reading changelogs...
(Reading database ... 122683 files and directories currently installed.)
Preparing to unpack .../libasound2_1.1.3-5+rpt4_armhf.deb ...
Unpacking libasound2:armhf (1.1.3-5+rpt4) over (1.1.3-5+rpi3) ...
Preparing to unpack .../libasound2-data_1.1.3-5+rpt4_all.deb ...
Unpacking libasound2-data (1.1.3-5+rpt4) over (1.1.3-5+rpi3) ...
Selecting previously unselected package libasound2-dev:armhf.
Preparing to unpack .../libasound2-dev_1.1.3-5+rpt4_armhf.deb ...
Unpacking libasound2-dev:armhf (1.1.3-5+rpt4) ...
Setting up libasound2-data (1.1.3-5+rpt4) ...
Setting up libasound2:armhf (1.1.3-5+rpt4) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up libasound2-dev:armhf (1.1.3-5+rpt4) ...

DRV and Script
aimk.sh
asoundrc
CheckAudio.sh
CheckWiFi.sh
KT-GenieKit-I2S.ko
LED_Init.py
MiC-CX20921-Init.py
sample_sound.wav
snd-soc-core.ko
snd-soc-simple-card.ko
snd-soc-simple-card-utils.ko
SPK-AD82011-Init.py
start.mp3

System install complete

After rebooting, after-install.sh should be executed!!
Please, execute after-install.sh on Package

Some changes made to your system require
your computer to reboot to take effect.

Would you like to reboot now? [y/N] 

 리부팅을 실시한다. 리부팅이 안되면 수동으로 실시해도 무방한듯.

부팅이 완료되면 작업하던 폴더로 이동을 한다. 본인의 경우는 "/ai-makers-kit-master/driver/AIMakersKit-DriverPackage/" 이다.

6번 명령어를 실행한다.

pi@raspberrypi:~/ai-makers-kit-master/driver/AIMakersKit-DriverPackage $ sudo ./after-install.sh
Update audio system, sound sample will be played!
Configuring sound output
mv: cannot stat '/home/pi/.asoundrc': No such file or directory
Playing WAVE '/home/pi/.genie-kit/bin/sample_sound.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Simple mixer control 'PCM',0
Simple mixer control 'PCM',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 204 [80%]
  Front Right: 204 [80%]

All done!

System will reboot again

grep: input file ‘/etc/xdg/lxsession/LXDE-pi/autostart’ is also the output

Some changes made to your system require
your computer to reboot to take effect.

Would you like to reboot now? [y/N] 

여기에서도 y를 눌러서 재부팅을 실시해준다.

여기까지가 Driver를 Install 하는 작업이었다.

 

- To be continue...

 

 

+ Recent posts