Tuesday, July 14, 2020

Raspberry Pi Zero W Initial Setup



Connection directly via USB-Serial Cable

learn_raspberry_pi_954-02.jpg

Red Wire - Pin4 - +5V
Black Wire - Pin 6 or Pin 14 - GND
White Wire - Pin 8 - TXD
Green Wire - Pin 10 - RXD



Power directly from the Serial cable



If you are going to power the Raspberry Pi from the dedicated power adapter, DO NOT attach the +5V red wire from the serial cable.

Connect via Serial to the Raspberry Pi

In Linux, using PuTTY:
Address: /dev/ttyUSB0
Speed: 115200
Default User: pi
Default Pass: raspberry

Launch Raspberry Pi Software Configuration Tool (raspi-config)

pi@<hostname>: ~$ sudo raspi-config

Enable Networking
Option 2 - Network Options > N1 - Hostname

Please enter a hostname

raspberry-pi-zero-w

Option 2 - Network Options > N2 - Wireless LAN

Please enter SSID

<Home-SSID>

Please enter passphrase.  Leave it empty if none.

<password>

Option 5 - Interfacing Options > P2 - SSH

Would you like the SSH server to be enabled?

Caution: Default and weak passwords are a security risk when SSH is enabled!

Yes

The SSH server is enabled

Ok

Option 5 - Interfacing Options > P6 - Serial

Would you like a login shell to be accessible over serial?

Yes

The serial login shell is enabled
The serial interface is enabled

Ok

Now serial and SSH are setup, the Pi Zero should be connected to the wireless network.  This can be verified by exiting the Raspberry Pi Configuration Tool and checking that the hostname is set correctly and getting the IP address of the Pi Zero.

pi@<hostname>: ~$ hostname
raspberry-pi-zero-w

pi@<hostname>: ~$ ifconfig
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.106  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::32bf:d1a1:aea0:9a27  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:ee:9b:66  txqueuelen 1000  (Ethernet)
        RX packets 136560  bytes 187809031 (179.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32810  bytes 3186932 (3.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Now, update the Raspberry Pi Software Configuration Tool

pi@<hostname>: ~$ sudo raspi-config

Option 8 - Update >

The software tool will update.

Next is to update the OS.

pi@<hostname>: ~$ sudo apt update

pi@<hostname>: ~$ sudo apt upgrade

The Raspberry Pi Zero W is not configured and setup for Serial and SSH access to enable further programming and tuning.