Archive for Uncategorized

So… I jail broke my iPhone…

Few things are important to note at the start of this:
1) I did this the day before 3.1.3 was release, so I was on 3.1.2.
2) I’m on O2 in the UK on a contract, PAYG or other places may vary.
3) I had already asked O2 to unlock my iPhone, which they had done. This is important, as if they haven’t and unlocking is important to you it can’t be done on 3.1.2 anyway I believe.
4) I had the help of a few friends for this, they have my thanks and know who they are. :)

So why? Well I’ve had my iPhone now for the best park of eight months. I love it, it’s the best internet connectivity device I’ve owned… and it makes phone calls too. Which I guess is a bonus. The one thing that really gets me though is background apps, yes I know it’s not a huge thing, and it can be worked around… BeejiveIM does APN based jabber, etc. TouchTerm uses screen to create the illusion of no connection loss. It’s still not quite the same.

So what did I do?

Well, it’s important to note that the various jail braking techniques used to unlock your iPhone are not needed if your on O2 UK contract, you can go to an online form and request that they unlock it. There’s no point using jail braking just for that if it’s all you want.

1. Go get blackra1n - http://blackra1n.com/
2. Run the application (mac or win), and ask it to patch your iPhone. It’ll sit and churn for a bit, as will your iPhone. Do not worry if iTunes complains that you’re in recovery mode and it needs to be repaired. Ignore it and just wait.
3. Your iPhone should have rebooted now and it’ll look normal, exactly as it used to be. Except you should now have a new app called “blackra1n”, looks like a black rain drop.
4. Run the blackra1n application and install Cydia, this is a package manager that allow you to install other things.

You’re done, now you can play around with your iPhone in ways you can never recover from. :)

Things I did…

Installed OpenSSH.

Changed “root” and “mobile” users passwords away from “alpine” to one that’s slightly more secure.

Installed SBSettings (w/ plugins to turn rotation off, bluetooth, tethering, ssh on/off, etc).

Forcefully enable Internet Tethering (most probably against the O2 agreement), I know people have used 450Mb out of their monthly 500Mb, got a warning SMS. Not heard anymore.
- http://www.redmondpie.com/enable-tethering-on-iphone-3g-3gs-3.1.2-firmware-eqw846/

Installed “backgrounder”, allows you to put certain apps in the background. Needs a full “Power Off”, “Power On” restart to start working. A bit weird to use, I suspect I’ll default to things closing and use the “always background” option for certain apps.

Feel free to ask questions, there are loads of guides out there.

D.

Comments

Cheap DIY SSD for World of Warcraft… Preliminary Results

So, I run WoW on an Intel Core i7 2.6Ghz over clocked to 3.3Ghz with stock cooling. 6Gb of RAM, nVidia GX260 GPU. It runs like a dream when it’s loaded. But sometimes it does take some time to load. I had a theory that the loading time was purely HD, and with WoW being so big now it was probably hoping and seeking about the massive data stores it has.

The hard disk in this box is a Barracuda 7200.10 SATA 3.0Gb/s 250Gb, I’ll admit it’s nothing special but it’s not completely crap.

I’d had a CF to SATA converter for a long time, I brought it from Deal Extreme thinking I’d have a use for it one day. One day at work while discussing WoW with a coworker I decided I’d try it out. So I brought a cheap-ish 32Gb (seeing as WoW is the best part of 17Gb now) CF card, in particular I brought the Kingston Elite x133 32Gb CF.

I read the reviews that seemed to warn that the CF to SATA converter was a bit rubbish and people were getting low speeds from it on the Deal Extreme website. But as I had already brought it, I had nothing to loose but to try it. So…

* Plug the CF card into the converter, mount in the PC with velcro and plug in.
* Format to NTFS and move the mount point in Windows 7 to c:\Users\Public\Games\World of Warcraft
* Copy original WoW contents into new mount point.

48835784-e2dd6dff06c9f21228224fd7395639aa4b22ce90-full.jpg

I’ve done two tests so far… Starting WoW to Log In, Character Screen to Dalaran Appearance. I’ve repeated these results three times, reboots between each and disabled the windows prefetch/superfetch and search indexer.

WoW to Login:

Disk: 12.9, 9.7, 11.3
Flash: 8.3, 7.8, 7.9

These were taken with a stop watch, so add human reactions into them, but I’m sober and not on drugs, so they should be fairly similar. To be fair, let’s take the two lowest values of each, 9.7 on Disk, 7.8 on Flash. 1.9 Seconds difference. Not a lot to justify £55 but hey.

Character Screen to Dalaran:

Disk: 1:18.1, 1:17.3, 1:17.8
Flash: 32.1, 31.7, 34.3

Woooooow…. now that’s an improvement that can’t be explained by me failing to use a stop watch. It’s fast to load, things don’t seem to judder quite as much, people seem to appear quickly. It just seems more fluid.

I’m going to keep trying different tests to see what’s going on. Now note that I’ve seen 45Mb/s read off of this Harddisk, the maximum I’ve seen off of the CF card was 30Mb/s. So could I have been right? WoW really does benefit from a quick seek?

Obviously sooner or later the CF card will wear out, it’s not an industrial card and the constant rewrites of the NTFS allocation tables and additional resource data will ruin parts of the card. Although I understand most modern CF cards have a clever on chip system to distribute writes like that.

I’ll let you know as soon as I know more.

P.

EDIT: Interesting note is it seems to take longer to quit WoW now, I’m assuming has something to do with AddOn variable saving. I’ll investigate more in the morning.

Comments (2)

How much!?

I’ve just got back off of holiday, so I haven’t had a chance to read comments and things until now. Andy commented on my previous post and wondered how much the power monitoring project was going to cost me all tolled. So I started to think about it, from the beginning I’d always excepted it was always going to be slightly more expensive then buying a off the shelf solution to just “monitor” my power… but didn’t want to just monitor… I want to record and trend.

So how much are all the other monitors out there? From “ethicalsuperstore.com” they appear as follows:
Efergy Energy Saving Meter - £39.95
OWL Wireless Energy Monitor - £29.95
Wattson Home Energy Meter - £99.95 (Unfair to include this one really, it’s more a style statement then a monitor ;)
Eco-Eye Elite - £49.99 (Interestingly from the pictures appears to be using a CR Magnetics CR-3110 current transformer, hadn’t seen this one until today.)

So if I arrive inside of £29.95 to £49.99 I’m doing okey. Now until I decided to start on this project I had no tools or components in stock, when I lived with my parents I’d just use my fathers, but alas I haven’t lived there for three years and until this had the need for them. I wont include tools in this, they are things I should have had a long time ago. :)

The initial project was envisaged to have a current transformer, micro controller and a blue tooth dongle to provide remote telemetry. Of course as I continued to work on it I found I wanted more. So I added on an I2C RTC and an I2C EEPROM to store historical information when I couldn’t manually poll.

My project still isn’t fully built and is in various bits because I’m testing different aspects, it’s got components on it that it wont need in the long run (like TTL to RS232 line drivers). I’ve also done a few extra things like using DIP/DIL sockets wherever a chip is concerned so that I don’t ruin a chip while soldering.

So what’s it cost? Main components first:
PIC16F767 - Free (Microchip Direct Sample) - Closest on CPC is about £5
24AA102S (1mbit flash) - Free (Microchip Direct Sample) - Closest on CPC is about £3
OWL “Spare” Current Transformer - £6
Phillips Compat RTC - £3.50
Resistors (x8) - £0.10 (Brought in bulk from CPC)
Capacitors (x6) - £0.22 (Brought in bulk from CPC)
Diodes (x4) - £1.00 (Low voltage drop needed)
Veroboard - £1 (Brought and cut from CPC)
SparkFun Bluetooth Module - $59.95 or ~£32.50

Yes I know… it’s the last item you’ll gawp at. But really why bother doing it another way? A USB bluetooth dongle is a couple of dollars, and laptops have it built in. It’s range isn’t bad, and on most OS it emulates a serial port which makes writing software easy. Most of all, it’s two way communication. I did look at using a 433Mhz transmitter/receiver pair, but there’s to much in my house on 433Mhz already and it’s only one way.

So how else do a plan to push the total cost up for me? Well one thing you have to look at is power, you might be lucky and be able to feed the power to the board from the inside via a hole in the wall, that isn’t an option for me for a couple of reasons. I dislike throw away batteries and I don’t want to have to go out every few weeks/months.

A lead acid battery and a solar panel where my chosen (and currently untested solution), the 12V battery was £5 and the solar panel “designed” to trickle charge 12V batteries was around £12, both from eBay. From what I’ve worked out, I will still be okey to recharge used current from the night/day, even if during the day the solar panel is only working at 20% efficiency (which hey in the British summer we’ll be lucky ;).

Other things I’d like to do to make it more fun would be a digital potentiometer so that I could dynamically change the burden resistor as the current changes to get the best range at high current and most accuracy at low current. I’m having issues finding an I2C digital pot in DIP format, so I might have to resort to an SPI chip for that, which introduces more complexity in the I2C/SPI lines. I really want to use I2C though. That would be about £3, or free via samples.

So if you were going to pay for it all, I guess the entire project would be: ~ £71… youch we are over budget. But then again, I’d probably ask you to find one with a bluetooth interface for less, with historical, dynamic resolution and solar power. If you removed solar panel/battery it’d drop by £17, which is down to £54 which is closer, but not as easy for you and probably worse for the environment. I haven’t paid for my PIC or EEPROM so it’s more like £63 for me.

Let’s not even think how much my time writing the micro controller firmware would cost if I was charging eh? ;) But I’m making this because it’s a lot of fun. So Andy, I hope that answers your question and doesn’t scare you off!

D.

Comments (1)

Ack! Not just a voltage drop!

Okey, so my battery and solar panel have arrived. I’m just waiting on a 12V 300ma battery charger to arrive so that I can actually properly charge the battery for the first time before it begins it’s life of being floated. I gave them both a quick go to make sure they wernt DOA. The solar panel has already been modified to remove a silly blinking blue LED which was eating up 2.5mA on a 50% duty cycle while the panel was on. Baring in mind that I’ve seen it only do 12mA in overcast conditions every little helps. Maximum I’ve seen so far is 54mA in direct sun, although at the end of the day.

So I decided to look at why I’m “loosing” voltage when converting from AC to DC, I accepted that there would be a drop from the diodes in the full wave rectifier. Estimates suggests this would be around 0.7V for a diode and with two facing towards the positive rail this added up to 1.4V. Turns out that I had a voltage drop that was not quite consistent across the range of voltages I was expecting.

AC DC Diff
1.56 0.38 1.18
2.5 1.06 1.44
5.7 3.96 1.74
6.58 4.76 1.82

Hmmm, so not quite right and certainly this didn’t explain a 1.4V drop for the first result. After a bit more digging I read up that the reading my volt meter was giving me was most likly RMS. So by using:

AC * (2 * SQRT(2)/PI()) = DC

I got figures that always seemed to be around 1.2V above where they should be. I’ve surmised so far that in fact the drop across my two diodes is totaling around 1.2V. As the calculation to work out current from the voltage requires the AC voltage I think I need to reverse this in order to obtain correct readings.

However having since played and discovered that I’ve already received a voltage above the 5VAC that I had initially anticipated, I suspect I need to alter my burden resistor to bring this around a suitable value, although the 6.58VAC was with virtually every electrical thing in the house turned on although it suggests a total pull of around 20A. Which is possible I’m sure.

I need to have a good think about this tomorrow to actually work out what I really need.

Edit: Looking at the data sheet for the CR Magnetics split core current transformer the calculation is for VAC RMS and IAC RMS, so that answers that question. I suspect I need to tweak the burden resistor to cope with 32A which is the maximum of any of the house circuits, although the incomer more.

D.

Comments (1)

It’s almost alive!

Okey, so it’s been several months since I first started playing around with PIC microcontrollers, I’ve got a couple of projects in mind but my first one is a home energy monitor. Our house is full of tech that drinks a significant amount of electricity, so I wanted to start monitoring it. We could have got an OWL monitor but they are relatively expensive and there’s no real learning experience. Besides I want to be able to record the statistics, not just have them on a LCD display somewhere (which is plugged into the mains…).

So what’s the solution? A PIC16F7X7 with 14 ADC channels (of which I will need three in the end), supports I2C for talking to a Phillips RTC (keeps the date/time and also provides a regular interrupt), a Microchip I2C 1Mbit EEPROM for temporary data storage and UART for talking to a serial device. So far so good, however deviating from what is out there at the moment I wanted to be different on several levels.

First I needed to put this project outside in the electricity cabinet, it’s not my house so I can’t route wires or drill holes. This presents two obvious issues first of all there is no usable power out there (although that’s what it’s monitoring) and I can’t easily get a data connection outside. The first solution is to use a 12V battery and a solar panel which even at 25% efficiency can charge up the nights power usage, although not arrived yet a grand total of £16 from eBay. The second problem is easily solved although at a price. There were two options to use a 433Mhz TX/RX pair which provides a one way feed from the project, the problem with this is that a significant number of other applications use the same technology.

The other option, although more expensive, is to use a serial driven Bluetooth module with the SIP profile. This can be paired with any Bluetooth device and supports encryption and authentication and also bidirectional communication, allowing us to query the device as well as simply receive data. I highly recommend looking at SparkFun for any electronics geek, it’s heaven. The module I want to use is around £35 with P&P.

My biggest issue by far has been finding a cheap current transformer to actually clamp around the main incomer to the house. I can find numerous places in the US who will sell a CR Magnetics CR 3110, however any company shipping to the UK charges a fortune for postage making the units between £15-20 each. A co-worker of mine pointed out that you could get an entire unit (sold under OWL Energy Meter in the UK) for doing what I want (ex-PC integration) for £35 including a current transformer. After some digging we discovered that you could order the transformers separately for just over £5 each direct from the company.

For those who haven’t seen them, they look like this:
owl-clamp-whole.jpg

And are clamped on like this, (Warning: I have removed the mechanical shielding to get to the live wire, this was done for testing only and would be dangerous for regular use. The 4-gang in question is not used for anything else.):
owl-clamped.jpg

Once I received the transformer I set about trying to identify how I would be able to use it in my project, looking for model numbers and other identifying marks which might enable me to find a datasheet:
owl-clamp-inside-up.jpg
owl-clamp-inside-down.jpg

Sadly there where none, on the underside of the transformer (last picture above) I discovered a 100Ohm resistor which after looking at the implementation notes for the CR 3110 I believed to be a burden resistor. I tried putting several amps of current through the live wire and found minor voltages appearing (on the scale of 0-100mV). I took several readings and found that all but one (in the middle) lined up relatively well. Taking the equation from the CR 3110 data sheet of R = (T x V) / I it was possible to get a rough figure of the number of turns on the transformer, this all came out to around near 3200 turns.

Using the same equation I worked out what resistance I would need in order to generate near 5V for 13A, it came to ~1230 Ohms, knocking this down to a on hand value of 1kOhm gave me 5V for 16A. I proceeded to remove the burden resistor from the transformers mount, due to the layout of the PCB I could leave the resistor to the other end of the lead and close the transformer back up. Allowing me to experiment if need be. After further testing I found all these values to be very closely in tune with those that I had worked out. Only having a Kill-a-watt to help test my calibrations I can only assume it’s “accurate-enough”.

I had previously done a lot of reading at http://board.homeseer.com/showthread.php?p=627341 with reference to wiring up a CT. After wiring up the CT to my PIC development board and implementing a full wave rectifier I was left with an odd cycling of reasonable readings to wrong readings. It appeared that the timing of the ADC conversations was drifting in time with the 0V cycles of the rectifier. I had included a 1nF capacitor as the HomeSeer site had suggested, it turned out after talking to a co-worker it simply wasn’t big enough so instead this was replaced with a 47uF electrolytic. Bingo it started behaving as I expected, there was a three bit wobble in the least significant bits from the ADC but this may well just have been changes in current usage in my test object (read: girlfriends hairdryer).

I additionally had a test meter also wired in so that I could confirm the ADC readings:
testing-with-meter.jpg

I have noted a 0.2V drop on the DC side which I suspect is due to my diode rectifier, I need to explore this issue further and identify how to work around it or if I can just straight discount it. Finally an overview of my dev board:
dev-board.jpg

If you have any questions to do with the project let me know, I’m a little way off of it being completely finished but it can certainly begin it’s testing now.

Comments (1)