Can't Find the IP adress of my RPI


8 posts
by waelCh » Sun Oct 21, 2012 8:45 pm
Hello..
I am trying to control my Raspberry PI from the PC through out an RJ45 cable. I ve seen all the videos on youtube which are talking about the RPI getting started but all of them said that i should have the IP address of my RPI. Unfortunately i found myself blocked!!
So please can someone help me to find a solution?!
Posts: 8
Joined: Sun Oct 21, 2012 8:18 pm
by pluggy » Sun Oct 21, 2012 10:49 pm
The normal way of doing it is to plug both the PC and the Pi into the same router and they'll be issued IP addresses by the DHCP system in the router. The Pi will normally report what it's is when it's booted up. If you want to connect the PC directly to the PI, you'll need to to give both the PC and the Pi a static IP address in the same subnet manually. Clarifying exactly what you have would help.
Don't judge Linux by the Pi.......
User avatar
Posts: 2406
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
by JasperWebster » Mon Oct 22, 2012 2:32 am
If you have connected already with a TV (via HDMI) and a keyboard/mouse, try this:
- launch the Terminal from the desktop.
- type in:
sudo ifconfig
- Hit enter; the IP address will be on the second line as "inet addr".

(Of course, if you don't have the HDMI setup with keyboard and mouse, then I'm out of ideas.)
Posts: 1
Joined: Mon Oct 22, 2012 2:29 am
by waelCh » Mon Oct 22, 2012 7:04 am
Thanks a lot Mr pluggy for your help..
I will test what u have said and i will tell u if that's goes right or not.
Posts: 8
Joined: Sun Oct 21, 2012 8:18 pm
by waelCh » Thu Oct 25, 2012 10:43 am
well, I ve finally found the IP address of my RPI and i can now access to the RPI through out my PC. But i still have another problem, that I should connect both of them (the PC and the RPI) in the same router if i want to get the IP address.
So now i need someone to help me to find how to connect the PC and the RPI togeher directly then get the IP address and start the ssh connection?!
Posts: 8
Joined: Sun Oct 21, 2012 8:18 pm
by Joe Schmoe » Thu Oct 25, 2012 11:18 am
waelCh wrote:well, I ve finally found the IP address of my RPI and i can now access to the RPI through out my PC. But i still have another problem, that I should connect both of them (the PC and the RPI) in the same router if i want to get the IP address.
So now i need someone to help me to find how to connect the PC and the RPI togeher directly then get the IP address and start the ssh connection?!


Well, the obvious question is: Why? Why don't you want to use a router?
This question is intended as serious, not facetious.

Others have noted that the easiest way to do it is with a router, but it can be done without one, using Windows "Internet Connection Sharing" (and perhaps other esoteric Windows-y things). But the real question is, as it always is, what problem are we really trying to solve?

If I had a better idea of what real problem you are facing, I could walk you through setting it up with ICS, in a way that doesn't require a router.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2590
Joined: Sun Jan 15, 2012 1:11 pm
by malakai » Thu Oct 25, 2012 11:42 am
I think sometimes it gets into people aren't used to this sort of thing so they are going around in non traditional settings. 1 the pi is easier when side by side with your wireless laptop but if the pi isn't wireless at this point how do I connect? so they connect the 2.


Another that most won't realize is their typical home router is set to 192.168.x.x subnet 255.255.255.0
This only leaves 253 possible IP addresses for their network. That's a lot but again most default modems/routers know this is way to many for a typical home (ISP's really don't want you to connect 253 devices that's a ton of bandwidth so they limit DHCP even further to about 50) now you only have to guess 50. DHCP starts at the bottom and works it's way up.

So you ipconfig or ifconfig your current pc you get ex: 192.168.0.15 it's not that hard to just ping .2,.3,.4 and so on until you get a reply chances are that's your pi. More than likely if you have several computers you'll hit one of them before the pi and if the pi is new to your network it will end up around 4 to 16 in the above example. It's not a hard test and more often than not if your pi is .16 it will be .16 for a lot of reboots as the lease hasn't expired.


so ping 192.168.0.2 enter
no reply CTRL+C
press up arrow hit delete enter 3 (repeat until reply) test ssh not connecting move repeat again going higher.

This whole test should take about 3 minutes so headless I could connect to my pi in that much time. No script no fancy blinking lights.
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)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by malakai » Thu Oct 25, 2012 11:52 am
If your on a widows machine paste this into a file called ping.bat


Code: Select all
@echo off
for /L %%i in (1,1,10) do (
@echo testing 192.168.0.%%i
ping 192.168.0.%%i > nul
if ERRORLEVEL 1 @echo error ping %%i )


basically make a text file choose save as "test.bat" keep the quotes change 192.168.0 to whatever your ip is but leave the last bit off. To end the test type CTRL+C (192.169.0.1 is your modem/router and should reply.)
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)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am