#RaspberryPi – 1st setup without monitor: auto connect to WiFi, enable SSH, rename, update and more!

Buy Me A Coffee

Hi!

Ok, let’s assume you did the tutorial and installed the latest raspbian image in an SD card. If you want to access and control remotely your device you may want to follow this steps.

Configure Wireless connection

In the SD Card, you need to create a file named [wpa_supplicant.conf] in the root of the SD card with the following information:

country=ca
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid=" Your WiFi SSID"
 psk="You amazing password"
}

The file content is very straight forward to understand. Main values to complete are [ssid] and [psk].

Once you put the SD card in the device and start the device, it will automatically connect to the configured WiFi.

Enable SSH

If you also want to enable SSH, you need to create a blank file named [ssh] to the main partition.

Once you put the SD card in the device and start the device, it will automatically enable the SSH service.

Find the IP address in your network

And that’s it, your Raspberry Pi will be connected to the Wifi and with SSH enabled. At this moment we can use a tool like AngryIp (see references) to detect the new device in the network

My new device IP is: 192.168.1.246

Access via SSH

I used to like Putty to connect to my device, however during the past months I’ve been using Windows Terminal and Powershell. In order to access the device I need to execute the command

ssh user@deviceaddress

and my data is

  • user: pi
  • ip: 192.168.1.246
  • password: raspberry

You can now start working with your Raspberry Pi !

Change Password

The default password for the device is “raspberry”, and as usual, it’s recommended to change it. In order to do this, in the ssh terminal, let’s access to the device configuration

sudo raspi-config

This will open the configuration for the device.

Option number 1 will allow us to change the password.

Rename the device

In the same Raspberry configuration tool, we can rename the hostname that our device will use for network operations.

Select the options

  • Network Options
  • Hostname

And define the new name for the Raspberry Pi device.

Expand FileSystem

Another important option in the configuration is to expand the SD disk.In the same configuration screen, select

  • 7. Advanced Options
  • Expand File System

Now we need to reboot and after the reboot the file system should have been expanded to include all available space on your micro-SD card. Reboot with the command

sudo reboot

Update the device

Of course, at this moment you should change your default password and update everything with a command like this one

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'

Conclusion

And that’s it, we have our device updated and running with the latest software versions and we didn’t use a monitor! I’ll update this post frequently to make it relevant with my personal best practices.

Happy coding!

Greetings

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – How To automatically connect to WiFi, enable SSH on 1st boot, SSH connect and update!

Buy Me A Coffee

Hi!

If you been playing around with Raspberry Pi, I’m sure you already know this. For me this was a 1st timer, so I must write this down for the future myself.

When I started testing the Raspberry Pi 4, I got one of the complete kits, so I got the official red keyboard and mouse.

raspberry pi 4 official keyboard and mouse

I figure out I also need a couple of extra video cables. Now we need a [Micro HDMI to HDMI Cable] to connect one of the 2 video outputs to an external monitor.

This is the (cheap) monitor I’ve been using for a long time, however by default the RPi does works in a valid resolution for this monitor.

raspberry pi 7 inches monitor

And, the 2 main tasks you perform when you start your RPI are

  • Configure Wireless Connection
  • Enable SSH

Of course, you can do this directly in the SD with the Raspbian image (see references). And it’s also very easy to do.

You need to create a file named [wpa_supplicant.conf] in the root of the SD card with the following information:

country=ca
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid=" Your WiFi SSID"
 psk="You amazing password"
}

The file content is very straight forward to understand. Main values to complete are [ssid] and [psk]

Important: This only works the first time you boot the Raspberry Pi with the SD card. The SO search for [wpa_supplicant.conf] and performs the connection. If you already booted the device, you need to create a bootable SD card again.

If you also want to enable SSH, you need to create a blank file named [ssh] to the main partition.

And that’s it, your Raspberry Pi will be connected to the Wifi and with SSH enabled. At this moment we can use a tool like AngryIp (see references) to detect the new device in the network

My new device IP is: 10.184.1.231, so now I can use any SSH client (like Putty, see references) to connect to the device. As usual the default credentials are

  • user: pi
  • password: raspberry

You can now start working with your Raspberry Pi !

Of course, at this moment you should change your default password and update everything with a command like this one

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'

Happy coding!

Greetings @ Toronto

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – How To automatically connect to WiFi, enable SSH on 1st boot

Buy Me A Coffee

Hi!

If you been playing around with Raspberry Pi, I’m sure you already know this. For me this was a 1st timer, so I must write this down for the future myself.

When I started testing the Raspberry Pi 4, I got one of the complete kits, so I got the official red keyboard and mouse.

raspberry pi 4 official keyboard and mouse

I figure out I also need a couple of extra video cables. Now we need a [Micro HDMI to HDMI Cable] to connect one of the 2 video outputs to an external monitor.

This is the (cheap) monitor I’ve been using for a long time, however by default the RPi does works in a valid resolution for this monitor.

raspberry pi 7 inches monitor

And, the 2 main tasks you perform when you start your RPI are

  • Configure Wireless Connection
  • Enable SSH

Of course, you can do this directly in the SD with the Raspbian image (see references). And it’s also very easy to do.

You need to create a file named [wpa_supplicant.conf] in the root of the SD card with the following information:

country=ca
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid=" Your WiFi SSID"
 psk="You amazing password"
}

The file content is very straight forward to understand. Main values to complete are [ssid] and [psk]

Important: This only works the first time you boot the Raspberry Pi with the SD card. The SO search for [wpa_supplicant.conf] and performs the connection. If you already booted the device, you need to create a bootable SD card again.

If you also want to enable SSH, you need to create a blank file named [ssh] to the main partition.

And that’s it, your Raspberry Pi will be connected to the Wifi and with SSH enabled. At this moment we can use a tool like AngryIp (see references) to detect the new device in the network

My new device IP is: 10.184.1.231, so now I can use any SSH client (like Putty, see references) to connect to the device. As usual the default credentials are

  • user: pi
  • password: raspberry

You can now start working with your Raspberry Pi !

Of course, at this moment you should change your default password and update everything with a command like this one

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'

Happy coding!

Greetings @ Toronto

El Bruno

References