TETRIX Samantha Module

From ROBOTC API Guide
Revision as of 13:03, 27 July 2012 by Jwatson (Talk | contribs)

Jump to: navigation, search
TETRIX → TETRIX Samantha Module


Gather the Required Information

Before you can use your Samantha Module with ROBOTC, you must install the Windows drivers and set the device up for use.

Note: There are many different router configurations, and many different combinations of network type, encryption type, etc. We are using a commonly used network setup (with the router in between the computer and modem with standard encryption). Your particular setup may be different, and may require additional steps to set up properly.

1. The first thing we will want to do is download and install FTC's Field Control Software package. This can be found on FIRST's site (usfirst.org).
2. Next, we will need the SSID, encyption type, and password for the network we wish to connect to. For testing purposes, we named our router "SamoTest1" with an encryption type of WPA (TKIP).
3. You will also need a 4GB or smaller USB flash drive, formatted to FAT32 file format. To format the flash drive, navigate to the Start menu, select Computer, right click on the flash drive's name, then click Format. In the drop down box, select 'FAT32' as the file format, and check the 'Quick Format' box (for a faster format).
4. Navigate to the Start menu, All Programs, Samantha Field Control System, and start the program called "Samantha Network Config".
5. Close the program and navigate to your ROBOTC installation folder (default location of C:\Program Files(x86)\Robomatter Inc\ROBOTC Developement Environment). Navigate to the Firmware folder and copy the Samantha.hex file into your flash drive. You should also see a folder named "SMRTNTKY"; this is where the Network Config tool saved the config file for your network.


Flash the Samantha Module

You must now update the Samantha Module's firmware and install the config file you created using the Network Config tool; otherwise the Samantha Module will not recognize your network.
1. Unplug the USB flash drive from your computer and (making sure the battery is unplugged) plug it into the Samantha Module. Plug in the battery while holding down the red/black button on top of the module. Release the button approximately 3 seconds after the red light appears on the module.
2. The Samantha Module will flash the red light twice in rapid succession and then flash the white repeatedly. You may also see the flash drive's LED flickering (if applicable). This means the Samantha Module is installing the firmware. When it's done, it will flash the red, white, and blue lights in sequence, then repeat the process. Be patient; this process normally takes 20-30 seconds and as long as 2-3 minutes. When it is done it should have a solid red light and a blinking white light (meaning it is connected to the network).


Installing and Updating the NXT

1. Like all other Windows devices, the NXT requires a driver in order to work properly. You can find the NXT drivers here on ROBOTC's website. Download and install it.
2. Next, download ROBOTC's firmware to the NXT. To do this, connect the NXT to the computer and turn it on. Navigate to the Robot menu in ROBOTC and make sure that "LEGO MINDSTORMS NXT+TETRIX" is chosen as the 'Platform Type' and that 'Physical Robot' is chosen in 'Compiler Target'. Then, click Download Firmware->Standard File to download the ROBOTC firmware to the NXT (this should take anywhere from 10 seconds up to a minute).
3. Navigate to File->Open Sample Program->NXT->Samantha Module->samostat.c. Compile and download this program onto the NXT brick.
4. Navigate to Robot->NXT Brick->Communication Link Setup and change the 'Search Selection' drop down menu to "USB, Bluetooth, or Wifi". This will enable ROBOTC to search your network for the NXT once it is connected. Click close to save the changes.


Connecting the NXT and Samantha Module

1. Keeping the USB-B end connected to the NXT, disconnect the USB flash drive from the Samantha Module and the USB-A connector from the computer. Connect the USB cable to the Samantha Module instead.
2. Turn on the NXT and th Samantha Module if you have not done so already. The NXT will show that it is connected via USB and the Samantha Module's 'NXT' LED should turn a solid blue (it may flicker from time to time; this means that it is transferring data to the NXT).
3. If the blue NXT does not light up, press the red/black button on top of the Samantha module.
4. Run the "samostat" program on the NXT. After a few seconds, it should connect to the wireless network through the Samantha Module and display information such as the SSID, IP address, etc. You can then type in the IP address displayed into a web browser to pull up the Samantha Module's NXT Status Page.
5. Open a program in ROBOTC, compile it, and download it to the NXT. If everything is setup correctly, the program should download and compile with no issues. Congratulations! You've successfully set up and connected your Samantha Module through ROBOTC.