Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Raspberry Pi IP Address (http://www.chiefdelphi.com/forums/showthread.php?t=152395)

acastagna 24-11-2016 06:30

Raspberry Pi IP Address
 
My team is trying to set up vision processing for the first time, and we are going with Java and openCV running on a raspberry Pi. So far we are making good progress, but we have come up on an "annoyance" that we haven't been able to work around. We are doing code development by directly accessing the Pi from a laptop using putty and an ethernet cable.

The problem is we need to have a router in between for this to work, either by ethernet cable or wifi. Is there a way to get this setup to work without a router? I believe the problem is the Pi either doesn't get issued an IP address without the router, or it is getting an address that we cannot find. We have tried using IP Scanner to search for it when there is no router in between with no luck. We also tried setting a static IP but couldn't see the Pi without the router.

Thanks!

sysdes 24-11-2016 07:17

Re: Raspberry Pi IP Address
 
If you are plugging the ethernet cord from the Pi directly into the laptop you will likely need to use a crossover ethernet cable instead of the standard ethernet cable (google ethernet crossover). You will certainly need to have static IP addresses set on the Pi (use the network icon on the Rpi or edit /etc/dhcpcd.conf for the newest versions of Raspian) and the laptop will need a static IP as well.

acastagna 24-11-2016 07:56

Re: Raspberry Pi IP Address
 
Thank you. We'll try the crossover cable and confirm the static IP address.

I think we do have an older operating system because I didn't see a the etc/dhcpcd.conf file. I tried creating one, but that didn't work.

RufflesRidge 24-11-2016 09:54

Re: Raspberry Pi IP Address
 
Quote:

Originally Posted by sysdes (Post 1617492)
If you are plugging the ethernet cord from the Pi directly into the laptop you will likely need to use a crossover ethernet cable instead of the standard ethernet cable (google ethernet crossover).

The Raspberry Pi's NIC supports Automatic MDI/MDI-X so a crossover cable is never necessary. It is very likely your laptop does as well unless it's pretty ancient.

dirtbikerxz 24-11-2016 10:32

Re: Raspberry Pi IP Address
 
Get this cable from adafruit

It allows you to putty straight into the raspberrypi without even needing to disconnect from your normal wifi. Here is the tutorial on how to use it.

billbo911 24-11-2016 13:18

Re: Raspberry Pi IP Address
 
By default, the Pi is set to DHCP. Thus, it get's it's address from the router. To set a static IP, you will need to modify the etc/network/interfaces file.

Here is what ours looks like.
Code:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto eth0
iface eth0 inet static
address 10.20.73.225
netmask 255.255.255.0
gateway 10.20.73.4

auto lo
iface lo inet loopback

You can copy this into your file. Edit it to the addresses you want to use, and comment out the DHCP portions so you can go back to DHCP easily, and then reboot.
It should come up in Static mode and you should be all set.

snekiam 24-11-2016 14:17

Re: Raspberry Pi IP Address
 
Have you tried using mdns? By default, the pi should respond to pings on rasperrypi.local I think, even with a self-assigned 169.x.x.x address.

euhlmann 24-11-2016 14:40

Re: Raspberry Pi IP Address
 
Quote:

Originally Posted by acastagna (Post 1617490)
My team is trying to set up vision processing for the first time, and we are going with Java and openCV running on a raspberry Pi. So far we are making good progress, but we have come up on an "annoyance" that we haven't been able to work around. We are doing code development by directly accessing the Pi from a laptop using putty and an ethernet cable.

The problem is we need to have a router in between for this to work, either by ethernet cable or wifi. Is there a way to get this setup to work without a router? I believe the problem is the Pi either doesn't get issued an IP address without the router, or it is getting an address that we cannot find. We have tried using IP Scanner to search for it when there is no router in between with no luck. We also tried setting a static IP but couldn't see the Pi without the router.

Thanks!

I've used Pi 2s and Pi 3s over ethernet directly to my laptop and it's worked.

However there's one more step: Unless you've set the Pi to use a static IP address, you need your computer to run a DHCP server to assign the Pi one. The way I've done that is by using ICS to bridge ethernet to my laptop's wifi connection (since I've also needed the Pi to connect to the internet :) ). ICS runs a DHCP server and uses NAT to connect two interfaces.
On Windows 10, there's probably an easy way to do this through the new Settings app but here's how I've done it:

1. Start icssvc


2. In adapter settings on the old control panel, go to properties for your wifi connection > sharing > Check the box > select your ethernet connection

Note: if the box is already checked, you'll have to uncheck it, click OK, then open properties and check it again otherwise icssvc won't know about it. This is Windows, remember? :rolleyes:

acastagna 27-11-2016 19:17

Re: Raspberry Pi IP Address
 
Thanks again to everyone who shared their methods for running the Pi through the laptop.

My goal was to run the Pi through the laptop without a router in between, and have the Pi share the laptop's wifi when the laptop has internet access.

Here's the method that ended up working best for me:
  • ethernet cable between laptop and pi
  • ethernet address set to static on both sides
  • wifi address set to dynamic on both sides
  • On the laptop use the bridging feature to bridge the ethernet and wifi.
  • Use WinSCP for file transfer between the two.


I also tried the adafruit cable mentioned by dirtbikerxz. I actually had the cable but didn't realize what it was for. The cable ended up being a little quirky - the driver didn't work, and I had to download this alternate driver http://www.ifamilysoftware.com/news37.html, and the driver executable has to be run every time the cable is used. Also, when using the serial cable the putty window had some issues with command lines wrapping around.


All times are GMT -5. The time now is 09:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi