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 https://github.com/asynclabs/WiShield
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.



Tuesday, January 10, 2012

Repo Sync of cyanogenmod 9

After long time with problems downloading the CM9 source code for Ice Cream Sandwich. Apparently is downloading now.
The error message that haunted me was:


Fetching projects:  95% (232/244)  From https://github.com/CyanogenMod/android_prebuilt
 * [new branch]      gingerbread -> github/gingerbread
 * [new branch]      gingerbread-release -> github/gingerbread-release
 * [new branch]      ics        -> github/ics
Fetching projects:  99% (242/244)  error: Cannot fetch CyanogenMod/android_frameworks_ex

In order to solve this from a forum (http://forum.cyanogenmod.com/topic/39528-cant-dl-source/) had the link for the correction in the manifest.

To fix I did this:
1. Replace the default.xml manifest file from SOURCEDir/.repo/manifest/default.xml with the one from http://r.cyanogenmod.com/#patch,sidebyside,11353,1,default.xml . (please use the new one)
2. In my case since the problem was with one specific project, I did removed completely the folder SOURCEDir/.repo/projects/framework/ex completely.
3. repo sync  (this fixed all and recreated the project ex with the correct stuff)

Now the actual compiling is the challenge, but fun to do. Programming = 0, just copy paste and commenting stuff. Maybe eventually something will come out. But every build takes a lot of time just to know that I'm still missing something.