# 2.1.1 라즈베리파이 준비하기

0\. 준비하기( 미리 설치가 되어 있는 이미지를 사용할 수 있다. ) 2.1.2 파트의 생략이 가능하다.

{% embed url="<https://1drv.ms/u/s!AoyrQFcgT77OsAvXpyeMGjhoifFu?e=78HbmT>" %}

0.1 라즈베리파이 사이트에서 라즈비안 다운받기

{% embed url="<https://downloads.raspberrypi.org/raspios_armhf_latest>" %}

0.2 자신의 운영체제에 맞는 이미지 라이터 다운 받기

* [Raspberry Pi Imager for Windows](https://downloads.raspberrypi.org/imager/imager.exe)
* [Raspberry Pi Imager for macOS](https://downloads.raspberrypi.org/imager/imager.dmg)
* [Raspberry Pi Imager for Ubuntu](https://downloads.raspberrypi.org/imager/imager_amd64.deb)

1. 와이파이에 연결하기

라즈베리파이의 이미지에서 "/etc/wpa\_supplicant/wpa\_supplicant.conf" 파일을 만들고, 아래와 같이 내용을 작성한다. 로컬 와이파이 네트워크 이름과 비밀번호를 적는다.

라즈베리파이4의 경우에는 루트에 작성하면 된다.

```
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="<your network name>"
    psk="<your password>"
}
```

2\. 네트워크 주소를 찾는다. 리눅스 시스템의 경우에 아래 명령어를 통해서  라즈베리파이의 주소를 알 수 있다. 다른 OS의 경우에는 공유기의  관리자 화면이나, nmap 등의 도움을 받아야 알 수 있다.

```
- 윈도우의 경우
ping -4 raspberrypi.local


- 리눅스의 경
ping d2.local

~~~~~~~~~~~~~~~~~~~
https://nmap.org/download.html#macosx
sudo apt-get install nmap

nmap -sn <자신의 컴퓨터 주소 대역대.0/24>
nmap -sn 192.168.35.0/24
```

3\. 루트에 "ssh" 파일명을 가진 의미없는 파일을 하나 작성하면, ssh 기능이 활성화 된다.

![](/files/-M2TBciqQsd-jCQCl4eO)

4\. 새로 부팅한 후에는 아래와 같은 명령어로 IP를 확인할 수 있다.

```
ifconfig wlan0
```

5\. 다음과 같은 명령어로 호스트 PC에서 라즈베리파이에 접속이 가능하다.

```
#option 1 ssh pi@d2.local
#option 2 ssh pi@<ipaddress> #replace <ipaddress>
```

6\. 터미널에서 아래와 같이 명령을 주면, VNC를 사용할 수 있다.

```
sudo systemctl start vncserver-x11-serviced.service

sudo systemctl enable vncserver-x11-serviced.service
```

7\. VNC를 활용하여 GUI화면을 볼 수 있다면, 라즈베리파이의 설정을 다음과 같이 변경해 준다.

```
sudo raspi-config

~~~~~~~~~~~~~~~~~~~~~~~~
enable Interfacing Options - I2C
enable Interfacing Options - Camera
enable Interfacing Options -  VNC
select Advanced Options - Expand Filesystem
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://robertchoi.gitbook.io/jetracer/2.1/2.1.1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
