3

I have a Raspberry Pi 3 model B. I already have Raspbian on a SD card. I have a MacBook Pro without an Ethernet and I don't have the Ethernet adaptor, I have no access to router. I want to connect to my RPi using SSH or VNC but I don't know my RPi IP address and I can't connect it to WiFi.

I need to connect RPi with following:

  • RPi 3 model B
  • SD card with Raspbian
  • MacBook Pro without Ethernet

What do I need to do to connect RPi to Mac?

techraf
  • 4,353
  • 10
  • 32
  • 43
Reza
  • 133
  • 1
  • 5

1 Answers1

5

Assuming you have no hardware connectors, your only point of control is the SD card.

Depending on your current state you might need all or some of the below steps:

  1. You need to take it out of the Pi and insert into Mac's slot.

    Now you need to mount the filesystem on the SD card. OS X doesn't support it natively, so either you need a Linux virtual machine running in VirtualBox (how to set up virtual machine and mount the SD card is a separate topic), or you need to install software that recognizes ext filesystem (like a free OSXFuse or a commercial Paragon ExtFS for Mac).

  2. Once you have access to the filesystem, you need to edit/make sure the <mountpointforroot>/etc/wpa_supplicant/wpa_supplicant.conf file contains the correct WiFi connection settings:

    network={
      ssid="wifiNetworkId"
      psk="wifiNetworkLey"
      id_str="wifiNetworkId"
    }
    
  3. If you are using November 2016 Raspbian release, you need to ensure the boot partition contains ssh file (see this)

  4. Now you need to unmount the SD card from Mac and boot the Pi

  5. You need to figure out the IP address that Pi obtained from the access point's DHCP.

    As you cannot check it directly on the router, you can use nmap to scan for devices listening on SSH port, for example:

    nmap -p 22 192.168.1.0/24
    

    You need to replace 192.168.1.0 with your network (this should be the same as for your Mac connected to the same WiFi).

    nmap is not installed on OS X, but you can install it, for example with Homebrew (brew install nmap). For Homebrew itself check the official guide.

  6. Check the new IP address of the Pi and connect to it, for example:

    ssh pi@192.168.1.55
    
techraf
  • 4,353
  • 10
  • 32
  • 43