블로그 이미지
shadowchaser
이곳 저곳 이것 저것

calendar

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 31

Notice

'Internet of Things (IoT)'에 해당되는 글 1

  1. 2015.05.25 Raspberry PI로 BLE 개발하기 - 1편

우선 http://www.elinux.org/RPi_Bluetooth_LE 에서 참조했다.

 

가장 먼저 준비해야하는 사항은 Raspberry PI와 BLE 모듈이다.

 

특히 Raspberry 와 연결되는 BLE 모듈의 선택이 중요한데, CSR(회사이름)에서 만든 제품을 준비하는 것이 좋다고 한다.

CSR의 BLE모듈이 시장을 선점했나..

 

암튼, Raspberry PI에서 Bluez라고 하는 Bluetooth stack을 다운로드 받아주자.

 

중간에 rasbperry ssh가 계속 끊겨서 session keep alive 시간을 연장해주었다.

 

SSH server

With administrator / root access, the option could just be disabled in the server. Set the related options in the global SSHd configuration file as the following, and restart the SSHd service.

ClientAliveInterval 30
TCPKeepAlive yes 
ClientAliveCountMax 99999

In Linux, /etc/ssh/sshd_config normally is the configuration file and the service could usually be restarted by the following command;

sudo service sshd restart

- See more at: https://docs.oseems.com/general/application/ssh/disable-timeout#sthash.3h3oNIi2.dpuf 

 

참고하시고, 가던길 계속 가도록 하자..

 

Raspberry에서 bluetooth를 연계할 수 있도록 만들어주는 Bluez(http://www.bluez.org/)를 인스톨하자!!

현재 최신 버전은 5.3 버전이다.

 

크게 4단위로 구성된다.

1. 개발 Library를 다운로드 받자.

sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libical-dev libreadline-dev libudev-dev libusb-dev make

 

2. bluez 소스코드를 다운로드 받자.

mkdir -p BLE/bluepy
cd BLE/bluepy
wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.30.tar.xz
tar xvf bluez-5.30.tar.xz 

 

cd bluez-5.30
./configure --disable-systemd
make

 

 

 

4. 설치하자

sudo make install 

 

 

자 여기까지만 하면 일단 준비가 완료가 된 것이나 마찬가지다.

CSR에서 만든 BLE 모듈을 준비하는 것이 가장 중요하다는 거~~~!!!!

 

posted by shadowchaser
prev 1 next