통신 보고서 #39
Vespoi
started this conversation in
Show and tell
통신 보고서
#39
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
서버와 라즈베리 파이는 데이터를 실시간으로 주고 받아야 하기에 소켓 통신으로 데이터를 주고받습니다.
서버에서는 라즈베리 파이로부터 영상 데이터를 받아오고 리모컨 동작 명령을 보내줍니다.
반대로 라즈베리 파이는 서버에 영상을 보내주고 리모컨 동작 명령을 받아옵니다.
소켓은 TCP를 사용 합니다.
소켓 종류는 TCP와 UDP가 있습니다.
TCP는 연결 지향 방식으로 양방향으로 바이트 스트림을 전송하며 높은 신뢰성을 보장합니다.
UDP는 비연결형 데이터그램 방식으로 정보를 주고 받을때 흐름 제어가 없어 신뢰성이 떨어집니다.
TCP는 UDP보다 실시간 통신을 할 때 속도가 느려지지만 데이터 크기의 제한이 없고 빠른 연결보단 학습 모델에 정확한 데이터를 전송하기 위해 TCP를 사용합니다.
서버
라즈베리 파이(클라이언트)에서 수신한 버퍼를 반환하는 함수입니다.
소켓 통신을 위해 서버를 생성 하는 함수입니다.
소켓 연결에 들어가는 IP주소와 포트 번호는 상수로 지정되어 사용합니다.
소켓 객체와 연결된 소켓의 주소를 반환합니다.
라즈베리 파이(클라이언트)로부터 영상 데이터를 받아옵니다.
받아온 데이터는 디코딩하여 frame이라는 변수에 저장하여 반환합니다.
라즈베리 파이(클라이언트)로 동작에 필요한 데이터를 전송 하는 함수입니다.
라즈베리 파이(클라이언트)
라즈베리 파이에서 서버로 연결하기 위한 함수입니다.
서버와 마찬가지로 IP와 포트 번호는 상수로 지정되어 있습니다.
서버에 연결된 소켓 객체를 반환합니다.
카메라 기본 설정을 하는 함수입니다.
연결된 카메라와 이미지 품질을 지정하는 파라미터를 반환합니다.
서버에 영상 데이터를 전송하는 함수입니다.
영상의 프레임을 jpg로 인코딩 후 string으로 변환하여 서버에 전송합니다.
서버로부터 데이터를 받아오는 함수입니다.
받아온 데이터를 디코딩하여 반환합니다.
Beta Was this translation helpful? Give feedback.
All reactions