Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6176

Networking and servers • Re: Problem when SSH using windows and Raspberry Pi 4

$
0
0
Thank you again.

Ok, I enabled internet connection sharing. At beginning it seemed the SSH connection was more stable, but then problems occurred again.

This time I did like this:

1) enabled internet connection sharing
2) rebooted the pc
3) rebooted the Rpi
4) connected pc and Rpi through ethernet cable
5) SSh via pi@raspberrypi.local: it worked.
6) then in the terminal of the Rpi I executed hostname --all-ip-addresses
7) the command gave me an ip address
8) running the command arp -a in my pc I could see that same address too (I learnt this from the link I posted, that's why I posted that)
9) with this address everything worked, both VNC and SSH (I exithed from SSH created via pi@raspberrypi.local and created a new connection via pi@<ip_address>

Then problems started again: connection freezed and after a while I got the message: client_loop: send disconnect: Connection reset. From here on no matter what I tryed: ssh and VNC do not work anymore.

So I rebooted Rpi, connected ethernet again and SSH via pi@raspberrypi.local: worked. I launched hostname --all-ip-addresses and no IP address was displayed now, no chance with arp -a on cm on PC too.

As far I understood from your answers, it is not so easy to create a connection via Rpi and PC using ethernet directly but I'd like to learn about that and that's the main purpoe of my posts hoping that this could be useful for someone else. I'm investigating in this since I would like to create a server on raspberry, then connect it to PC via ethernet and then open browser, input ip of raspberry and get a web page delivered by the server to control my application. But this is not the problem, I'm able to do that (or at least I'm able to get to a first working solution in this field). What I'm not understanding is this strange behaviour about SSH and VNC connection that are the minimal tools I need to start developing on Rpi! don't want to use keyboard and monitor on Rpi.

Regarding the link I posted: I want to use VNC too to write code in the raspberry using the GUI and then test applications, but I mainly posted that link since in the first part it finds the IP of the Rpi using the command line: that method works sometimes for me and sometimes not. However I'm much interested in understanding how to get a reliable connection using ethernet, both to definitely find a solution in this topic, and because in the future I want to connect the raspberry to my PC, open the web page and control my project.

Hope I answered you questions. If you have any check i can do to find what's going wrong when the connection freezes or the IP addressis not displayed in the raspberry using hostname --all-ip-addresses I'll do that and report the results

Edit: forgot to tell you that I also followed this link to do direct ethernet connection: https://medium.com/@jrcharney/connect-y ... 64e1e68922 This talks about connection shaaring and all the required stuff, but it seems troubles are continuing for my connection

Edit 2: Doing ping raspberrypi.local I do not get the IP address of the raspberry:
ip_not_showed.jpg
I'm ont so strong in network stuff, that's why I'm trying to learn and understand all things

Statistics: Posted by gev_u — Fri Apr 12, 2024 9:06 pm



Viewing all articles
Browse latest Browse all 6176

Trending Articles