WARNING: When playing with lasers always wear safety glasses. Lasers can permanently damage your eyes, by proceeding reading the info shown here
you relieve the author of this blog from any liability arising
from using the informations written here.
If you're a geek, you know this is going to happen to you sooner or later in your life,
you need a laser line for your 3D scanner / water level, you-name-it diy project.
Chances are you only have a low-powered red laser lying around, the ones you usually see on keychains on pencils. you already know you can turn it into a laser line by using an optical fiber so you don't lose power however what if you just have a paper clip?
no problem!
Pick the paper clip and bend it in a L-shape Here I used a clip used to keep a shirt folded.
Then polish the piece that will be reflecting the laser with some rubbing alcohol.
Now attach the L-shaped paper clip so a piece of the clip is perpendicular to the laser beam,
play around with the position by looking at the projected laser line, move around the clip until you get a nice, focused laser line.
Once you're happy with the line projected, fix
the paper clip with some tape or, better, some Blu-Tack (or Patafix if you're from UE :)
By using Blu-Tack you'll be able to move around the paper clip and it will just stay where you last put it.
If you're building this to use the laser line for a 3D scanner i suggest you to find a position for the clip so the line is very focused for a long segment.
There you go, a laser line from a low powered laser pointer in less than a minute ;)
WARNING: When playing with lasers always wear safety glasses. Lasers can permanently damage your eyes, by proceeding reading the info shown here
you relieve the author of this blog from any liability arising
(This post is a work in progress, please come back later)
Why
We need to setup a linux machine to compile our arm kernel and modules,
in order to do this I've opted to make a linux virtual machine.
There are various reasons why a virtual machine is preferred vs the linux box I'm using daily,
first of all a development box can break quite easily,
you'll be using a lot of tools which depends on libraries that can get updated and break things,
also you need to have some specific versions of some apps for compatibility reasons
and it is not a good idea to browse the web using old apps as they can be remotely exploited,
so it is a good idea to have a separate box where you have total control on what you update and what not.
Also, by having a linux virtual machine you can easily transfer the virtual hard disk image on another computer
and continue your development like nothing has happened or share the virtual machine between windows and linux,
it also allows for easy backups, you can just make a copy of the virtual hard disk, try something and if it breaks, no problem,
just restore the backup file. so win win!
Setup the virtual machine
Go to http://www.virtualbox.org and download the latest available version for your host os, download the Extension Pack too and install both.
We'll be using lubuntu 12.10 as our linux guest machine, as it is a good starting point for what we need, also by using lxde it is lightweight to run inside a virtual machine,
once you have the iso, create a new virtualbox machine.
I won't go into much detail here as there are a lot of resources about this, just make sure to enable PAE into system tab.
When the installation process finishes and you're asked to reboot, click ok, eventually the virtual machine may hang up at this point,
just wait a minute then turn off the virtual macchine, start again and boot your new lubuntu box,
on your first login you'll be asked to update some packages, do it right away,
we need an up-to-date installation as we'll need various tools and by having a stable, current release, any tool we need is just an apt-get install away,
once we're happy with our environment we may froze the current software so we'll be sure not to occur into compatibility issues and we'll selectively update
things from now and then.
Once you've updated everything head over to install Guest Addition and reboot the virtual machine.
we need now to setup our arm development environment!
Setup the development environment
Thanks to AMLogic effort to release kernel sources and info on how to compile the kernel,
we can setup or arm development environment for amlogic boards.
First of all we need to setup a standard development environment so open a terminal, and install a dev env using this:
$ sudo apt-get install build-essential
this will install gcc, make and some standard libs
Share files between host os, guest os and android device
We'll need to transfer a lot of files between host os, guest os and the android device,
there are many ways to do this, I've chosen to setup an ftp server on the guest os and to make it available
on the internal network so it can be accesses by both the host os and the android device.
Download and setup vsftpd, on the guest os (the arm dev machine) do:
$ sudo apt-get install vsftpd
this will install vsftpd. by default write access is disabled so if you try to upload a file
you'll get this error message:
"
200 PORT command successful. Consider using PASV.
550 Permission denied.
"
to allow write access, edit /etc/vsftpd.conf and find this line:
# Uncomment this to enable any form of FTP write command.
#write_enable=yes
uncomment the line above, you may also want to further customize the ftp server by disabling anonymous logins
and so on, when you're happy with the config, save and restart vsftpd by using
$ sudo service vsftpd restart
now you can login to your ftp server and upload/download files.
Download, configure and install some tools
create the dir tools on your home, here we'll download and compile some tools.
(this post is a work in progress, please come back later)
As said before, this guide is tailored around Ramos W6HD,
the first thing we need to do is to get root access and install a debian system using chroot.
Rooting Ramos W6HD.
There are various ways to root the w6hd, the easiest one is to flash a firmware which
already has root.
We'll also need play store access to easily download some apps like connectbot, vnc, Screen Standby and so on, so let's just use a firmware which already come with gapps.
We'll use Librehat's ICS HatMod.
Make a backup copy of all your data, then download ICS_HatMod_for_W6HD_1.9.7z,
and unzip it in the root of your sdcard.
I suggest you to use a card reader to transfer the files since the usb connection of the ramos
is not so speedy.
Fully charge your w6hd then turn it off.
Insert the sdcard with the new firmware then keep pressing the M button and turn on he device
via the power button. hold both buttons until you see the android image with a progress bar
in the bottom, now you can release the buttons, wait until the flash process is finished,
the device will reboot and then you now have a firmware with gapps + root access.
setup your device as usual then download these apps from play store:
Screen Standby #root https://play.google.com/store/apps/details?id=com.nkahoang.screenstandby
We'll use this app to turn off the screen while keeping the tablet on.
To prevent your tablet from going to suspend mode, go to
Settings->Display->Suspension and select "Never timeout".
this way the tablet will be always on until you put it in suspend mode by pressing once
the power button.
Learn to use Screen Standby as we'll leave the tablet on with the screen off to save power most of the time
also please note that we're going to compile our own kernel and flash our own firmware,
thanks to amlogic effort to release the kernel source, however we need temporary root access
to make a copy of some files.
Once you've installed a root file manager or a terminal emulator, grab a copy of these files: /proc/config.gz This file contains the compile-time configuration settings for the kernel in gzip,
luckily it seems that they've compiled the kernel with the CONFIG_IKCONFIG_PROC enabled
that's why config.gz is available. having the kernel configuration means that we can just use this
configuration as a starting point and configure the remaining options for the kernel.
take a look at the configuration and you'll see why for some devices we can't just build a module
but we'll also need to recompile the kernel.
some devices will work with just a module however so I'm building a list of devices,
also since the kernel source supports different amlogic boards, I'm testing out also this method
for other devices.. come back later!
(this post is a work in progress, please come back later)
First of all, the answer: yes it is possible to make aircrack work, to get monitor mode and even injection work on some android devices, even by using the internal network card.
However keep in mind that A LOT of requisites are to be met,
most notably the network card must support monitor mode,
it is ok if monitor mode is not supported by default on your device, since we'll be replacing the module which handles the card anyway.
just make sure that the card you're going to use, either internal or external is supported by linux and someone managed to make monitor and injection work, we'll just handle the glue to make it all work on the android device.
by the way considering that most internal card are crippled so they consume less power and also the poor reception they have, you should go with an external card anyway.
now that you have the answer, let me clarify some points.
first of all, for this guide I'll be using an external wifi usb card since my ramos has an rtl8182cu wifi card which has some problem getting injection work.
My W6HD has a micro usb otg port so i just resorted to my trusty tp-link TL-WN422G rev 2
which sports an Atheros AR9271 single-chip USB,
I also have a Trendnet TEW-424UB rev3 laying around which is based upon a Realtek RTL8187B so I'll add support for that also.
The fight with the realtek 8182cu isn't lost yet, it is just that for now I just want the overall procedure to work, getting the internal card to work is not a priority yet as I find it useful to have the internal card handled by android, this way I can just remotely connect via ssh to my tablet and still be able
to use the external card for aircrack.
I haven't finished to write this guide yet, the procedure works as I've succesfully made the tablet recognize the card, enable the monitor mode and inject (injection is not the strong point of wn422g, but at this point is just a matter of hardware. choose a very compatible card as said before!), I've tested it against my own home network and it succesfully captured data and cracked the password (tried both wep and wpa),
since it took me a lot of time to get everything work and since I didn't write every step down I thought
to redo everything from scratch and to write down every step and share everything with you all.
The process will cover rooting the device, installing a full debian system (with development tools on the device), setting up a cross compile environment on a linux pc, cross compile modules, and so on.
it will be a long ride!
The kernel source we'll be using supports these platforms:
so while I'll be focusing on building modules and kernel for the Ramos W6HD, by following
this guide you should gain enough knowledge for adding support for usb devices on your tablet, granted that you have access on the kernel source.
you can also always resort to standard android kernel source however I won't cover this process
in this guide, maybe I'll write up something about this in the future.
I like to put everything online as soon as I write it so you'll find here the current work in progress,
once everything is written I'll double check everything and rewrite a proper guide.
I messed around with it a lot as it was (and still is) my first tablet.
After trying whatever app I stumbled upon I finally settled down using it as an ebook reader
for tech books as they usually contain a lot of images and my eReader (a Bebook Mini) can't handle these.
However, having a linux system (yeah I know android and all the kernel issue, however it seems that somehow they're rejoining the fun)
with this kind of hardware and use it just to read some books is an offense to human kind!
another reason to make a guide is that I see some apps popup on play store that are just a bunch of linux commands put together using android ui facilities. while this is all legit I think overall it is a bit morally questionable so let's just show you the nitty gritty details so both you and me will learn a thing or two.
if you find an easier way to do the things I'll show you, feel free to leave a comment
and I'll integrate your ideas.
This guide is intended for Ramos W6HD however you can adapt it to any android device which meets the requirements.
Let's begin! Part 1 - Taking control over your W6HD. Part 2: Setup an ARM Development environment
(this post is a work in progress, please come back later)
This tutorial will show you how to use your wiimote as an headtracking device. we'll assume that you already know how to connect the wiimote to your pc via bluetooth. as you can read from Johnny Chung Lee site, speaking of the wiimote
" It contains a 1024x768 infrared camera with built-in hardware blob tracking of up to 4 points at 100Hz. This significantly out performs any PC "webcam" available today. "
also, the wiimote has in-device preprocessing of image data, this means that the wiimote take care of all the processing, thus unloading the cpu. that's why the wiimote is a perfect solution for headtracking and, with a bit of work, the results are comparable to the (way much more expensive) TrackIR and of course it is a great weekend project that I'm sure will give you some other ideas on how to use the wiimote with a pc.
So, to recap, you need the following hardware
- Wiimote - Led Pen or other IR source - bluetooth adapter
as for the software, you'll need
- FreeTrack 2.2 - Bluetooth Stack compatible with Wiimote
for the bluetooth hardware and software I suggest you check out this page on WiiLi.org
I assume you already have a working-on-pc wiimote. Let's build then a really simple IR Led Pen
there's a great IR LED pen schematic from the ubiquitous Johnny Chung Lee but for this project I've taken another approach. I had a spare Flashlight that came free with an AA battery pack so I decided to mod it and I just had to buy some IR leds.
this is the flashlight I'm going to destroy.
now this is what I call luck. the original led was really easy to remove because it was not soldered. it was just placed between two metallic plates so this is just too good to be true..
I just need to cut out the pins and insert the IR Led.
the IR Led in place
to check out that the IR Flashlight is working I used my digital camera, a Sony DSC-V1. this digital camera has a night mode that cover the sensor with an IR filter
this is the assembled IR Flashlight turned off
the IR Flashlight turned on. I'm glad it worked on the first try
once you have a working IR Led pen or IR Flashlight or whatever your IR source is (just don't put a candle on your head!) you just have to download and setup Freetrack
Note: connect the wiimote before launching FreeTrack, otherwise it won't be recognized. Select Camera from the Cam panel, then choose Wii Remote #1 and click the Start button below
if everything went fine, you should see that the first and last blue led on the wiimote are lit, now you should see a skull on the left panel
point the IR source to the wiimote and voila you should see a red dot floating around and also you'll see the skull look around accordingly to the red dot. If you see more than a red dot or if you don't see it at all, move the threshold bar until you see it. for this project I assume that you're using a IR source with only one led, check out the FreeTrack site for info on how to build a IR device with more than one. note that with more IR Led you can achieve more degree of freedom (DOF) but for a basic headtracking device you just need one led.
Also note the incredibly fps of the wiimote, it easily goes up to 100 fps! by the way you don't need a wiimote to use FreeTrack, you just need a webcam. for more info check out FreeTrack. basically FreeTrack is compatible with games that support TrackIR so check out TrackIR site for compatible games. don't forget to check out the other panels of FreeTrack to setup the sensitivity of the device, and other settings. also check out for some option to turn on TrackIR support into the specific game. usually inside compatible games there's an option to bind a key to center TrackIR view.
Find a suitable place for the wiimote, for this project we found out that the best place was above the LCD. check it out
also you have to place the IR Source above your head.
this is a serious project. don't laugh. by the way I would like to thank Snow for his support, for letting me take this picture and for being a great friend. thank you Snow!
now for some in-game tests! we had some fun trying out this device with GTR2 and a Force Feedback wheel, the Saitek R440
check out the following videos to see this device in action