Setup Raspberry Pi without ethernet cable

Views: 176
Wrote on April 12, 2020, 1:36 a.m.

Two of my Raspberry Pi related YouTube videos brought me a lot of private messages on Twitter, many of them asked if there is a way to setup Raspberry Pi without mouse, keyboard and cable connection. Fortunately, the answer is YES. It actually happened to me, and here is how I got it achieved:

Preparatiom

:sparkles: Download the latest official Raspberry Pi Desktop (for either PC or Mac) image file; Use Etcher or ApplePi-Baker on Mac or Linux / Rufus on PC to burn the image into the microSD card, Mac users can even use the disk utility that comes with the system for this step; Instead of putting the microSD card into your Raspberry Pi and boot it, you need a adopter to connext it to your computer USB port.

Set up WIFI connection

Since you do not have a cable connect to the internet, the only way to have your Pi hook up the internet is throught WIFI, however, you do not have keyboard and mouse neither, no way for you do do any operation on RPi directly.

Open the content of SD card on your computer

By doing this, it will allow you to ssh your RPi thru a remote machine.

  • Create a new blank file called "ssh" under root folder
  • Create another file called wpa_supplicant.conf under root as well, add content below it in:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="Your WIFI SSID"
    psk="Your WIFI Password"
}

Quit the SD card and insert it into your RPi, boot it, find out the internal IP thru your router admin, ssh connect it from your Mac or PC

ssh pi@id_address
# Default password: raspberry

:tada: Ta-da! Isn't it a magic? Now you'll be able to access your RPi remotely.

Magic behind the scene

The new version of the Raspberry Pi system has made a lot of efforts on Wifi connection, so that you can simply create a file called ssh on the SD card and it will be automatically recognized as the SSH service, the purpose of creating another file is to tell this ssh file what your Wifi ssid and password are, it will then automatically connect to the network. After the system starts, these two files will be deleted by the system. Repeat the process once you change the Wifi password.

Set up VNC

VNC, or Virtual Network Computing, is a system allowing remote control of one computer by another. When using VNC, two different parts of the software are used.

After successfully connecting your Pi thru ssh, a very handy tool called RealVNC can help you remotely connect to the Raspberry Pi desktop, you'll need to install RealVNC client in your computer, but before doing it, there is a very important thing you need to do first, to enable the VNC server on your Raspberry Pi. You just need to run the command

sudo raspi-config

select the line Interfacing Options, then line VNC, and enable VNC, then, you need to download the RealVNC from offical website.

You are now connected to the Raspberry Pi visually, and are able to control it with its interface from your computer! :rocket:



tongye

ok

2020-04-12 03:47 回复