DukeOfTarporley
Posts: 18
Joined: Tue Aug 30, 2011 4:15 pm

Connecting Pi to Windows 7 PC directly by CAT5 cable only???

Tue Oct 23, 2012 7:33 pm

Gang,

I travel with work and wanted to work on a Pi project whilst away. I have in the past bundled the Pi and anchillaries in to the Laptop bag along with the laptop and plugged into the hotel telly at the far end.

I thought an easier solution on this occasion would to work on the PI headless. (The full size key board pocking out of the laptop bag in the past has got some funny looks from airport security).

I packed:
1)The Pi (Raspian Wheesy distribution on the SD card, Non Turbo mode)
2) The Pi power plant
3) a cat5 cable (Not crossover)

before I left I made sure SSH was enabled [but did not fix an IP address].

I have used PuTTY in the past to access it headless but checked the IP address at the time using the PI itself.

My thoughts were
1) get Windows to assign the IP address to PI.
2) get windows or another program to tell me the IP address of the PI
3) use the IP to PuTTY in.

On Power up the PI LED flash in the normal way and go constant after a while

Normal headless solutions seem to rely on a router providing an IP address or fixing it. I cant do either.

The LAN connection on the laptop (running windows 7") says "unidentifed network, Shared"
I have downloaded Nmap but it seems only to find the Wireless network on the hotel.

I believe I am still stuck at 1) or 2) I am not convinced I have got windows 7 to do the DCHP role or know how to get the IP address if it had assigned on. The net advises that Windows 7 will assigned IP address to incoming devices if internet sharing is allowed which I have done.



Any help greatly appreciated.

Thanks in advance.


DoT

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Tue Oct 23, 2012 7:40 pm

Are you using a cross over cable. Auto switching is popular not sure laptops support it though.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

ghans
Posts: 7868
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Tue Oct 23, 2012 7:59 pm

The Pi has auto-sensing and he has no crossover cable.
Isn't one enabled participant enough for Auto-MDIX ?
As for DHCP : What does Internet Connection Sharing actually do ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Tue Oct 23, 2012 8:14 pm

The easiest way to set a static IP address on the RPi is to add IP configurations to the file cmdline.txt on the first partition of the SD card.

A very simple entry in cmdline.txt is
ip=192.168.0.200:::255.255.255.0

The expected format is
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>

Remember that the Windows PC must also be set to use a static IP address on the ethernet port.

If the Windows PC has an SD card adaptor, it can be used to edit the cmdline.txt file.

DukeOfTarporley
Posts: 18
Joined: Tue Aug 30, 2011 4:15 pm

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Tue Oct 23, 2012 9:17 pm

bredman wrote:The easiest way to set a static IP address on the RPi is to add IP configurations to the file cmdline.txt on the first partition of the SD card.

A very simple entry in cmdline.txt is
ip=192.168.0.200:::255.255.255.0

The expected format is
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>

Remember that the Windows PC must also be set to use a static IP address on the ethernet port.

If the Windows PC has an SD card adaptor, it can be used to edit the cmdline.txt file.
Bredman and others,

thanks for the replies.

I did as Bredman suggested and popped the SD card into the laptop and altered the cmdline.txt to give the Pi and Laptop static address! Great thinking.

I can now PuTTY into the Pi

NOTE for readers. The first time I edited the file was with Windows' WordPad and included a New Line and this did not work. The second time I used NotePad and did not enter a newline and it worked

On with the project , working out a non static solution can wait for another day!

DoT

DukeOfTarporley
Posts: 18
Joined: Tue Aug 30, 2011 4:15 pm

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Mon Oct 29, 2012 1:26 am

All

Another work around I have (same issue on a different trip but my latest image is on an SD card that cant be read by the laptop) is installing a DCHP server like.

http://sourceforge.net/projects/dhcpser ... e/download

After installing it choose "Run Stand Alone" from the windows start menu.
connect the Pi to laptop network adaptor. Power the Pi up and once booted the network address will be assigned and displayed in the text window of the DCHP server.

You can then PuTTY and fix the network address as describe in the post two above.

DoT

DukeOfTarporley
Posts: 18
Joined: Tue Aug 30, 2011 4:15 pm

Re: Connecting Pi to Windows 7 PC directly by CAT5 cable onl

Thu Nov 08, 2012 2:46 pm

I wanted to report back to the community on this and thought my experiences might help others.

Windows 7 will act as a DCHP server and assign the PI connected to the laptop an ip address if you use configure the laptop out going network adapter to allow "internet connect sharing". My mistake was setting the incoming network adapter for internet connect sharing. It has to be the out going network adaptor (generally the wireless adapter) . The network sharing adapter will be assigned the IP 192.168.137.1.

On boot up the PI will then get the IP address from the laptop.

you can then PuTTY into the Pi using the IP address 192.168.137.x where the x is generally 2

DoT

Return to “Beginners”