28

To keep myself entertained during the COVID-19 pandemic, I've bought a Raspberry Pi. I thought that it would be possible to program it from my laptop over SSH using an Ethernet connection, but I've just discovered that this requires me to know the IP address of the Raspberry Pi.

Without a keyboard/mouse to plug into it, I can't set up the Raspberry Pi's Wi-Fi and/or check its IP address (as far as I'm aware) using a monitor.

Without an SD card reader, I cannot follow a tutorial such as this for headless setup.

Can anyone think of a way around this?

The Raspberry Pi already has an SD card in it with the Raspbian operating system installed on it.

hlecuanda
  • 103
  • 4
John Smith
  • 417
  • 1
  • 4
  • 6

13 Answers13

30

Welcome to the world of Pi - you will get many hours of fun from them once you are up and running.

First check with your supplier to see if the version of the operating system they put on the card had ssh enabled - most suppliers do not do this though. If not:

  • Try ping raspberry.local - it may find it.
  • Check your router to see if you have a new device
  • Look at a ping program for your computer or 'phone / tablet - I use one called fing

Once you have the IP address you need to load and use PUTTY on a PC or ssh from the terminal of a Linux or Mac computer.

ssh pi@x.x.x.x

where x.x.x.x is the IP address of the Pi from above. Sorry I do not use PUTTY but plenty of guides on the internet :-)

If that does not work then unfortunately without a SD card reader/writer you are stuck as you do not have ssh enabled - as a bare minimum you need to be able to add a file call ssh to the /boot partition of the SD card then you can access it via ssh pi@raspberrypi.local from a Mac, Linux or an up to date Windows PC.

You can get low cost USB to SD card adapters - that will take a few more days of waiting though.

12

To find the IP address of your Raspberry Pi, you can try one of the following:

  • ping with common names (rpi, rpi4, rpi3, raspberry and raspberrypi)
  • look at your router administration console to list all devices on the LAN
  • use tools for LAN analysis (like Fing for Android)

If ssh is not enabled by default, if you don't own an SD reader nor a USB flash drive, nor a USB adapter for microSD cards, you will probably be stuck.

Danilo Schembri
  • 121
  • 1
  • 6
11

According to What are the possible OUIs for the Ethernet MAC address, there are exactly two OUIs used by Raspberry Pi devices as of April 2020.

This is confirmed by Raspberry Pi Foundation - MAC vendors list.

One solution would be to search your desktop system's ARP table with:

linux>    sudo arp -a | tr -d : | egrep "b827eb|dca632"

windows>  arp -a | findstr dc-a6-32
windows>  arp -a | findstr b8-27-eb

You might need to fill your ARP table with a command like fping (I am not sure if there's a Windows equivalent)

 linux>      sudo fping -a -g 10.99.99.0/24

You could also use Nmap to find all hosts on your LAN that listen for SSH:

 linux>      sudo nmap 10.99.99.0/24 -p 22

These would not be my first solutions - I'd check the DHCP logs in my firewall in the first instance.

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
Criggie
  • 360
  • 1
  • 3
  • 12
10

xkcd butterfly

Are you looking for a theoretical solution, or a practical one?

SD cards have SPI interface as well, so as long as you can provide a stable 3.3V for powering your card and a debounced clock signal, a few additional switches and wires could solve it. (maybe add an LED and a series resistor to MISO to have some feedback)

There's a video where an Atmel AVR chip is programmed by hand through SPI similarly. The SD card's protocol is different, and this is not practical nor recommended. But in theory it's possible to read/write anything.

Let's program an AVR manually

Nyos
  • 711
  • 5
  • 7
9

It is possible to access the Pi over serial terminal, but this requires a USB-serial dongle on the laptop.

It is far easier to buy a SD Card reader to enable ssh - these are available for < $5.

Once enabled you can ssh into the Pi over Ethernet using a Link-local address with the Pi's hostname (raspberrypi by default)
ssh pi@raspberrypi.local

This works using with most OS although other variants on raspberrypi may work on Windows.

Milliways
  • 62,573
  • 32
  • 113
  • 225
8

Contrary to popular belief, there is also a way of booting the Raspberry Pi without using an SD card at all! All of the previous answers recommended impractical ways, and the same applies to this method, though I hope you find it much more practical than what was previously suggested.

Method 1: Booting from a MSD (Mass Storage Device ie. USB Flash / Thumb Drive)

First of all, I'd like to point out that you can boot your Raspberry Pi via a USB. However, this only works if you're using any of the following models (OR if you have an SD Card Reader):

  • Pi 2B v1.2
  • Pi 3A+
  • Pi 3B
  • Pi 3B+

Unfortunately, if you do not have an SD Card Reader and your model is not one of the supported ones listed above, you cannot use this method.

If you have a SD Card and a SD Card Reader, then this guide is for you!

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

Method 2: Making the computer serve all the files to the Raspberry Pi

For this method, you will not even need an SD card to get your Pi up and running! You will just need to connect the DATA MicroUSB port on your Pi to your computer!

This method will only work for the following Raspberry Pi models:

  • Pi Compute Module
  • Pi Compute Module 3
  • Pi Zero
  • Pi Zero W
  • Pi A
  • Pi A+
  • Pi 3A+

See this official GitHub project if you're interested! https://github.com/raspberrypi/usbboot

Your computer will serve all the files needed for the Raspberry Pi to boot (make sure you read the "Running your own (not MSD) build" part in README.md; that is what you want to do).

idontknow
  • 181
  • 4
6

Newer raspberry PIs will boot from the USB port. You can install raspbian on the USB stick with the usual process. When it boots you plug in the SD card (don't do it before the boot or it'll try booting from the SD card) and write the data there.

5

If the Raspbian installation already has SSH enabled and you know the password, it is only a matter of finding the IP. However, the default installation has SSH disabled.

If you have a Raspberry Pi 3B+ and a USB drive, you can install ssh-enabled Rasbian on the USB drive and boot from that. Unfortunately the other Raspberry models do not boot from USB by default.

Alternatively, you might have a SD card writer you do not know about. For example many phones and digital cameras have SD card slots, and give access to that from PC when connected. To follow the tutorial you linked in your question, you only need to create two text files on the card.

jpa
  • 434
  • 2
  • 5
5

Rasbpian boots up with IPv6 enabled by default. Provided your laptop supports IPv6, too it solves all your problems:

First, broadcast ping your local network:

ping6 ff02::1%eno1

All the machines will answer. Log in via ssh (just try all adresses):

ssh pi@fe80::f000%eno1

eno1 refers to my laptop's ethernet device in this example.

Hermann
  • 151
  • 4
5

Yes, there is quite convenient method. Take a look at PiConfig - Raspberry Pi Network Configurator: https://www.kickstarter.com/projects/827010089/raspberry-pi-network-configurator-piconfig

https://www.geeky-gadgets.com/piconfig-raspberry-pi-network-configurator-23-03-2015/

This is a pendrive dedicated to set up a raspi. It was successfully funded at Kickstarter five years ago and it seems one can still buy it. PiConfig plugged into RPi

rha
  • 151
  • 1
3

From the constraints you mention (no USB keyboard available and no SD-Card reader to modify the Raspbian image to contain your wifi credentials), there is only one option left. That is attaching a serial console to the Raspberry Pi and then you have full access. RPi Serial Connection

For attaching a serial console you will need a special USB cable which can connect to the right header pins on the Pi. Search for "Raspberry Pi serial USB cable" of "Raspberry Pi USB console cable". If you have an FTDI converter laying around you can use that.

Instead of a cable you could also use an ESP8266 and do serial over Wifi ;)

The next best option without a SD-Card reader/writer, is to borrow a USB keyboard from your neighbours. With that you can connect the PI to your television over HDMI and use the keyboard to log in and modify the wifi credentials. It's even possible to do this without a mouse by interrupting the boot and adding

init=/bin/bash

after the boot command. This way raspbian will boot up in text mode.

beamzer
  • 31
  • 2
3

There is the option of network boot, some details can be found here. It uses another raspberry as network boot server, but any machine can act as it.
I don't have any raspberries so I never tried it with them, I did it many years ago with normal x86_64 machines, a bit cumbersome to configure, but it works.

1

Actually you cannot generally run a Raspberry pi without a SD card, as it stores the operating system it will be running. It's the secondary memory unit of the Raspberry Pi. But alternatively you can also use a pendrive (in the first place), to use a bootable hard drive, and run your your Raspberry Pi.

Now you can do two things very interestingly, 1.connect your raspberry pi with your network (use an Ethernet medium to avoid credentials input), and go to your Router to find out your Raspberry Pi IP address. That you can do by going to the 'Connected Client Status' on your Router. 2. Using your Raspberry pi IP, connect your PI, by SSH or you can use VNC (search on internet how to connect to Raspberry pi with VNC, this is easy af) and enjoy yourself.

N.T. for your entertainment purpose, you can use Volumio, MusixBox, or RuneAudio Operating Systems over Raspberry pi. (I'm not sure whether you can make portable hard drive medium, for these OSs, but if such, go for Raspbian or Raspbian Noobs or other Linux Frameworks).

All the best.