Ok, I don’t how it works with you guys and your team, but for us, electrical and programming are kinda mashed into one and there is one to two people that are really involved on the sub team at all. Well this year, I’m that guy. Now when we do PR events we like to have someone with a base of knowledge in electrical/programming to both talk to people, and fix problems. Well I’m a busy man, and can’t make every event. Soooooo I have started to build a base of resources and help for the “mechys” to follow when I am unavailable. Currently I am writing a .bat on a thumbdrive so the can plug it in, hit go, and it walks them through/does it for them, set up a router, bridge, and ds, from default settings… this is where i need YOU! I would like to make it click go and boom, done, but this is nearly impossible, so things done physically i plan on just doing “echo (instructions) pause” now ive also been playing around with importing a routers config file ect ect… so basically, i want a thumb drive that when plugged in, has a batch file that will set all the necessary network devices to get it working. (it seems the wireless networking is what most of my mechanical friends call me about) Thoughts, Input, examples, maybe the file itself already exists?? ahhaha thanks all!
If you do this please share because I have come into to many situations like this.
I started writing it…
@echo off
color 57
echo Welcome to Seth’s epic radio setting program!
pause
cls
echo by inserting this flashdrive you have activated my robot wireless network configuration program. This program is designed to alter both your computer settings router and bridge.
set /p z=Would you like the program to continue editing your current settings (y/n)?
if /i “%z%” EQU “y” GOTO :yes
if /i “%z%” EQU “n” GOTO :no
:yes
echo You have selected yes! Configuration will continue on keypress!
pause
cls
echo Before we begin configuration please be sure that you have the bridge on the robot powered on and connected to the cRio. Now connect the field router to this machine (be sure you aren’t in the internet uplink port on the router!!!) PLEASE NOTE: The current version of this program requires you to manually reset the bridge and router to factory defaults. Please ensure you have completed that first. Configuration will continue on keypress.
pause
cls
echo Configuration Proceeding
timeout 3
echo Setting IP address and Subnet
netsh interface ip set address name=“Local Area Connection” source=static addr=192.168.1.104 mask=255.255.255.0
echo Setting Gateway
netsh interface ip set address name=“Local Area Connection” gateway=192.168.1.1 gwmetric=0
echo Done!
timeout 5
cls
echo Here are the new settings on this machine
netsh interface ip show addresses “Local Area Connection”
pause
echo now that your computer has the neccessary settings, the program will now open the GUI on the router. The username and password is admin and admin respectively. Remember Internet Explorer will launch and cover this program, remember to bring it back to the front to continue with instruction.
pause
cls
start iexplore.exe 192.168.1.1
echo Now that you are logged in navigate to the administartion tab, and the configuration management. Click the button that says “Restore”
echo.
echo now restore with the file named “Router Configuration”. Navigate to this file on keypress.
pause
cls
start S:\armory
echo after Router Configuration has been loaded, proceed with setup by pressing any key.
pause
echo Congratz! ur router haz the appropriate settings!! Now unplug this machine form the router and plug it into an open port on the bridge. Ensure your bridge is powered on. Continue on keypress after all this has been completed.
pause
cls
echo Configuration Proceeding
timeout 3
echo Setting IP address and Subnet
netsh interface ip set address name=“Local Area Connection” source=static addr=192.168.0.51 mask=255.255.255.0
echo Setting Gateway
netsh interface ip set address name=“Local Area Connection” gateway=192.168.0.50 gwmetric=0
echo Done!
timeout 5
cls
echo Here are the new settings on this machine
netsh interface ip show addresses “Local Area Connection”
pause
cls
echo Now, once again the program will now load the robots radio’s GUI. Please note this program is running in the background, after IE is launched bring this program back to the front to continue instruction. It will launch on keypress.
pause
start iexplore.exe 192.168.0.50
echo the Username is admin and the password is left blank. Once you are in, navigate to the Mantainence tab. Once there pick System on the left sidebar. Choose “Load from Local Harddrive” you want to load S:/armory/bridge Configuration. it will open on keypress.
pause
cls
start S:\armory
echo after everything has been loaded to both the Router and Robot Radio, plug this machine back into the router. (MAKE SURE IT ISN’T IN THE INTERNET UPLINK PORT!) After this is completed, press any key.
pause
echo OK! Now we are almost done! This will set this machines network settings to what it needs to control the robot.
pause
cls
echo Configuration Proceeding
timeout 3
echo Setting IP address and Subnet
netsh interface ip set address name=“Local Area Connection” source=static addr=10.16.25.5 mask=255.0.0.0
echo Setting Gateway
netsh interface ip set address name=“Local Area Connection” gateway=10.16.25.4 gwmetric=0
echo Done!
timeout 5
cls
echo Here are the new settings on this machine
netsh interface ip show addresses “Local Area Connection”
pause
cls
echo CONGRATZ!! You are all ready to go! On keypress the program will launch driverstation! you should be good to go. If there are still problems, call me, seth, or refer to the Readme. in S:
pause
cls
echo have fun!!! Love Seth.
pause
start driver station.exe
exit
:no
echo You have selected no and have quite possibly made the worst decision of your miserable life! Program will close on keypress!
pause
cls
exit
I wrote a couple batch files last season for just setting my computer’s IPs in between DCHP and FRC static, as well as for pinging the cRIO. Here’s my IP change batch files, in case anyone’s interested:
To Static:
@ECHO OFF
cls
ECHO Setting defualt FRC Static IP addresses:
ECHO Wireless Address: 10.11.24.7
ECHO Subnet: 255.255.255.0
ECHO Gateway: 10.11.24.1
netsh int ip set address "Wireless Network Connection" static 10.11.24.7 255.0.0.0 10.11.24.1 1
ECHO Done!
exit
To DHCP:
@ECHO OFF
cls
ECHO setting wireless adapter and DNS to DHCP
netsh interface ip set address name="Wireless Network Connection" dhcp
netsh interface ip set dns name="Wireless Network Connection" dhcp
ECHO Done!
Sweet! so I am a programming illiterate (some what). I am not familiar with batch files, is there a tutorial somewhere, where I could learn how to compile and run this code?
- save as *.bat
- double click
OR
- Save on flashdrive as autorun.bat
- Plug in flashdrive
Yup, just save and run the file. Windows takes care of the rest (and double checks you want to modify your computer’s settings).
If you want to learn to write batch files, they’re basically a script of Windows shell commands. You can find some more information about them here.
Pretty sweet. It’s really the exact IPv4 settings for everything that gets them confused… so I am basically setting their IP, hitting the GUI and telling them to load config files for each component from the same flashdrive. I’m working out the kinks… Read some of it above… is there any changes or possible additions?? Right now, its on a flashdrive as an .exe via (.bat to .exe) with an autorun.ini a folder called “armory” which is all the resources and config files and the icon (winnovation logo!!! ) and a README i typed up including factory reset instructions… Our DAP-1522 is being a pain, I must work on it… also autorun is being sorta a pain, thats what im working on now, I must refine the actual .bat a little too. But Plug in flashdrive and BOOM! is really nice and worth the work in my eyes.