35

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.

Bex
  • 2,919
  • 3
  • 24
  • 34
Marc
  • 453
  • 1
  • 4
  • 6
  • 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? – Pete Kirkham Nov 16 '13 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. https://in.mathworks.com/help/supportpkg/raspberrypi/ug/connect-raspberry-pi-zero-w-to-an-ethernet-network-over-usb.html – Reeno Joseph Apr 03 '18 at 03:21

5 Answers5

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.

Greenonline
  • 2,448
  • 4
  • 18
  • 33
geoji
  • 674
  • 6
  • 5
  • 1
    And if you don't have Samba, how to find the IP of the Pi? – Basj May 27 '15 at 13:04
  • You could try nmap – Oliver Sep 21 '17 at 15:34
  • I think it is not possible with windows 10 :( – JJ Roman Feb 04 '19 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 Nov 26 '20 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

Sufiyan Ghori
  • 423
  • 9
  • 18
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.

thekiwi5000
  • 651
  • 4
  • 14
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)

Eugen
  • 488
  • 3
  • 12
Mia19
  • 41
  • 1
  • 1
    Hello and welcome! Please take the [tour](http://raspberrypi.stackexchange.com/tour) and visit the [helpcenter](http://raspberrypi.stackexchange.com/help). Whilst this may theoretically answer the question, [it is preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. In fact we're [enforcing this policy](http://meta.raspberrypi.stackexchange.com/q/842/5538): 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 Nov 22 '16 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.

Buda2832
  • 19
  • 2
  • 5
    Most modern computers (including the Raspberry Pi) use autosense, so crossovers are no longer required. – scruss Jan 06 '14 at 13:45