콘텐츠로 바로가기

now0930 일지

이런저런 생각

  • 홈
  • 비공개
  • 강좌
  • 잔여 작업 조회
  • 위치

우분투+LEGO NXT(Lejos)를 eclipse로 bluetooth로 연결하기

전에 우분투에 lejos가 깔린 lego nxt를 eclipse로 연결을 해서 파일 전송을 했었는데, 간만에 하니 시간이 좀 걸렸다. 이번에 정리한다..

먼저 ubuntu의 bluetooth 모듈을 상태를 알아야 된다..

>hcitool dev
Devices:
hci0 00:1A:7D:DA:71:02

 

다음에 hci0의 상태를 알아낸다.

>hciconfig hci0
hci0: Type: BR/EDR Bus: USB
BD Address: 00:1A:7D:DA:71:02 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:15110 acl:283 sco:0 events:1300 errors:0
TX bytes:41343 acl:1147 sco:0 commands:88 errors:0

 

나의 경우에는 bluetooth 동글이 usb로 연결되어 있다..

다음에 nxt의 블루투스 모듈의 주소를 알아낸다.

>hcitool scan
Scanning ...
00:16:53:12:7A:83 NXT

 

이를 바탕으로 /etc/bluetooth/rfcomm.conf 파일을 아래와 같이 수정한다.

>sudo cat /etc/bluetooth/rfcomm.conf
#
# RFCOMM configuration file.
#

rfcomm0 {
# Automatically bind the device at startup
bind no;

# Bluetooth address of the device
device 00:16:53:12:7A:83;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "LegoNXT";
}

 

 

다음에 아래의 명령어로 연결한다.

>sudo rfcomm connect /dev/rfcomm0 00:16:53:12:7A:83 1
Connected /dev/rfcomm0 to 00:16:53:12:7A:83 on channel 1
Press CTRL-C for hangup

CTRL-C로 연결을 끊어주고..eclipse로 연결하면 된다…

nxt로 연결이 되었는지, 아닌지는 아래 명령으로 확인이 가능하다.

>sudo l2ping 00:16:53:12:7A:83
Ping: 00:16:53:12:7A:83 from 00:1A:7D:DA:71:02 (data size 44) ...
4 bytes from 00:16:53:12:7A:83 id 0 time 26.82ms
4 bytes from 00:16:53:12:7A:83 id 1 time 64.92ms
4 bytes from 00:16:53:12:7A:83 id 2 time 24.87ms
4 bytes from 00:16:53:12:7A:83 id 3 time 73.89ms
4 bytes from 00:16:53:12:7A:83 id 4 time 34.89ms
4 bytes from 00:16:53:12:7A:83 id 5 time 25.89ms
4 bytes from 00:16:53:12:7A:83 id 6 time 76.82ms

 

eclipse로 아래와 같이 설정 후, 연결하면 된다.
eclipse%ec%84%a4%ec%a0%95%ed%99%94%eb%a9%b4

eclipse에서 에러를 뿜어내는데 bluecove 어쩌고 나온다..

 >sudo apt-get install libbluetooth-dev

 

이렇게 관련 프로그램을 설치하면 된다.

KDE의 경우, PIN 입력이 안되는데, bluez-simple-agent로 연결하면 된다.

bluez-simple-agent hci# xx:xx:xx:xx:xx:xx

출처는 인터넷…

이 글 공유하기:

  • Tweet
발행일 2016-10-02글쓴이 이대원
카테고리 LEGO 태그 LEGO, lejos, nxt

댓글 남기기응답 취소

이 사이트는 Akismet을 사용하여 스팸을 줄입니다. 댓글 데이터가 어떻게 처리되는지 알아보세요.

글 내비게이션

이전 글

오산 Air Power Day

다음 글

정해진 미래, 조영태

2025 6월
일 월 화 수 목 금 토
1234567
891011121314
15161718192021
22232425262728
2930  
5월    

최신 글

  • common mode, differential mode 2025-05-11
  • signal conditioner, 신호 처리기 2025-05-10
  • strain gage 2025-05-09
  • 칼만 필터 2025-05-01
  • positioner(I/P) 2025-04-26

카테고리

  • 산업계측제어기술사
  • 삶 자국
    • 책과 영화
    • 투자
  • 생활코딩
    • LEGO
    • ROS
    • tensorflow
  • 전기기사
  • 피아노 악보

메타

  • 로그인
  • 엔트리 피드
  • 댓글 피드
  • WordPress.org

페이지

  • 소개
  • 잔여 작업 조회
    • 작업 추가
    • 작업의 사진 조회
    • 작업 수정 페이지
  • 사진
    • GPS 입력된 사진
    • 사진 조회
  • 위치
    • 하기 휴가 방문지
    • 해외 출장

태그

android bash c docker driver FSM gps java kernel LEGO linux mysql network program opcua open62541 plc programmers python raspberry reinforcementLearning ros state space system program tensorflow transfer function 경제 미국 민수 삼국지 세계사 실기 에너지 역사 유전자 일본 임베디드 리눅스 전기기사 조선 중국 채윤 코딩 테스트 통계 한국사 한국어

팔로우하세요

  • Facebook
now0930 일지
WordPress로 제작.
 

댓글 로드중...