Go to Post Here is one really important thing I learnt this season: If you do it for yourself, you ain't gonna make it. If you do it for you're team, You'll make it. - Bharat Nain [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-11-2016, 06:30
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 28
acastagna is an unknown quantity at this point
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 24-11-2016, 07:17
sysdes sysdes is offline
Engineering Mentor
AKA: Maurice Veldhuis
FRC #4678 (CyberCavs)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Drayton, Ontario
Posts: 9
sysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant future
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-11-2016, 07:56
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 28
acastagna is an unknown quantity at this point
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-11-2016, 09:54
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 985
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Raspberry Pi IP Address

Quote:
Originally Posted by sysdes View Post
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-11-2016, 10:32
dirtbikerxz's Avatar
dirtbikerxz dirtbikerxz is offline
Captain | Driver | CAD | Junior
AKA: Rohit Gondi
FRC #3991 (KnightVision)
Team Role: Driver
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Baton Rouge, LA
Posts: 438
dirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud of
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.
__________________

Team 3991: Driver since freshman (2015-), Captain since sophomore (2016-), CADer
"The human condition is not perfect. We are not perfect specimens, any of us. We're not robots." - Michael Ovitz
My posts may or may not reflect the views of my team, they are my opinions, and mine alone.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-11-2016, 13:18
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,342
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
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.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #7   Spotlight this post!  
Unread 24-11-2016, 14:17
snekiam snekiam is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2010
Location: SE Michigan
Posts: 83
snekiam has a spectacular aura aboutsnekiam has a spectacular aura aboutsnekiam has a spectacular aura about
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 24-11-2016, 14:40
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Raspberry Pi IP Address

Quote:
Originally Posted by acastagna View Post
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?
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #9   Spotlight this post!  
Unread 27-11-2016, 19:17
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 28
acastagna is an unknown quantity at this point
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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