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.
-
probably wrong IP? How did you get that IP?Jakuje– Jakuje2016年05月01日 16:55:20 +00:00Commented May 1, 2016 at 16:55
-
This may be useful.goldilocks– goldilocks2016年05月01日 19:16:18 +00:00Commented 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--– ott--2016年05月01日 20:28:34 +00:00Commented May 1, 2016 at 20:28
-
1I found the IP by logging into my router as admin. Then i went to Status--> DHCP clients, and found the one called raspberrypi.rajap– rajap2016年05月02日 04:53:33 +00:00Commented May 2, 2016 at 4:53
4 Answers 4
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
-
I dunno what it is, but it keeps going on forever in Terminal. It says "host is down".rajap– rajap2016年05月02日 04:55:00 +00:00Commented May 2, 2016 at 4:55
-
You need to get the correct network for this. What is the IP address of your Mac?ott--– ott--2016年05月02日 05:10:45 +00:00Commented May 2, 2016 at 5:10
-
My Mac's IP address is 192.168.1.36rajap– rajap2016年05月02日 06:18:51 +00:00Commented 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– goldilocks2016年05月03日 12:32:12 +00:00Commented May 3, 2016 at 12:32 -
@user45899 Then use 192.168.1.$iott--– ott--2016年05月03日 15:27:07 +00:00Commented May 3, 2016 at 15:27
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.
-
Ive reinstalled raspbian 6 timesrajap– rajap2016年05月02日 04:54:22 +00:00Commented May 2, 2016 at 4:54
There are two mostly possible reasons for such issue:
- Your RPi receive ip through dhcp service from your router and it is not 192.168.1.38.
- 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:
sudo nano /etc/dhcpcd.conf
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
sudo reboot
Hope this helps.
-
it says-bash: [: i: integer expression expectedrajap– rajap2016年05月03日 02:34:50 +00:00Commented May 3, 2016 at 2:34
-
Sorry, there was a typo in script string. Fixed it, make another try.Maxim Maslov– Maxim Maslov2016年05月03日 12:21:56 +00:00Commented 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– goldilocks2016年05月03日 12:36:13 +00:00Commented 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 allrajap– rajap2016年05月03日 16:37:11 +00:00Commented 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– rajap2016年05月03日 16:38:25 +00:00Commented May 3, 2016 at 16:38
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.
-
-
Ok, nothing is working. Still.rajap– rajap2016年05月06日 12:03:08 +00:00Commented May 6, 2016 at 12:03