Sunday, April 20, 2014

Lipo Conversions Part 1


If you're into RC at all you're mostly likely know what LiPo batteries are. If you're not have a look here

Having a whole load of these batteries in my garage I've discovered that you can do a whole lot more with them than power RC aircraft. 

So my first LiPo conversion project was to resurrect my trusty battery drill. Its a great drill however it suffers from the same problem that a lot of battery drills do in that if you don't use it all the time the batteries die eventually and also the batteries take a very long time to charge. So I converted mine to run on Lipos and now it not only charges much faster, but I can buy very cheap replacement batteries for it when ever I need to and charge it with my Lipo charger instead of the big bulky charger it came with. 

So here's how to do it. 

Step 1 - Battery Selection.
You'll need to open up the battery that comes out of the handle of your drill and have a look (or measure with a multimeter) at much much voltage the battery supplies. Then you can buy a lipo to match. In my case this was a four cell 1.3 amp hours battery by Turnigy. Its also Important to take into account what the maximum discharge rate that battery will be subjected to is and make sure you get a battery that can handle that. I'm not exactly sure what that is for my drill so i got this 45-90 C discharge batter from HobbyKing for $13.50. The final thing to consider is a battery that will fit in your drill's battery casing. Don't get one too big or it won't fit and you'll be up a certain creek. 

Step 2 - Solder up the connectors 
Once you've got your battery ready to go you'll need to solder the connectors from the battery casing to a plug that will match what ever kind of battery plug you use. I use deans so that what I've connected here. You can work out which is the positive and which is the negative terminal by looking at the old battery you've taken out and seeing how it was connected. 
 

Step 3 - Insert Battery
Once you've got your connectors soldered up you can put your battery in side, plug it in and put the whole thing back in the drill. One mod you could do which I didn't, was to solder another battery connectors outside your battery casing so you can charge it with out taking it out of its case. I simply unscrew the case and take the battery out when I want to charge it. I've actually got two so I just swap the battery over and put a new one in while I charge the flat one.
 






Saturday, April 5, 2014

Japan

I just arrived home from a two week trip to Japan for the purposes of site seeing and snow sports. Over the next few months there will be photos appearing on Flickr of my travels. However in the mean time I thought I'd make a little post about my thoughts of Japan and recommendations about where to go and what to see when you are there.

Firstly it would seem that all those website who say its a good idea to book ahead when you visit Japan are in fact correct. We didn't. Well we already had our first week of accommodation booked in Niseko where we went skiing however we didn't book much else and we kind of had to take what we could find, which wasn't always easy. That being said, if you are going to wing it as we did, there are a lot of things that will help you, like some great websites such as Booking.com, WiFi everywhere you can imagine and a very awesome Japanese Rail network that will get you everywhere, quickly.

One word about booking.com. While its true they won't charge you to use their website they will charge the hotel you are booking with and in the case of the smaller ones, they'll probably jack the price up to match. So if you can speak Japanese or get lucky enough to phone a place that speaks English, simply get the number of booking.com and phone then for you reservation instead of using the website, you might save a few hundred Yen.

Japan rail is an amazing organisation and moves a truly impressive amount of people around every day with out incident. They are also the most punctual institution I've ever dealt with. So if you are traveling to Japan and are going to be using them, and I'd recommend it, then you should probably get your self a JR Rail Pass.

Of the many reasons to use JR, one of my favorites is the opportunity to ride on the mighty Shinkansen or bullet trains. It is truly incredible how fast, smooth and reliable these trains are. If you do want to go on the fastest one of all, you'll need to travel express from Utsunomiya to Morioka (or the other way) on the Hyabusa Shinkansen which will get up to 320 km/h.

Japan is a beautiful and diverse place. In our travels, my friends and I went from Niseko to Sapporo to Hakodate up in Hokkiado (north island) and on down though Honshu (middle island) stopping at Nikko, Nagoya, Kyoto, Mishima and Tokyo. My picks of the places we went would have to be Kyoto for its shrines and temples, Nagoya for its winter lights festival and Niseko for its beautiful scenery and amazing food.


Thursday, March 6, 2014

Messing with the internal databases of Android Apps in Windows

OK, first things first. You'll need a rooted Android Phone for this. If you haven't rooted this here's a link to get you started. The Unlockr


So now that you've got a rooted phone (with some kind of super user app, I user SuperSU ) have you ever thought it would be fun to change things about apps which you can't other wise. Cheating at games comes to mind, but there's loads of other things you could do by playing with the databases which back Android Apps. This is also very useful if you are developing an app which uses a database and you want to have a look at whats in your database. The other thing you'll need before we start is the Android Debugging Bridge which you can get from the Android Developer web page as part of the SDK with some help on it here

So lets go.....

Step 1.

Open up a terminal and navigate to the install directory you installed the android SDK to. 
On my machine it looks like this.

C:\Users\Rob\AppData\Local\Android\android-studio\sdk\platform-tools>


Step 2.

Run the following command to make sure you're device is listed

C:\Users\Rob\AppData\Local\Android\android-studio\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
003f7cf0df1ab41d        device

This will show you your device connected to the ADB. If you don't see any devices here you might want to check the Android Developer pages for some help

Step 3.

Run the following command.

C:\Users\Rob\AppData\Local\Android\android-studio\sdk\platform-tools>adb shell
shell@mako:/ $

Now your connected to the Lunix terminal of your device. So far so good but we need to give your selves super user permissions to do this.


Step 4.

Simply issue the following command and the accept the prompt (if the super user app your using issues one) on the device.

shell@mako:/ $ su
su
root@mako:/ #

Step 5.

Now that you're a super user you can do pretty much anything, but remember, with great power comes...well you know.

Anyway now you'll want to change down a couple of levels as follows and list the directory contents.


root@mako:/ # cd data/data/
cd data/data/
root@mako:/data/data # ls
ls
at.mroland.android.apps.nfctaginfo
com.adobe.air
com.adobe.reader
com.android.backupconfirm
com.android.bluetooth
com.android.browser.provider
com.android.calculator2
com.android.cellbroadcastreceiver
com.android.certinstaller
com.android.chrome
com.android.contacts
com.android.defcontainer
com.android.documentsui
...

Step 6.

What you'll see here is a lost of pretty much all the apps you've got installed, including the out of the box ones. This is pretty much your "Program Files" directory on Android. Now pick an app you'd like to mess with and change in to its directory and then on down into its database directory. I'm going to change into the directory of the popular Cycling app Strava. Note that not all apps have a database directory so if not there isn't much you can do. Well you can edit their properties files and other files you find there.

root@mako:/data/data # cd com.strava/databases/
cd com.strava/databases/
root@mako:/data/data/com.strava/databases # ls
ls
google_analytics.db
google_analytics.db-journal
mixpanel
mixpanel-journal
strava
strava-journal
root@mako:/data/data/com.strava/databases #

Step 7.

Now that you know where the database is located for your app change but up to the root directory and see if you have sqlite3 installed bu doing the following.

root@mako:/data/data/com.strava/databases # cd ../../../../
cd ../../../../
root@mako:/ # sqlite3
sqlite3
SQLite version 3.7.16 2013-03-18 11:39:23 [www.ptsoft.org] [www.ptdave.com]
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

Step 8.

As you can see I've got sqlite3 installed. If you don't, have no fear just go and grab the installer here and install it and then try it again.

Once your ready to open your first database simply do the following.

root@mako:/ # sqlite3 /data/data/com.strava/databases/strava
sqlite3 /data/data/com.strava/databases/strava
SQLite version 3.7.16 2013-03-18 11:39:23 [www.ptsoft.org] [www.ptdave.com]
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

Step 9.

Well there you have it. Get your SQL on and have fun. A couple of handy commands for sqlite3 are .exit to quit and .tables to show you all the tables in the database. Once you've got all them you can simply select or modify their data in anyway you like. Have fun.

Note: to exit simply type .exit to quite sqlite, then exit to quite super user, then exist to quit adb and finally exit to quit the command prompt. 

Friday, February 21, 2014

Use large background images in Blogger

So I've been having fun setting up my new blog page and I came across a problem. The background image I wanted to use simply didn't look much good if I compressed it down to the 300KB that blogger limits you too. So here's how to get around it.

1. Host your image somewhere else. I chose Google Drive

2. Get a direct link to the image. In the case of Google Drive I simply needed to set the sharing permission to be "Anyone with a link" and then the URL takes the form of http://drive.google.com/uc?export=download&id=ID where ID is simply the file ID. You'll see it in the URL of the page when you open the file in Google Drive. Its long and has lots of letters and numbers in it and its usually at the end or near the end of the URL

3. Edit the HTML of your template using Bloggers HTML editor

4. Up near the top look for some code like this.
<Variable name="body.background" description="Body Background" type="background"
       color="$(body.background.color)" default="#111111 url(//themes.googleusercontent.com/image?id=1OACCYOE0-eoTRTfsBuX1NMN9nz599ufI1Jh0CggPFA_sK80AGkIr8pLtYRpNUKPmwtEa) repeat-x fixed top center" value="$(color) url(http://drive.google.com/uc?export=download&id=0B5_ZrqX_KXcOb0Zoc1Rxay1DZ1k) repeat fixed top left"/>

5. All you need to do now is replace the URL at the end inside the brackets with the one you generated in step 3.

6. Hey Presto now you can make your background image as nuts as you like. Just remember if you make it too big it will take a long time to load especially on mobile devices.

Thursday, February 20, 2014

Scary time flashing the FrSky Taranis

So I just purchased my self the amazing new FrSky Taranis and have been having a fantastic time learning about the great open source OS OpenTX that it uses. One of the big advantages of this open source firmware is that you can always flash the latest and greatest updates when ever you want to and if you're like me, you might even have visions of grandeur about improving the code your self. So the first thing I did was set about flashing my new Taranis.

Well here's today's hot tip. Be careful! Right so you already knew that. It turns out that the Taranis and in particular its flashing utility DFU-util has some serious incompatibilities with both windows 7, 8 and 8.1 (what I was using) and according to some of what I've read, certain USB chip sets and seemingly USB 3. I managed to brick mine but flashing it from windows 8.1. But do not fret, this story has a happy ending. I installed all the drives etc. on my windows 2008 R2 Server and managed to flash it back to life. So my advice if you've found this post after frantically Googling "bricked taranis" there is hope. Just flashing it again from an older version of Windows and you should be OK.