Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Batch program to connect to robot and back (http://www.chiefdelphi.com/forums/showthread.php?t=125461)

3883Rodney 29-01-2014 20:53

Batch program to connect to robot and back
 
2 Attachment(s)
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).

Attachment 16013
And for those of you with bluetooth

Attachment 16014
Change to *.bat and you are good to go.

mgerber 30-01-2014 10:47

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.

yash101 30-01-2014 12:25

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!!!

tr6scott 30-01-2014 14:35

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


3883Rodney 30-01-2014 22:04

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.

evan1026 01-02-2014 21:33

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.


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

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