5

I am trying to setup a direct connection between my Windows laptop and RPi so that I can take projects with me to other locations without wifi and still have control over the RPi. I have removed the NOOB OS from my SD card and loaded Raspbian Wheezy and have had it all working on a separate computer screen with a keyboard and mouse however, now need to move it over to the laptop and connect as per my requirements.

I followed this tutorial to do this: Raspberry Pi Remote Connections – Without A Network!

I followed the tutorial and got to Step 2 Option 1. As per the tutorial I added the following within my cmdline.txt file:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait ip=169.254.1.7

The only thing added was the IP address at the end. I then connected the Pi to the laptop through the ethernet cable and powered the Pi, waited a few minutes and got nothing, the loading symbol stopped and there was no additional connections available, anyone have any ideas why this may be happening and how to fix it?

techraf
  • 4,254
  • 10
  • 29
  • 41
Rahul Khosla
  • 51
  • 1
  • 1
  • 2

6 Answers6

2

First, you need to configure ssh and the rest of the settings via raspi-config. Second, you'll need to make sure your computer's "internet sharing" settings are set to allow such a connection. With a Mac this is in the Internet Sharing section of System Preferences.

Then connect the rpi via ethernet cable and power it on.

The usual ip address I get is 192.168.2.2 (sometimes it is 192.168.2.3 or 192.168.2.4).

So in the terminal enter the command ssh pi@192.168.2.2 and see if it responds. If not, try running the arp -a command to view possible addresses the pi may have taken.

Once you find the right IP, you will be asked to enter password. Then you're in!

Dbo
  • 304
  • 1
  • 6
  • Or install NMAP on your comp and run (literally lots of commands will work and it is really about preference on which command you choose to use as many will flat state or at least give hints to which IP is that of your pi.) `man nmap` to get the proper command ideas to input. Try `nmap -O ###.###.###.1-254` which will give details about the OS each connected device is using, for example. – Dbo Feb 14 '15 at 15:39
1

169.254 is defined for link-local addressing for IPv4 networks.

I have tried many different methods for direct connection, but never succeeded with this.

I suggest you follow some of the other options. The basic problem is that your laptop is not acting as a DHCP server.

The simplest option is to enable a static address for the Pi. This needs to match the subnet you are working on.

Other options are to enable Internet Connection Sharing on the laptop. This will let the Pi access the internet, but there may be problems accessing from the laptop. I can't comment in detail on Windows.

ipv6 can be used. It is not enabled by default in Raspbian, but is simple to setup. See https://raspberrypi.stackexchange.com/a/40/8697

This certainly allows ssh access, but not all systems on the Pi support ipv6 (e.g. tightvncserver.

Milliways
  • 54,718
  • 26
  • 92
  • 182
0

Alternatively if you're using something that is not Windows on your computer, you can set up avahi-daemon and IPv6 on the Pi. The IPv6 link-local address assigned to the Pi can be discovered over bonjour.

Maxthon Chan
  • 1,051
  • 7
  • 13
0

Usually the IP is 192.168.2.2 when a Pi is connected to a laptop via Ethernet. However sometimes it isn't. And I don't find:

arp -a

so useful.

In that case use the following command:

netstat -rn -finet

Check the Mac address of your Pi and the IP address next to it is the one. If you don't know the Mac address, it's likely something like 192.168.2.x.

techraf
  • 4,254
  • 10
  • 29
  • 41
YOUNG
  • 101
  • 1
0

You can.

Direct connection: The problem is your ethernet cable.

To connect two computers directly you need to use a "crossover" ethernet cable OR use a switch. Normally both sides of the cable are wired identically, but if you want the cable to run directly in between it needs to be rewired into a crossover cable or use a crossover converter (essentially moving the wires around so the transmitting part on one computer is linked to the receiving part on the other).

Adapter: http://www.usbfirewire.com/Parts/rr-et-crossoveradapter.html

Make your own cable: http://en.wikipedia.org/wiki/Ethernet_crossover_cable

You can also use a small 4-port switch, which does this for you but it needs electricity. http://www.amazon.com/TP-LINK-TL-SF1005D-5-port-100Mbps-Desktop/dp/B000FNFSPY/ref=sr_1_2?ie=UTF8&qid=1426062657&sr=8-2&keywords=4+port+switch

After this you may need to have each computer assign a manual ip address to itself so they can talk to each other.

unom
  • 653
  • 2
  • 7
  • 20
  • Crossover cables are rarely needed [today](http://en.wikipedia.org/wiki/Ethernet_crossover_cable#Automatic_crossover). The raspberry, in particular, does not [(1)](http://elinux.org/RPi_Hardware) [(2)](http://www.smsc.com/media/Downloads_Public/Data_Briefs/9512db.pdf) need one. – user236012 Mar 11 '15 at 09:58
  • You mean it auto detects when it's connected directly to another computer and then negotiates to switch the wires. Last time I checked this needed hardware support on both ends, true the Pi has this but the other end he's using may not. In your first link it says its implementation is optional but widely used. – unom Mar 11 '15 at 14:30
0

The link posted below might help. I recently followed to set up mine.

https://www.youtube.com/watch?v=xarq3PI5zTw

dhruvvyas90
  • 2,803
  • 2
  • 18
  • 32
KaLi
  • 101
  • 1