How to Connect to Raspberry Pi using USB Hot-spot

This is first part in a series of posts about my current Raspberry Pi Project

Photo by Vishnu Mohanan on Unsplash

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 fdisk -l

If you are using Windows, then follow my tutorial here
OR
Use Raspberry Pi Imager

Setting up SSH server —

  1. After burning is complete, eject the SD card from PC and reconnect it, open BOOT partition.
  2. Open config.txt and add this line at the last — dtoverlay=dwc2
  3. Now open cmdline.txt and check for rootwait
    Add modules-load=dwc2,g_ether after that. Save and exit
  4. Also make a file named ssh
    sudo nano ssh
    save the file and exit
  5. Eject the SD card. And connect it to Pi’s SD card slot.
cmdline.txt

Now that you have done setting up SSH server you can try to connect to your Pi for the first time —

  1. Power on Raspberry Pi.
  2. Connect it to your Android Phone using USB cable.
  3. Go to Settings> Network & Internet > Hotspot Tethering> Turn ON USB Tethering.
    Your Pi is now connected to internet hotspot network.
    https://imgur.com/a/w5tbVYm
  4. 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.
  5. 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.
  6. Open Connectbot. Click on + button. Under username@hostname:port type your Pi’s username and IP address on Hotspot Manager app. Eg. —
    user@192.168.1.2
  7. 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.
  8. Type ifconfig, df -h, and similar commands to check it’s working.
Adding a host
Connecting to the host
Typing in password
Connected. Checking terminal commands

--

--

--

Hacking the Physical World | Senior Embedded Systems Engineer @ PiRhoAlpha Research (ActiveBuildings) | I write posts about AVR and Raspberry Pi.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Hit Me Baby One More Time — What Are Cache Hits and Why Should You Care?

Playnow Website Down

Playnow

How to Optimize Windows 10 Performance (Updated guide 2021)

Git: Basics read for beginners

What’s the Journey of a Single Line of Compiled Code Like?

Start method

Managing deep hierarchies with RDBMS

Cluster in Azure Databricks

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshul Goyal

Akshul Goyal

Hacking the Physical World | Senior Embedded Systems Engineer @ PiRhoAlpha Research (ActiveBuildings) | I write posts about AVR and Raspberry Pi.

More from Medium

Build a Package (Uboot) with Yocto SDK

Let’s install qBittorrent on Docker

Make a Clone of Customized Raspbian OS

Execute programs automatically on startup in Linux.