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 pi@192.168.1.38 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.

rajap
  • 11
  • 1
  • 4

4 Answers4

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
ott--
  • 189
  • 1
  • 1
  • 6
  • I dunno what it is, but it keeps going on forever in Terminal. It says "host is down". – rajap May 02 '16 at 04:55
  • You need to get the correct network for this. What is the IP address of your Mac? – ott-- May 02 '16 at 05:10
  • My Mac's IP address is 192.168.1.36 – rajap May 02 '16 at 06:18
  • Apparently [there is an nmap for OSX](https://nmap.org/book/inst-macosx.html), 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 03 '16 at 12:32
  • @user45899 Then use 192.168.1.$i – ott-- May 03 '16 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.

Jal
  • 31
  • 3
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.

1

mDNS

Try connecting to the raspberry pi using its mdns name:

ssh pi@raspberrypi.local

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.

Hydraxan14
  • 1,796
  • 1
  • 10
  • 23