1

Around June of last year, I got myself a Raspberry Pi Model B+. I was super excited, but all that excitement died down when I moved overseas. I used the Pi off and on, not doing some real powerful stuff. Now, I am ready to use my Pi: in headless mode. I tried connecting my Pi to my router, with a fresh install of raspbian. Then, I powered it on. I waited around 5 minutes. Then, from my Mac, I typed ssh [email protected] I had previously connected to my Pi via VNC and SSH. Now, it says: connection timed out, and: host is down. I tried also doing: ping 192.168.1.38 Still the same messages. What is going on? I need help!

Side note: this is not a duplicate of other questions, because others like this use a wifi dongle, or their internet works, but not their pinging.

4
  • probably wrong IP? How did you get that IP?
    – Jakuje
    May 1, 2016 at 16:55
  • This may be useful.
    – goldilocks
    May 1, 2016 at 19:16
  • What's the IP and netmask of you Mac? This should give you hint how to find your Pi.
    – ott--
    May 1, 2016 at 20:28
  • 1
    I found the IP by logging into my router as admin. Then i went to Status--> DHCP clients, and found the one called raspberrypi.
    – rajap
    May 2, 2016 at 4:53

4 Answers 4

2

This is the Poor Man's Broadcast Ping. I'm assuming that this is a class C network.

$ i=1 ; while [ i -lt 255 ] ; do ping -c 1 192.168.2.$i ; i=$((i + 1)) ; done | grep -B 1 "1 received" 

--- 192.168.2.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
--
--- 192.168.2.102 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
--
--- 192.168.2.103 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
5
  • I dunno what it is, but it keeps going on forever in Terminal. It says "host is down".
    – rajap
    May 2, 2016 at 4:55
  • You need to get the correct network for this. What is the IP address of your Mac?
    – ott--
    May 2, 2016 at 5:10
  • My Mac's IP address is 192.168.1.36
    – rajap
    May 2, 2016 at 6:18
  • Apparently there is an nmap for OSX, although most likely you are simply up-a-creek without a screen and keyboard. That can be an impossible situation for many people. The last time I installed jessie-lite, sshd was not configured to run by default despite the claims of the documentation. Confirming and fixing that on the SD card takes a bit of understanding of systemd. Of course that doesn't explain your inability to ping. If your router claims it is there, the problem may have nothing to do with the pi and everything to do with the Mac.
    – goldilocks
    May 3, 2016 at 12:32
  • @user45899 Then use 192.168.1.$i
    – ott--
    May 3, 2016 at 15:27
1

You probably have the wrong IP address for your Raspberry Pi. You could go to your router's admin page (the directions to get to the page is usually in the instructions for the router or somewhere on the manufacturer's support page) and look at the list of connected devices and their IPs. Try each of the listed devices and if none of them work, then I would reinstall Raspbian on the SD card and start over.

1
  • Ive reinstalled raspbian 6 times
    – rajap
    May 2, 2016 at 4:54
1

There are two mostly possible reasons for such issue:

  1. Your RPi receive ip through dhcp service from your router and it is not 192.168.1.38.
  2. Your Rpi cannot connect to your router because it has incorrect settings of default gw.

In first case your goal is determine what is actual ip adress of your Rpi. You can try to investigate dhcp logs of your router (but be attentive that you find your current Rpi device, but not previous). Or use script from previous answer, but with a little fix (because for you case it is not correct, there should be 1 instead to 2 in ping mask):

 i=1 ; while [ $i -lt 255 ] ; do ping -c 1 192.168.1.$i ; i=$((i + 1)) ; done | grep -B 1 "1 received"

There are different ways to solve the second issue, but in your case I suggest to try the next one:

  1. sudo nano /etc/dhcpcd.conf

  2. Type in the following lines on the top of the file:

    interface eth0
    static ip_address=192.168.1.38
    static routers=192.168.1.1
    static domain_name_servers=192.168.1.1
    
  3. sudo reboot

Hope this helps.

14
  • it says-bash: [: i: integer expression expected
    – rajap
    May 3, 2016 at 2:34
  • Sorry, there was a typo in script string. Fixed it, make another try. May 3, 2016 at 12:21
  • There is a perfect storm of ambiguities which could take place here with the router, the Mac, and the pi. If you really don't have access to an HDMI screen and keyboard (~$10), get a short ethernet cable from somewhere (~$5) and try attaching the pi directly to the Mac.
    – goldilocks
    May 3, 2016 at 12:36
  • okaaaaaayyyyyyyyyy.......now, nothing is happening. Gave it a good 15 minutes, but after copying and pasting the script above into Terminal, it remained blank nothing happened at all
    – rajap
    May 3, 2016 at 16:37
  • Also, I have access to an HDMI monitor(my tv), but there is no ethernet socket on that floor, so kind of useless. I either have Ethernet plugged in, or HDMI, not both.
    – rajap
    May 3, 2016 at 16:38
1

mDNS

Try connecting to the raspberry pi using its mdns name:

ssh [email protected]

I just tested it today with fresh installs of 2016-03-18-raspbian-jessie and 2016-03-18-raspbian-jessie-lite on my original Raspberry Pi B: both versions grab an ip address via dhcp, start avahi and start sshd right out of the box.

Patch Cable

If that doesn't work, please make sure you are connecting to your router with a patch / straight-through cable, and not a crossover cable.

2
  • I am using a patch cable
    – rajap
    May 5, 2016 at 17:02
  • Ok, nothing is working. Still.
    – rajap
    May 6, 2016 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.