Wednesday, January 25, 2012

Black Widow Arduino first take

A few months ago a friend and I ordered a pair of Arduino Black Widow 1.0 (an Arduino with Wifi). So after a very long time, today decided to plug it in. After searching on the web how to, and literally because I had no idea what to do.
First downloaded the Arduino IDE on Ubuntu and installed (that was easy). But after I had no idea where to start looking.  Googleing and a few Arduino wikis and got exactly what I needed. Some web server and libraries. Downloaded and BAZINGA! it is on the wifi.

If you have to do and you are a "newbee" like me:
1. Download Arduino IDE (my case ubuntu, from the software center like any other program).
2. The black widow is an "Atmel ATmega328P" so I selected from the IDE on Tools->Board->Arduino Duamilanove or Nano/Atmega328
3. Downloaded the Wishield library from the github repo
4. You may download as a zip file if you like. In that file there is a folder for examoples that you can download where ever, and the code .c,.h files freely I copied them into /usr/share/arduino/libraries/WiShield (Wishield had to be created by me) with "sudo mkdir /usr/share/arduino/libraries/WiShield" and copied the files files that were not in a directory from the Wishield repo into that new folder.
5. Restarted the Arduino IDE.
6. Opened the Web Server project, click on the play button, no errors so clicked on the upload button and waited.
7. Configure your WIFI password and the IP

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,10,5}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,10,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"MYSSID"}; // max 32 bytes
unsigned char security_type = 3; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"WAPPassword"};

8. It downloaded to the Arduino (ok you must had plugged the Arduino to your USB) so it took a little time (less that 30 seconds) and the blue led came steady ON indicating that it was on the network.
9. Went into my web browser typed in the manually assigned IP address of the arduino and that's it. It is online!

So now you and I officially deployed an app to the Arduino, let's see what else (some other day).
Oh by the way, my girlfriend said "What is that", and I like a good nerd "Oh this is an Arduino, a micro-controller that can be used for a lot of cool things...". Sadly she cut me short just by saying "Ok, I really don't care". So sad right! We nerds that is our cross.