No SSH connection via WiFi

Hi,

Yesterday I have installed new OSMC version - 2016.02-2 on RPi 2, everything was smooth and successful, but I’m not able to connect with RPi using Putty and assigned IP via SSH. Any idea why?

I can connect via cable, but it will not solve the problem, as wirred connection will receive different IP, and it will be working fine.

There a few confusing statesments in your thread I suggest to unplug the cable, then check the IP address assigned to the wireless interface in MyOSMC. Then try ping that IP and if success try to connect via ssh. Post your ping and ssh results here.
Also just to ensure that you have not changed the sshd config at all!

RPi after installing new OSMC was not connected via cable at all.
During OSMC install on SD card I have selected wireless network and during OSMC setup in RPi (language slection, time zone, etc) it was automatically connected with network.

I haven’t tried ping, but SSH receives time out error. currently I do not have access to my network :frowning:

Did you check in MyOSMC ->Network as fzinken suggested ? Did it say it was connected successfully with the IP address you thought it had ?

In MyOSMC -> Services is SSH listed as enabled ?

What do you mean by that ?

Ofcourse. I have used IP which is displayed in MyOSMC -> Network or Settings -> About system -> Network.

I have even restarted it.

I was at work without access to my home network.
I have done ping and noticed strange thing.

[code]Microsoft Windows [Wersja 6.1.7601]
Copyright © 2009 Microsoft Corporation. Wszelkie prawa zastrzeżone.

C:\Windows\system32>ping 192.168.0.105

Badanie 192.168.0.105 z 32 bajtami danych:
Odpowiedź z 192.168.0.104: Host docelowy jest nieosiągalny.
Odpowiedź z 192.168.0.104: Host docelowy jest nieosiągalny.
Odpowiedź z 192.168.0.104: Host docelowy jest nieosiągalny.
Odpowiedź z 192.168.0.104: Host docelowy jest nieosiągalny.

Statystyka badania ping dla 192.168.0.105:
Pakiety: Wysłane = 4, Odebrane = 4, Utracone = 0
(0% straty),

C:\Windows\system32>[/code]
Ping 192.168.0.105 but 192.168.0.104 is trying to reply. I guess I will change my network settings, and add all equipments once again.

I can’t read that language but what it you are probably seeing is the IP address of your PC that you are pinging from reporting an error.

IP 192.168.0.105 is displayed in OSMC.
IP 192.168.0.104 is assigned to my laptop.

Honestly saying I do not see any other option like reset to factory settings my router, set network settings once again and start with fresh install of OSMC on RPi. I hope this will help, and everything will be fine.

Any idea why pinging OSMC, laptop IP is replying? Is it normal that host from which we are pinging is giving answer?

If yes, still doen’t explain why OSMC is unreachable.

PS. It’s Polish :stuck_out_tongue:

C:\Windows\system32>ping 192.168.0.105 Pinging 192.168.0.105 with 32 bytes of data: Reply from 192.168.0.104: Destination Host Unreachable.

Can you connect a keyboard to the pi, drop to console and ping the laptop?

I have USB keyboard which can be connected to RPi, but how to open console?

I have already started with SD formatting :frowning: Will check it, if problem still persist after OSMC installation.

https://osmc.tv/wiki/general/accessing-the-command-line/

OK,
new IP assigned. Keyboard connected, console working.

command ping 192.168.0.104
192.168.0.104 (192.168.0.104): 56 data bytes

Nothing else after few minutes.

Edit: I have executed command dmesg. Not able to scroll all lines, or at least I do not know how (not Linux expert), but I see two lines in red.

24.691545 systemd[1]: Job kbd.service/start deleted to break ordering cycle starting with basic.target/start 24.691983 systemd[1]: Job rpcbind.service/start deleted to break ordering cycle starting with basic.target/start

I have also executed command sudo service ssh restart. SSH connection with RPi IP is timed out.

Suggest you upload logs from command line with grab-logs -A
If that works we are in a good position to get it working.

I probably lost 1000 brain cells trying to figure out what happened here :stuck_out_tongue:
Lets start fresh. If you want to have both connections (ethernet and wifi) do the following twice…but the second time, increment the local ip by 1, (ex: 192.168.0.151). I am not sure you can have both wifi and ethernet enabled…But try…worst case scenario if it doesnt work…you pick one type of connection and disable the other.

  1. I guess your router is at 192.168.0.100 ? IF so then go to your pi’s OSMC network setup and put a static ip on the network settings with a much higher value (ex: 192.168.0.150)…this way you’ll have to have 50 extra wifi devices at home to actually have a conflict with IPs. Your setup should look like this after:

    IP Address: 192.168.0.150
    Subnet Mask: 255.255.255.0
    Default Gate: 192.168.0.100 <—assuming your router is at that IP
    Primary DNS 192.168.0.100
    Secondary DNS: Leave it empty

  2. Press Apply and now from your PC, open putty and for the address put 192.168.0.150 and port 22.
    You should be able to connect now.

  3. IF you want to connect to your Pi from work (outside of the local LAN network) then you have to Port Forward port 22 on your router to the Pi’s LAN IP. Go here: http://portforward.com/english/applications/port_forwarding/SSH/default.htm
    find your router and follow the instructions there to forward port 22 to your PI’s local ip (ex: 192.168.0.150).
    Then you’ll be able to log in from work using your LAN’s WAN ip (and port 22).

Note: You should probably change the default osmc and root passwords if you port forward port 22.
Because you’ll be open to the outside world and trust me…eventually hackers will find you.
Via putty type: sudo passwd root then pick a new password and do the same for user osmc : sudo passwd osmc

How exactly should I do it?
Just use command mentioned by you?

I just want to have stable WiFi connection with my network.
I have set WiFi manually:

IP address: 192.168.0.110 Subnet mask: 255.255.255.0 Default gateway: 192.168.0.1 Primary DNS: 8.8.8.8 Secondary DNS: 8.8.4.4 (don't have a clue how to remove it, put 0's?)

Status after pressing Apply: connected

Ping from laptop: same as previously: Reply from 192.168.0.104: Destination Host Unreachable.

Yes just execute the command as I wrote

If you have set your local ip on the pi to 192.168.0.110 then why are you pinging 192.168.0.104 ??
Your pi now resides under 192.168.0.110 not 104
If you ping …110 you’ll see it there :slight_smile:

Your pi will always have now 192.168.0.110 as its IP…It will never change…you’ll always find it on that IP (if you are connected to it from within your house)

(Its ok about the secondary DNS…leave it as it is)

@sandbird he didn’t ping 104, that is the answer from his router not the destination

@fzinken ok now i am completely lost. If his router is under 192.168.0.104 then why did he set it up at
Default gateway: 192.168.0.1 on the pi ?
Reply from 192.168.0.104 means he is pinging .0.104 ? Whats on 0.104 ?

@apsikus , from your PC open a command prompt and type : ipconfig /all
Then please post here your results…we need to get to the bottom of this…See where is the router, where is the pi and where is your PC

Well I don’t know what he has set up but “destination host unreachable” will not be the reply from something you are pinging.
Try yourself to ping an address that is not reachable

It does say that…

C:\Users\Sand>ping 192.168.1.33

Pinging 192.168.1.33 with 32 bytes of data:
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.

Ping statistics for 192.168.1.33:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

C:\Users\Sand>