I was able to connect to Raspberry Pi via ssh. In fact I used headless installing of diet pi on my Raspberry Pi and then I was able to connect to my Raspberry Pi via ssh, however today I am no longer able to connect to my Raspberry Pi.
First I figured out that the ip address can be static or dynamic, and it may change, so I thought to find the IP address of my Raspberry Pi and connect to it via ssh.
I googled and tried different solutions.
1st attempts : I used arp-a command in cmd and find out a list that shows me ip address and the physical address, but I didn’t find the Raspberry Pi.
for your information here is the output of arp-a command:
Interface: 192.168.45.202 --- 0xd
Internet Address Physical Address Type
192.168.45.4 **-**-**-**-**-** dynamic
192.168.45.208 68-3a-48-7b-eb-80 dynamic
192.168.45.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
Interface: 172.26.192.1 --- 0xe
Internet Address Physical Address Type
172.26.207.255 ff-ff-ff-ff-ff-ff static
224.0.0.251 01-00-5e-00-00-fb static
239.255.255.250 01-00-5e-7f-ff-fa static
Interface: 172.30.32.1 --- 0x21
Internet Address Physical Address Type
172.30.40.185 00-15-5d-b7-e8-09 dynamic
172.30.47.255 ff-ff-ff-ff-ff-ff static
224.0.0.251 01-00-5e-00-00-fb static
239.255.255.250 01-00-5e-7f-ff-fa static
Then I figured out somehow that the 192.168.45.202 correspond to my wifi network (hotspot network) because when I run ipconfig in cmd I see this ip address in the wireless LAN adapter wifi section so I googled and found that I can use nmap -sn 192.168.45.0/24
to find out all the devices with this network (hotspot) so basically the Raspberry Pi should be found by nmap command.
But after running the nmap command still can’t find raspberry pi.
here is the output of nmap -sn 192.168.45.202
Starting Nmap 7.80 ( https://nmap.org ) at 2024-05-02 01:14 CEST
Nmap scan report for 192.168.45.4
Host is up (0.0054s latency).
Nmap scan report for 192.168.45.208
Host is up (0.087s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 5.19 seconds
Note that the IP address 192.168.45.208 is for another device (not Raspberry Pi) and I tried ssh 192.168.45.4, and I get this ssh: connect to host 192.168.45.4 port 22: Connection refused
The issue I have and don’t understand is that in my phone when I plug the Raspberry Pi I see there is a new device connected to my hotspot which is the Raspberry Pi, and when I unplug the Raspberry Pi (power off) the connected device list in my phone shoes that Raspberry Pi connection is gone. So why I can’t therefore find the IP address of raspberry pi via nmap -sn and then use this IP to ssh to it.
Both the Raspberry Pi and my personal computer are connected to the same hotspot network.
I have no idea what can I do to be able to connect to my Raspberry Pi again via ssh without monitor or etc.
I have seen many different links like
https://www.raspberrypi.com/documentation/computers/remote-access.html
and many other posts in stack overflow and still unable to connect to my Raspberry Pi via ssh.
any help appreciate, just I beg you don’t close my question. I really need help. thank you.