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.


Thursday, December 29, 2011

Place PDF from Google Docs into your Blog

Posted a how to post a Presentation from Google docs into your blog. Presented my findings to my friend and it got back again to me. "No is not a presentation but a pdf that I want to show" - he said. So lets start all over again but now with a pdf.
The PDF embed into this post has the details on how to, however I will quick break down the steps.

Will try to show in a few quick steps on how to

  1. We assume you have a pdf file already.
  2. Upload your pdf to your Google Docs account.
  3. Share your pdf and set it to be public.
  4. Copy the link given from Google Docs of your pdf
  5. Paste the link into the address bar of your browser
  6. Copy again the resulting link from the address bar of your browser
  7. On the address replace chrome=true to chrome=false and append to the end of the link "&embedded=true" (without the " )
  8. Place your resulting URL into this block
    1. <iframe height="780" src="MY_ADDRESS" style="border: none;" width="600"></iframe>
  9. Change width and height as needed.

Sample resulting block of code

<iframe height="780" src="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=false&amp;srcid=0B10UfrjZDyv1YzNiZDgzZTgtMWM2Mi00YmM4LTg3OGEtZWY3YjQ1NmExMGQz&amp;hl=en_US&amp;embedded=true" style="border: none;" width="600"></iframe>

Embedded PDF in action!





Hope this was useful to you!

Wednesday, December 28, 2011

How to link a Google doc presentation into your blog

Some time ago a friend asked me on how to share a document made in Google Docs from his blog. Well I said I don't know. But as the nerd that I am, could not stop me from finding out.

So here it goes in 5 steps.
1. Create the document (this you may already conquer!!, one down and four to go). Sample is a presentation.
2. Change the privacy settings of your document to make it "Anyone with the link"
3. Go into the right corner to Share - Publish/embed
4. Click on Publish Presentation
5. Copy and paste the code into your blog.

If the instructions are too hard for you, take a look at the presentation bellow.





That is all, hope it helps.

Monday, December 5, 2011

Am I that stupid developer?

Everyday I read stories in the web about someone (a developer) who do something awesome. Some great app or hack that for me seems to be impossible to accomplish.
I spend a lot of time on developer sites, reading and coding. But still I am able to accomplish very little. So it is normal to ask myself "Am I that stupid or are they so smart?". Probably the answer is a little of both (which one is more left to be seen).
All this just to say, if you are a developer or want to be. Please do not think of yourself less than others because of what some guys in the web do. There are a lot of brilliant guys out there and in my experience a lot of those brilliant guys can help during our late nights smashing our heads about a null pointer exception or a script error. Keep on programming, hacking or whatever is that rocks your boat. Because be sure that I will continue as well as a lot of other nerds like us.
Enjoy programming and developing, help others when you can and share what ever you can!
Happy programming for all who reads this (if any).

Friday, November 25, 2011

Android 2.3.7 on HTC myTouch3G

After a lot of time I could compile the cyanogenmod 7 for my phone (HTC myTouch 3G). It may be buggy or slow, but as a true nerd I do not care. It is something that you do because you can. So I am happy now.
Oh.. just saying is not perfect but anyhow I'm happy.
The video is very slow because video is captured through the adb. When the phone disconnected to the screen capture software it is "faster".

My broken droid

For all of you that have tried to compile the Android source code and run into a LOT OF ERRORS. Somehow "fix it" then another arises, "fix again" and then another.... And of course most of the fixes are commenting a line or skipping building certain module.
After searching the Internet, there are a lot of people that runs in same problems that i do. Some shows success after a while others (like me) decided to join forces between the head and the keyboard to see what comes out of it. Most of the time this solution only produces a headache.
Anyhow in the name of all us nerds that have very old phones and just for the fun of it want to port the latest version of Android to it. Please make the source building process a little easier. I have no solution since I am no expert so do not know what can be done. But there are smart people out there that can make this better and easier.
If you are like me trying to build this yourself for your phone, go ahead continue trying. I believe there is a small chance of success and you can achieve it.
Finished this post, lets get back to my crusade and see what's comes out of it.