37

What I want to do is to connect through SSH and HTTP to my Raspberry Pi without having to connect it to the router. I use the Adafruit's Web IDE to create and run my programs, and I'd like to access the web page with my Pi only connected to the PC via Ethernet.

Actually, I need also to have Internet connection to the Pi, as Adafruit's IDE needs Bitbucket authentication.

I tried bridging the Wi-Fi interface (because I connect to the internet through Wi-Fi in my PC) and the Ethernet interface but it didn't work. I've tried it with a Mac and the Internet sharing option and it works fine because I can go to the web page typing http://raspberrypi.local. But now I'm in a laptop with Windows 8 and it's impossible to work out a way.

I know there are lots of questions like this one but no one was accurate enough to my case.

Thank you in advance.

2
  • 1
    Given it works on a Mac, this seems to be a Windows admin question rather than a raspberry pi question, so maybe try superuser instead? Commented Nov 16, 2013 at 12:24
  • Please checkout the MATLAB & Simulink supportpackage for Raspberry Pi. Follow this guide to connect Pi Zero W directly to your host PC. in.mathworks.com/help/supportpkg/raspberrypi/ug/… Commented Apr 3, 2018 at 3:21

5 Answers 5

24

Here are the steps to share your PC's wireless internet connection with a Pi:

  1. Connect the Pi to PC's ethernet port using a regular ethernet cable
  2. Go to "Network Connections" on the Windows PC and select the "Wireless Network Connection"
  3. Right-click and select properties. In the "Sharing" tab under "Internet Connection Sharing" enable both checkboxes.
  4. Restart your PC. This step is very important.
  5. Now your Pi will obtain an IP address from your PC and can access internet through your PC
  6. If need to find the IP address of the Pi to SSH or to remote login from the PC, run "ping raspberrypi" command where "raspberrypi" is the hostname of your Pi. Note that you have to have samba running on your Pi for the ping command to work.

If you need additional details with screenshots on how to share internet connection please see the post, Connecting to Pi from Laptop's Ethernet Port, that explains how to connect to Pi through the Ethernet port on a Windows machine.

4
  • 1
    And if you don't have Samba, how to find the IP of the Pi?
    – Basj
    Commented May 27, 2015 at 13:04
  • You could try nmap
    – Oliver
    Commented Sep 21, 2017 at 15:34
  • I think it is not possible with windows 10 :(
    – JJ Roman
    Commented Feb 4, 2019 at 21:20
  • You can find the IP address of the Pi using Wireshark. Start sniffing by selecting the proper ethernet channel where you connected your Pi. You will start to see a lot of packages being shared where "info" has the following data: "Who has xxx.xxx.xxx.xxx ? Tell yyy.yyy.yyy.yyy " where "yyy" address is the IP address of the Pi.
    – fabocode
    Commented Nov 26, 2020 at 16:33
3

Have you tried connecting Raspberry Pi to your PC using USB to TTL Cable (Console Cable) ?

The great advantage of using the console cable with the Pi is that it can even supply the power for your Pi and you do not need keyboard, mouse or display attached to the Pi to log into it.

You will need to install terminal emulation software (Putty) if you are using Windows and also USB drivers for the Console Lead.

The Raspberry Pi uses its built-in serial port to allow devices to connect to its console and issue commands just as if you were logged in.

You would also need PL2303 Drivers to do so.

I have been using my Raspberry Pi this way for quite a while and have no issue so far.

It merits mentioning that Raspberry Pi Console Cable drivers (Pl2030) wouldn't work if you are using Windows 8 ( I tested that too).

here is how you could use it, http://goo.gl/GgLgjx

2

Bridging two networks works well on windows 8 rather than ICS. Just make sure you UNTICK BOTH the SHARING OPTIONS(Allow other computers to connect through..., Allow others to control..) in sharing tab BEFORE BRIDGING

Then bridge the two networks : Ethernet and Wifi.

1

Its easy in Windows computer. Found this article that may help: https://mylinuxcode.com/share-windows-internet-raspberry-pi-ethernet-port/ (direct link to the youtube video from that blog)

1
  • 1
    Hello and welcome! Please take the tour and visit the helpcenter. Whilst this may theoretically answer the question, it is preferable to include the essential parts of the answer here, and provide the link for reference. In fact we're enforcing this policy: please edit so that the answer stands on its own should the link break in the future. If it is not edited within 48 hours it will be converted to Community Wiki.
    – Ghanima
    Commented Nov 22, 2016 at 12:37
0

you need a crossover cable for the PC to Pi, then bridge the PC wifi to the NIC with ICS(internet connection sharing, some adjustments will be needed to the firewall as well.

1
  • 5
    Most modern computers (including the Raspberry Pi) use autosense, so crossovers are no longer required.
    – scruss
    Commented Jan 6, 2014 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.