I've set up the Raspberry Pi many times, but each time I've been searching for a setup method. Some people want to share information, so I'll try to summarize it myself.
I wrote SSH settings.
First, prepare what you need.
Download the required OS image from the following site. Original site
Many OSs are open to the public, but this time I will download Raspbian.
There are two types, DESKTOP and LITH, but they have the following features.
DESKTOP: A desktop environment is included as standard, for beginners LITH: Lightweight and server-friendly only in CUI environment
This time, select the DESKTOP version. Click the link below to start the download. RASPBIAN STRETCH WITH DESKTOP 2018-04-18
Unzip the downloaded image with the tool.
Install Win32 Disk Imager
Insert the microSD card into your PC
Launch the app and specify the OS image you downloaded earlier in Image File and the drive on which the SD card is mounted in Device.
Insert the SD card Insert the microSD card containing the OS image into the Raspberry Pi.
Connect the HDMI cable
Plug in the micro USB cable
4. Turn on the power If the green LED flashes, the Raspberry Pi is on. The red LED will illuminate when the Raspberry Pi is connected, regardless of whether it is powered on. 5. Check the display When you start Raspberry Pi, the following screen will be displayed. The startup is now complete.
Start the terminal and execute the command Click the black icon at the top left of the screen.
Enter the command in the terminal
$ sudo raspi-config
Enter the command and press the Enter key to open the screen below. Make various settings on this screen.
Select 7 Advanced Options. You can move the cursor with the arrow keys and select with Enter.
Select A1 Expand Filesystem.
This completes the partition expansion.
Select "4 Localization Options Set up ......". Select I1 Change Locale.
Add * with the Space key according to "ja_JP.UTF-8 UTF-8".
Use the Tab key to move to
Select "ja_JP.UTF-8".
This completes the Japanese localization. It will switch to Japanese by restarting, but restarting will be done after all the initial settings are completed.
2. Set the time zone to Japan
Select I2 Chage Timezone.
Select "Asia".
Select "Tokyo".
The time is now Japan time.
Select "Generic 105-key (Intel) PC".
When the US key setting appears, select "Other".
Select "Japanese".
Select "Japanese --Japanese (OADG 109A)".
Select The default for the keyboard layout.
Select No compose key.
Select "No".
This completes the keyboard settings.
Four. Wifi settings (country) Select I4 Change Wi-fi Country.
Select "JP Japan".
Select "OK".
Select P1 Camera.
Select
The camera module is now enabled. In addition, let's enable SSH, I2C, etc. as needed.
Select 2 Network Options.
Select "N2 Wi-fi".
Enter the SSID of the network you want to connect to.
Enter your password.
This completes the wifi settings.
Select "Finish".
If a reboot is requested, it will be rebooted.
This completes the initial settings. Thank you for your hard work. If you back up the OS image after this initial setting is completed, you can save the trouble of initial setting from the next time.
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Steps 1 and 2 should be done every time you start the Raspberry Pi.
This time I will use vi, but please use your favorite editor. It is easy to use "nano" for CUI base and "gedit" for GUI base. Python3 (IDLE) is included by default as an integrated development environment.
Installation is required when using editors such as vim and nano
$ sudo apt-get install vim
$ sudo apt-get install nano
Start a text editor and write the program.
$ vi hello.py
hello.py
print ("Hello World")
$ python3 hello.py
Hello World
$ vi hello.c
hello.c
#include <stdio.h>
int main(){
printf("Hello World\n");
return 0;
}
$ gcc -o hello hello.c
Four. Run
$ ./hello
Hello World
This completes the initial setup of Raspberry Pi and Hello World. How was it? The initial settings are difficult, but once you do it, it won't be long. We recommend that you keep a backup.
This time I only displayed Hello World, but you can also do L Chika in Python or C language. I will write about this later.
see you.
I wrote SSH settings.
Raspberry Pi head family site https://www.raspberrypi.org/
RaspberryPi setup (from writing to SSH setting) https://qiita.com/Halhira/items/1da2ae543217be26988a
How to update Raspberry Pi package http://my-web-site.iobb.net/~yuki/2017-07/raspberry-pi/update/
Recommended Posts