Set up Raspberry Pi without human I/O devices


I was able to set up Raspberry Pi only with MacBook and Mobile WiFi. It was lucky that I have Wireless LAN Router that I used to use.

These are all devices.
  • Raspberry Pi 3 Model B+
  • MacBook Air
  • micro SD and SD connector
  • Mobile WiFi
  • Wireless LAN (no WAN connection!)

Step1. Write Raspbian Image on micro SD

Fortunetely I have MacBook and Mobile Wifi, it was easy to get raspbian OS image via internet. I got the image from official web site.
After download, I inserted an SD into my MacBook and checked its disk number.
diskutil list
The disk number that I just inserted will be shown on console.
If the SD has been already used as Raspberry Pi image disk, formatting will be required.
diskutil eraseDisk diskX
Then I got started to write OS image with the disk number.
diskutil unmountDisk /dev/diskX
sudo dd if=***.img of=/dev/rdiskX bs=1m
I created a blank file on boot directory in order to enable SSH on raspberry pi.
mount
echo '' >> /Volumes/boot/ssh

Step2 Enter Raspberry Pi console

I connected Raspberry Pi and Wireless LAN with physical cable and connected MacBook and Wireless LAN with WiFi. The arp command is available for obtaining a IP address of Raspberry Pi.
arp -a
Then I established SSH connection with the IP address.
ssh pi@xxx.xxx.xxx.xxx
The default password is raspberry.

Step3 Set up WiFi connection

First I made sure that the Raspberry Pi is successfully receiving wireless network.
sudo iwlist wlan0 scan | grep ESSID
Then I was set SSID and WPA password on wpa_supplicant.conf,
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
and added the following descriptions.
country=JP
network={
ssid=“”
psk=“”
}
The raspberry pi get started to catch WiFi, after reboot.
sudo reboot
IP address will be changed because network I/F is different from physical LAN.
ssh pi@yyy.yyy.yyy.yyy

Physical network might not be necessary if WiFi conficuration on wpa_supplicant.conf has been set up, when I constructed raspbian OS on the micro SD card.
Profile
I have technical job experience in enbedded software development and server side infrastructure/application engineering. I'm interested in programming and computer security.
Objective
To write down my technical knowledge in the place where I can access from anywhere. To share my program source code. To train my writing skill.
Link
  • LinkedIn (preparing)

  • Twitter

  • Facebook (preparing)

  • GitHub

  • StackOverFlow (preparing)

Archives