Category Archives: Gadgets

The time is 9:41

You may have noticed that the iPhone time on Apple presentations is always 9:41. How come? This goes back to when Steve Jobs launched the iPhone in 2007. At the time the time displayed was 9:42 and it was subsequently used for all promotional screenshots until the iPad was launched when the time was changed to 9:41.

Having a static time for all screenshots is good as it makes it easier to produce screenshots for presentations at different times and be able to combine them without the time jumping around. In addition it is also a nice historic reminder of the launch of the iPhone.

This is all very well, but how do you go about producing screenshots that mimic this behaviour. One option is to connect the iPhone to a Mac via USB and then run QuickTimePlayer on the Mac and start a recording. This will force the time displayed on the iPhone to 9:41, blank out any operator name and change the signal strength to maximum.

This works fine but requires a physical device. This can be tricky when submitting apps to the App Store and you have to provide screenshots for all various screen sizes. Another alternative is to download SimulatorStatusMagic, a free Xcode project on GitHub, compile it and install it in the various Xcode iPhone simulators.

Running the app in the simulator shows a GUI that allows the user to set the time, or use the default 9:41 time. Then switch to any other app in the simulator and take whatever screenshots are required.

Possible uses for the Apple iPad

The genie is out of the bottle. Steve Jobs today presented the brand new Apple iPad and I’m thrilled. The only thing I missed in the presentation was the usual slide: “Available now!”. While I wait patiently I will probably make up all kinds of uses for this device. As if I needed any arguments for getting one.

So what are some possible uses (apart from the obvious ones that was presented by Apple today)? Here is a list to get us started. Please add more suggestions in the comments.

  • Remote control for my living room audio system.
  • Backseat video for my three-year-old when we will do a long-haul drive to France this summer. Here is a market for a device cover manufacturer to step up to the plate.
  • Digital sheet music content holder for piano players. Just scan all the score and add an iPad holder to your piano. Perhaps with voice controlled page flipping.
  • Digital cooking book for the kitchen. Just needs a holder that sticks to the fridge.

Come to think of it I probably need more than one device.

Track your whereabouts with a Nokia phone

This is a follow-up article to a previous story on how to use the GPS in a Nokia phone. The last article described how to use a Python script to query the phone on the position. In this article we will add to the Python script to make it also dispatch position reports as UDP packets as well as a server script that saves the data to a sqlite3 database which is then used to display a web page with a map. The end result will look something like this:

tracker

All files are contained in the attached file at the end of this article. The server scripts have been written for Ubuntu 8.04 but will no doubt work on other distributions. Please note that you will need to install a couple of packages (php-sqlite3, php5-sqlite3 and libdbd-sqlite3-perl) to make the scripts run. The various scripts assume that they are all placed in the same location (i.e. in the web site folder). Read the security section below to ensure that the scripts are not publicly available.

Client script
The script ‘tracker.py’ should be copied to the phone according to the instructions in the previous article. Before copying it to the phone it must be edited. You will want to change the server host, the port and the secret.

Sqlite3 database
The data is kept in a sqlite3 database. The initial database is created by running the script create_database.sh. Do not run that script again as it will completely wipe the database.

Server script
Edit the file ‘tracker_server.pl’ and set the port number (line 8 ) and the secret (in the regexp on line 23) to the same values that you set in the client script. The server is then started by running the server script ‘./tracker_server.pl &’. Add the command to /etc/rc.local if you want it to start automatically when the server is restarted.

Web pages
Create a web site and point the document root to the folder where you put the files. Then reload the server.

Start the script
Finally, start the script on the phone and wait for it to acquire a GPS fix. This should cause the new position to be reflected on the web page.

Security
As mentioned above it a wise thing to prevent access to the script files if they are located in the same folder as the web pages. The easiest is to add an .htaccess file in the web folder with the following content:

<FilesMatch "\.(db|pl|sh|py)$">
Deny from all
</FilesMatch>

Attachments
tracker.zip

Use Python to access the built-in GPS in a Nokia phone

For some reason I have agreed to participate in one of the longest bike rides here in Sweden this year, the 300 km Vätternrundan. During the race every bike rider has an RFID tag on the leg which is read as you pass various points along the course. Apparently there are only a handful of locations where the tags are read and I wanted to do better than that.

I thought about using a phone with built-in GPS and send the positions in real-time to my server so that my loved ones can see where I am during the race. First I hoped to be able to use my iPhone 3G but the lack of background processes in a non-jailbroken iPhone meant it was a no-go. I then turned to my previous phone, a Nokia N82.

Doing a native application didn’t seem necessary for this type of application. I really just need a small hack to send periodical updates to an Internet server (which I will also write). I knew that it was possible to write Python applications for Series 60 phones but to be able to access internal resources like the GPS required signed applications.

Various Internet sources spoke about how to access the GPS information from Python but they all seemed to lack some detail that made it not quite work. At the end I got it working and this is how I did:

  1. Download and install Python for S60
  2. Download Python Script Shell with a test UID
  3. Sign the Python Script Shell by using this web page
  4. Download LocationRequestor with a test UID
  5. Sign the LocationRequestor .sis file with the same web page as above
  6. Move the two signed .sis files to the phone and install them
  7. Move the attached script to your phone (e.g. using Bluetooth) and place it under C:\Python or E:\Python. Personally I prefer the latter since I can then reset my phone and have all the files intact on the memory card
  8. Start Python and run the script

The above has been tested on a N82 (v 30.0.019) but may work on other similar phones with built-in GPS (e.g. N95).

In a future article I will follow up with an updated script that also sends the GPS data to a remote server. Stay tuned.

Attachments
gps.zip

Serial temperature sensor hardware

I have been monitoring the temperature in my house using 1-wire sensors for some time. The easy way is to get a T-Sense and a LinkTH from iButtonLink. That would set you back $70 plus $15 per additional temperature sensor.

There is a cheaper option and that is to build the sensor adapter yourself and to base it on software that can send data on the 1-wire network with the require timings for the 1-wire protocol. Digitemp is a free application that can do this for Linux computers. This post is not about digitemp but rather about how to construct the hardware.

temp-schematics

temp-ds18s20

It only takes four diodes and a resistor and it is actually quite possible to make everything fit inside a D-Sub connector. The schematics is shown above. Note that only four of the nine pins on the connector are wired and to avoid any misunderstandings those four pins are 2 (RXD), 3 (TXD), 4 (DTR) and 5 (GND).

One note about how to connect the sensor. The ground and signal pins should of course be connected with the corresponding pins from the serial port according to the schematics above. In addition to that, Vdd must not be allowed to float so it should be connected to signal ground.

temp-photo

Here is a bill of materials for this construction. The article numbers are from Elfa, a Swedish distributor. The total cost for a sensor with a three meter cable runs at 137 SEK which amounts to roughly €12 (tax not included).

Item Description Article Price
D1 6.2V Zener diode 1N5234 70-054-08 1.34
D2 & D3 Schottky diode 1N5818 70-102-67 3.47
D4 3.9V Zener diode 1N5228 70-053-58 1.37
R1 Resistor 1.5kΩ 60-724-66 3.89
Sensor DS18S20 73-775-00 62.50
D-Sub 9 poles female soldered 44-055-02 9.61
D-Sub cover 44-130-19 12.90
Cable LiHCH 2×0.25mm2 55-780-00 10.40/m
Heat-shrinkable tubing 4.8mm 55-058-23 7.61/m

Garmin Edge 705

Thanks to my brother I have taken up biking and will, together with him, participate in Vätternrundan, the traditional Swedish bike race over some 300 km which takes place on the second Saturday of June every year.

Little did I realise just how much of a gadget sport this is. I have now settled for a Nishiki Competition Carbon, an indoor trainer and some racing shoes.

To be able to track my progress, I also wanted to get a biking computer. My short list included various bike computers from Polar, Suuntu and Garmin. I ditched Polar and Suuntu when I read that they have poor Mac support. The question that remained was which Garmin model and in the end I settled on the Garmin Edge 705 with the biking kit.

Edge 705

Edge 705 sensors

Garmin Edge 705 with the biking kit comes with pulse, cadence and speed sensors. It also has a built-in GPS.

After having used it for a few weeks on my trainer I think it has a lot of nice features and it actually works quite well with my Mac for day to day activities like syncing exercises with the Garmin Connect online service. A Windows computer is required to manage the maps so before the snow melts and the roads are cleared of sand I will have to dust off an old Windows computer and fix that.

The interface is just as non-intuitive as one could expect from a non-Apple device, but it is not too bad. There are some things, however, where Garmin don’t seem to have finished their testing. One such thing is the handling of metric/imperial units. One of the first things I changed was to set it to use metric units. Even so, the preset distances for exercises are in multiples of miles, not kilometers. Fix it Garmin!

Garmin Connect

The online service Garmin Connect is a nicely designed solution that can play back old exercises. It reminds me somewhat of the Nike+ site. My only worry is that it appears a tad slow and I hope Garmin has designed and dimensioned it so that they do not run into the roof when more people start uploading their exercises.

All in all, this is a nice product that does the job. As far as cycling computers go I would give this a 4/5 rating. An easier and more consistent GUI and 100% Mac compatibility are the things I would like to see improved.

Patiently waiting for EOS 5D Mk II

Canon announced the update to the EOS 5D on September 18th, more than three months ago. Now the holiday season is all over us and there are still no EOS 5D Mk II to be found – at least not here in Sweden.

Canon recently announced some demonstration films showing off the video capability that this camera – together with some good optics – can deliver. The result is absolutely astonishing. I will have to reevaluate my assumption that I wouldn’t use the video feature.

Now I only wish that Canon could learn something from Apple. If they announce something they should have it ready for delivery. I’m getting tired of the waiting and if they don’t start shipping these babies in volumes my allocated budget may be put into use for some other gadget.

Completely remove U3 from Sandisk Cruzer on Mac

My collection of USB memory sticks is constantly growing. Some USB sticks I have bought, others were given to me as giveaways. The nicest ones from a physical perspective are a couple of Sandisk Mini Cruzer but unfortunately they came with U3 which I utterly dislike. U3 means that there is a small CD partition on the flash disk which is used to hold the U3 software. Since I am mainly using a Mac that is of no use to me and is just causing more clutter to my desktop. Even when I am running Windows it feels like a nuisance. The extra CD partition also meant that I couldn’t install a live USB OS on them. As a consequence they haven’t been used much.

For the longest time I thought it was impossible to fix this issue. But then I found an article on the Sandisk forums. So, if you want to remove the U3 partition to gain access to the full USB memory (or for whatever reason), just download and install this file.

Run the Launchpad Removal Utility for Mac application from within the SanDisk Cruzer folder in the Utilitites folder inside the Application folder.

Dlink DNS-323, part 5 – The results

I have written some posts on the issues I have had over the past week with my Dlink DNS-323 NAS. As I wrote yesterday I configured the system to use JBOD to combine the size of the two Samsung 250GB disks and then fill the entire array with data to verify that I would be able to recover the files from one of the disks if the other failed.

The findings are interesting. Please read on.

Once both disks were completely full I powered down the DNS-323 and connected one disk at a time to a computer running Ubuntu 8.04, using a SATA-to-USB adapter.

The leftmost disk showed the following partitions:

Device Start End Blocks ID System
/dev/sdb1 1 66 530113+ 82 Linux swap / Solaris
/dev/sdb2 131 30401 243151807+ 83 Linux
/dev/sdb4 67 130 514080 83 Linux

However, the partition /dev/sdb2 would not be mounted. The error in the log was “VFS: Can’t find an ext2 filesystem on dev sdb2”.

I then switched to the other disk (the one on the right). The partition table looked identical but this time I could actually mount the disk – but whenever I ran ‘ls’ I got a lot of errors saying “cannot access test/D0000220: Input/output error”. The error was caused by files that were on the other disk but were referenced by the file allocation table on this disk. The files that were on this disk were accessible, however.

I then studied what data had been saved on which disk and visualised it. In the image below, each pixel represents two files, each 1MB each in size. The first saved file is the one in the top left and it then goes across and down. Red pixels were saved to the left disk whereas blue pixels were saved on the disk on the right. The original image was 1000 pixels wide, I just shrunk it horizontally to be able to fit within the boundaries of this blog.

The fact that it seems very difficult to recover files on one of the disks means that I will probably stay clear of both JBOD and RAID for my DNS-323. Too bad.

Dlink DNS-323, part 4 – Gotchas for Mac users

Here are some quick hints that made me lose a couple of hours when setting up the DNS-323 from an iMac:

  • Do not use Safari to access the web administration pages on DNS-323. Especially not when formatting the drives. It just stops at 94% and sits there. Use Firefox instead.
  • Do not use Cyberduck to transfer the fun_plug files to the DNS-323. For some reason, the NAS does not run the fun_plug file when it boots. Instead, use the console FTP client from a terminal to upload the files.