Go to Post math can actually be fun! - Karthik [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 29-01-2014, 20:53
3883Rodney's Avatar
3883Rodney 3883Rodney is offline
Registered User
AKA: Rodney Braun
FRC #3883 (Databits)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Cottage Grove, MN
Posts: 8
3883Rodney is an unknown quantity at this point
Batch program to connect to robot and back

A programmer on our team has written a batch script to connect to the robot over Wi-fi or Ethernet and then back to the internet. Here is the latest version 2.1. Credit to this thread for providing the basic command. Be sure to change the team number in the settings section(enter the first two numbers then second).

Robot Connector Pro v2.1.txt
And for those of you with bluetooth

Robot Connector Pro v2.1 with bluetooth support.txt
Change to *.bat and you are good to go.
  #2   Spotlight this post!  
Unread 30-01-2014, 10:47
mgerber's Avatar
mgerber mgerber is offline
Shoddy Programmer
AKA: Max Gerber
FRC #0223 (Xtreme Heat)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: New Jersey
Posts: 21
mgerber is on a distinguished road
Re: Batch program to connect to robot and back

In the code for Settings one line currently reads
Code:
if %input% == 6 goto mainmenu
Should that be menumain? Other than that, it looks good to me so far.
  #3   Spotlight this post!  
Unread 30-01-2014, 12:25
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Batch program to connect to robot and back

I just use DHCP, so I typically have no problem. I also found it useful to plug in the robot to the wall ethernet so you can get internet through the robotfi, while developing/debugging applications.

If you need to keep changing settings, I think you are doing something or the other wrong!!!
  #4   Spotlight this post!  
Unread 30-01-2014, 14:35
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 535
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Batch program to connect to robot and back

Looks nice, needs mgerber fix, I think.

Here is ours, I only share, as we have multiple bots in testing phases, and we assign team numbers close to ours, may make you think about adding that option.

We also have an option to go do the dlink default address, but with the configuration program, that manual setting of the wireless is not cumbersome.

Code:
@ECHO off
cls
:start
echo.
echo ***********************
echo *** TORC Network    ***
echo *** Interface IP    ***
echo *** Setting Tool    ***
echo ***********************
echo * SAM ver2 8/30/2012  *
echo ***********************
echo.
ECHO 1. Set Network Interfaces to DHCP
ECHO 2. Set Network to 192.168.0.51 dlink default 192.168.0.50
ECHO 3. Set Network to 10.21.36.x Testing Robot (Arduino Bot uses .35 .36)
ECHO 4. Set Network to 10.21.37.x Competition Robot
ECHO 5. Set Network to 10.21.38.x Testing Robot
ECHO 6. Set Network to 10.21.39.x Testing Robot
ECHO 7. Set Network to 192.168.1.x Arduino Bot
ECHO.
set /p choice=Type the number to select option.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto dhcp
if '%choice%'=='2' goto 192
if '%choice%'=='3' goto 36
if '%choice%'=='4' goto 37
if '%choice%'=='5' goto 38
if '%choice%'=='6' goto 39
if '%choice%'=='7' goto Arduino
ECHO "%choice%" is not valid please try again
ECHO.
goto start
:dhcp
echo.
echo ***********************
echo *** Setting Wired   ***
echo *** and Wireless to ***
echo ***      DHCP       ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" dhcp
netsh interface ip set address name="Wireless Network Connection" dhcp
ipconfig /release
ipconfig /renew
goto end
:192
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  192.168.0.51   ***
echo *** and Wireless to ***
echo ***  192.168.0.52   ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=192.168.0.51 mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=192.168.0.52 mask=255.255.255.0
goto end
:36
set /p choice=Type the number of last IP value range 10 to 99.
rem if not '%choice%'=='' set choice=%choice:~0,1%
set /a choice1=%choice% + 1
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  10.21.36.%choice%    ***
echo *** Wireless to     ***
echo ***  10.21.36.%choice1%    ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=10.21.36.%choice% mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=10.21.36.%choice1% mask=255.255.255.0
goto end
:37
set /p choice=Type the number of last IP value range 10 to 99.
rem if not '%choice%'=='' set choice=%choice:~0,1%
set /a choice1=%choice% + 1
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  10.21.37.%choice%    ***
echo *** Wireless to     ***
echo ***  10.21.37.%choice1%    ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=10.21.37.%choice% mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=10.21.37.%choice1% mask=255.255.255.0
goto end
:38
set /p choice=Type the number of last IP value range 10 to 99.
rem if not '%choice%'=='' set choice=%choice:~0,1%
set /a choice1=%choice% + 1
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  10.21.38.%choice%    ***
echo *** Wireless to     ***
echo ***  10.21.38.%choice1%    ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=10.21.38.%choice% mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=10.21.38.%choice1% mask=255.255.255.0
goto end
:39
set /p choice=Type the number of last IP value range 10 to 99.
rem if not '%choice%'=='' set choice=%choice:~0,1%
set /a choice1=%choice% + 1
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  10.21.39.%choice%    ***
echo *** Wireless to     ***
echo ***  10.21.39.%choice1%    ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=10.21.39.%choice% mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=10.21.39.%choice1% mask=255.255.255.0
goto end
:Arduino
set /p choice=Type the number of last IP value range 10 to 99, excluding 20 and 21.
rem if not '%choice%'=='' set choice=%choice:~0,1%
set /a choice1=%choice% + 1
echo.
echo ***********************
echo *** Setting Wired   ***
echo ***  192.168.1.%choice%   ***
echo *** Wireless to     ***
echo ***  192.168.1.%choice1%   ***
echo ***********************
echo.
netsh interface ip set address name="Local Area Connection" source=static addr=192.168.1.%choice% mask=255.255.255.0
netsh interface ip set address name="Wireless Network Connection" source=static addr=192.168.1.%choice1% mask=255.255.255.0
goto end
:end
echo.
echo ************************
echo ***    All Done      ***
echo ************************
echo.
@pause
exit
__________________
The sooner we get behind schedule, the more time we have to catch up.

  #5   Spotlight this post!  
Unread 30-01-2014, 22:04
3883Rodney's Avatar
3883Rodney 3883Rodney is offline
Registered User
AKA: Rodney Braun
FRC #3883 (Databits)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Cottage Grove, MN
Posts: 8
3883Rodney is an unknown quantity at this point
Re: Batch program to connect to robot and back

My programming student, Jude, says thanks for the typo fix. He has implemented the fix already. Thanks for the positive feedback tr6scott and a look at your code. It was very helpful.
  #6   Spotlight this post!  
Unread 01-02-2014, 21:33
evan1026's Avatar
evan1026 evan1026 is offline
Programmer extraordinaire ... ish
AKA: Evan Allan
no team
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: USA
Posts: 6
evan1026 is on a distinguished road
Re: Batch program to connect to robot and back

I don't know if you'd be interested, but our team recently found a program called NetSetMan. It's really cool, because you can set network-specific settings, like IP addresses and whatnot. It really eliminates the pain of having to reset the IP every time; all we have to do is click on the robot network in its menu. Might be worth checking out.
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


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

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