== README == == SOFTWARE SETUP == Open Nios II Software Build Tools for Eclipse. We used version 12.1sp1 (12.1.1.243). Create a new project using "File > New > Nios II Application and BSP from Template". Browse for the SOPC Information File and select "system.sopcinfo" in your project folder. Name your project--we called ours "WifiDemo"--and use the template "Hello MicroC/OS-II". Click "Finish". Replace the default file "hello_ucosii.c" with "main.c". Right-click on your project and click "Refresh (F5)", then go to "Project > Clean...", choose "Clean all projects", and click "OK". Open up "main.c". If you have any unresolved inclusions, build the project using "Project > Build (Ctrl + B)". There should be no more errors. Enter your network details in the defines at the top of "main.c": // NETWORK SETUP #define SSID "ARCap" // The name of your SSID #define SECURITY_KEY "playthegame" // The security key for your SSID #define SERVER_ADDRESS "192.168.0.100" // The IP address of your server #define SERVER_PORT "2710" // The port that your server listens on, in hex (e.g. "50" for port 80) /** * Whenever you run, you can either set the network details above or print the current details. * The network details are saved on the Xbee wifi module in nonvolatile memory, * so you only need to run the setup on the first run and every time you change the details. * Set RUN_SETUP to true to set new network details. * Set RUN_SETUP to false to print the current network details. */ #define RUN_SETUP true // NETWORK MESSAGES #define SERVER_HOSTNAME "surface" // The name of your server computer #define TCP_TEST_MESSAGE "+r1" // The message to send over the TCP socket #define TCP_STOP_MARKER "\n" // The string that marks the end of a TCP message #define HTTP_TEST_PAGE "/arcap/infrared/hit.php" // The page to send an HTTP GET request for // Choose the type of test to run. typedef enum { WIFI_TEST_TCP, // Sends the TCP_TEST_MESSAGE and prints the response. Use if you have a TCP socket server. WIFI_TEST_HTTP // Sends an HTTP GET request for the HTTP_TEST_PAGE and prints the response. Use if you have an HTTP server. } WifiTestType; WifiTestType TEST_TYPE = WIFI_TEST_TCP; Right-click on your project and click "Run > Run as > NIOS II Hardware". You may need to run the project again; I've noticed that the program may not print to the console on the first run after programming the device. If there is an error when you run your project, you may need to go to "Run > Run Configurations > Target Connection > Refresh Connections".