This is first part in a series of posts about my current Raspberry Pi Project
I have tested the following Steps on Ubuntu Mate and Raspberry OS. Though I think it can be applied to other OS as well.
These steps can be used when you do not have any screen for Pi to connect to, and it will provide a simple terminal interface to access it.
First things first, If you do not have an OS installed on a SD card, burn your SD card with your preferable OS. I am using Raspberry OS Lite (Headless). Download the image file, connect your SD card to your PC, and use this command if you are on Ubuntu.
dd if=~/path/to/raspberryos.img of=/dev/sdb status=progress Check the partition name using either
df -h or
Setting up SSH server —
- After burning is complete, eject the SD card from PC and reconnect it, open BOOT partition.
config.txtand add this line at the last —
- Now open
cmdline.txtand check for
modules-load=dwc2,g_etherafter that. Save and exit
- Also make a file named
sudo nano sshsave the file and exit
- Eject the SD card. And connect it to Pi’s SD card slot.
Now that you have done setting up SSH server you can try to connect to your Pi for the first time —
- Power on Raspberry Pi.
- Connect it to your Android Phone using USB cable.
- Go to Settings> Network & Internet > Hotspot Tethering> Turn ON USB Tethering.
Your Pi is now connected to internet hotspot network.
- To check the IP of this network, I used an App called “Hotspot Manager”, which can be easily available on Play Store.
After installing the app, The “Clients” tab will show the IP of connected devices.
- To connect to my Pi, I used another App called “ConnectBot”. It’s a lite app which can be used to ssh to devices using your Android phone itself.
- Open Connectbot. Click on + button. Under
username@hostname:porttype your Pi’s username and IP address on Hotspot Manager app. Eg. —
- Click on + button to Add the host. Click on this host to connect to Pi. Type in password when prompt. Default password is
raspberry. Now you are connected to Pi.
df -h, and similar commands to check it’s working.