Go to Post This our big chance to spread the word and change the culture, let's not waste it. So in the words of one Leroy Jenkins, "Time's up, let's do this." - Frenchie461 [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2009, 17:31
DtD's Avatar
DtD DtD is offline
I hope the watchdog starves!
AKA: Pathogen David
FRC #2410 (The Metal Mustangs (Merged from 2334, Hazmat Robotics))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Kansas
Posts: 86
DtD will become famous soon enoughDtD will become famous soon enough
Batch files to switch between DHCP and Static IP

I made these batch files to switch between Static IP and DHCP in Windows. I use them because I use my laptop's Wireless at school, and wired to program our robot, but at home I use the Wired.

To use them, just paste the commands in notepad and save as a .bat (EG: "cRIO Mode.bat" or "Internet Mode.bat")

cRIO / Static IP Mode:
Code:
@echo off
netsh interface ip set address name="Local Area Connection" static 10.23.34.6 255.0.0.0 10.23.34.4 1
pause
NOTE: You need to change the addresses to your team number. We are 10.23.34.*, but you probably aren't!

DHCP Mode:
Code:
@echo off
netsh interface ip set address "Local Area Connection" dhcp
pause
~DtD
PS> If you typically use a static IP when not talking to your robot, and you need to configure DNS servers too, then use these commands:
Code:
netsh interface ip set dns "Local Area Connection" static 208.67.222.222
netsh interface ip add dns "Local Area Connection" 208.67.220.220 index=2
That sets it to use OpenDNS...
  #2   Spotlight this post!  
Unread 17-01-2009, 20:45
Peter Randall Peter Randall is offline
Director of Technology
FRC #1218 (Vulcan Robotics)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Philadelphia
Posts: 37
Peter Randall will become famous soon enoughPeter Randall will become famous soon enough
Re: Batch files to switch between DHCP and Static IP

Thanks,

Been switching 4 times a day.

PGR
__________________
Peter Randall
Chairman, Department of Engineering & Robotics
Springside Chestnut Hill Academy
TEAM 1218
  #3   Spotlight this post!  
Unread 17-01-2009, 21:59
DtD's Avatar
DtD DtD is offline
I hope the watchdog starves!
AKA: Pathogen David
FRC #2410 (The Metal Mustangs (Merged from 2334, Hazmat Robotics))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Kansas
Posts: 86
DtD will become famous soon enoughDtD will become famous soon enough
Re: Batch files to switch between DHCP and Static IP

No problem, glad sombody else found it useful!

~DtD
  #4   Spotlight this post!  
Unread 17-01-2009, 23:40
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: Batch files to switch between DHCP and Static IP

Helps with more than just robotics. I have to switch all the time for various reasons. This will make life so much easier. Thanks.
  #5   Spotlight this post!  
Unread 18-01-2009, 10:51
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,609
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Batch files to switch between DHCP and Static IP

I got tired of switching back from static to DHCP...

I found a way to set the router to hand out DHCP addresses at 10.XX.XX.6 so your laptop doesn't have to switch to static.

DHCP router settings can be a problem if you have many laptops that are all trying to program and connect to the router at the same time.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
  #6   Spotlight this post!  
Unread 18-01-2010, 02:55
Doc Wu's Avatar
Doc Wu Doc Wu is offline
Registered User
AKA: Al Gritzmacher
FRC #1507 (Warlocks)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Lockport NY
Posts: 206
Doc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant future
Re: Batch files to switch between DHCP and Static IP

Just a tip. If you try to do this with Windows 7 (and I believe Vista as well) the syntax will be slightly different.

Code:
netsh interface ip ....
becomes

Code:
netsh interface ipv4 ....
due to support for IPV6 addresses.

Code:
netsh /?
gives help info.
__________________
-= Mentor Lockport Warlocks -=- Team 1507 =-
Amateur Radio Callsign: AE2T

2015 Robot Inspector - Pittsburgh, Champs. Judge Observer - Champs
2014 Robot Inspector - Tech Valley, Fingerlakes, Buckeye, Championship
2013 Robot Inspector - Fingerlakes, Buckeye, Championship
2012 Robot Inspector - Fingerlakes, Buckeye, Championship
2012 Website Evaluator - Fingerlakes, Buckeye, Championship
2011 Robot Inspector - Fingerlakes 2011 Safety Advisor - Fingerlakes

  #7   Spotlight this post!  
Unread 18-01-2010, 09:35
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: Batch files to switch between DHCP and Static IP

Just so you are aware, you only need to be 10.x.x.6 if you want to be the Dashboard machine.

You can download and/or run using any 10.x.x.* address. The Dashboard.VI even has a forwarding address to redirect that data to another machine.

We setup our wireless router to give out 10.x.x.50 and above IP addresses, so we can still DHCP setup.

10.x.x.1 Wireless Bridge on Robot
10.x.x.2 CRIO
10.x.x.3 Reserved
10.x.x.4 Wireless Router
10.x.x.5 Driver Station/Classmate
10.x.x.6 Development System

Last year a PC instead of the Classmate with an address of 10.x.x.6 could be used as a Dashboard display machine.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics



Last edited by Phalanx : 18-01-2010 at 10:05.
  #8   Spotlight this post!  
Unread 18-01-2010, 20:50
DtD's Avatar
DtD DtD is offline
I hope the watchdog starves!
AKA: Pathogen David
FRC #2410 (The Metal Mustangs (Merged from 2334, Hazmat Robotics))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Kansas
Posts: 86
DtD will become famous soon enoughDtD will become famous soon enough
Re: Batch files to switch between DHCP and Static IP

In general, I have noticed that the cRIO and friends are MUCH less finicky about what thier IPs are and such. We only used static for reimaging the cRIO. I have tested numerous network configurations, and both Windriver and the Driver Station (Updated One) seem to always find it.

EG: One of the configs I did was:
cRIO <-> WiFi Brick (The black one)

WiFi Router (One with the blue spoiler) <-> Internet

My dev laptop and Driver Station connected to WiFi router over WiFi. (DS needs to be updated or this fails, set up WiFi network in Developer)


If you do use WiFi with the Classmate, I HIGHLY advise you delete the WiFi profile before competition, the Classmate did not like it with WiFI attempting to work and connection over LAN.

~DtD
  #9   Spotlight this post!  
Unread 28-01-2010, 06:50
sarienbarry sarienbarry is offline
Junior Member
no team
 
Join Date: Jan 2010
Location: sarienbarry
Posts: 4
sarienbarry is an unknown quantity at this point
Re: Batch files to switch between DHCP and Static IP

I use WinXP Professional at home and office. Although I have the same ISP at both, I am required to change the IP address depending on where I am.

I need one script or batch file that I can run under WinXP that will automatically change my IP from:

172.16.10.23 to 192.168.11.8

Then another script that will change it back.

Hopefully a simple problem if you know how!
Thanks
  #10   Spotlight this post!  
Unread 28-01-2010, 14:27
DtD's Avatar
DtD DtD is offline
I hope the watchdog starves!
AKA: Pathogen David
FRC #2410 (The Metal Mustangs (Merged from 2334, Hazmat Robotics))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Kansas
Posts: 86
DtD will become famous soon enoughDtD will become famous soon enough
Re: Batch files to switch between DHCP and Static IP

Yes, it should be simple. Just use the first command. I belive 10.23.34.6 is the ip address, and 10.23.34.4 is the gateway.

Just put in your addresses!

~DtD
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching between Hybrid and User-Controlled Zyklon Programming 3 13-02-2008 08:30
interference between wires and connectors Dan Zollman Inventor 5 18-12-2006 15:11
Relationship between wheel type and power Nitroxextreme Technical Discussion 3 13-01-2006 21:30
Free and easy to use software for batch image watermarking/text stamping? Elgin Clock Computer Graphics 2 27-06-2005 17:25
Toggle between in and out (Pneumatics) RAWdealer59 Programming 7 17-02-2003 11:32


All times are GMT -5. The time now is 02:38.

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