Vodafone 802SE

My phone, ten years ago

Vodafone 802SE

Ten years ago, I was settling in Kanazawa. This involved getting a Japanese phone, and more importantly getting it work for me. At the time, I wrote a blog post with some observations on what worked and what did not.

Looking back at the problems I faced at that time is a pretty good indication on why Apple managed to storm that market:

  • Contact synchronisation only worked partially
  • Todo synchronisation only worked partially
  • Music playback was crippled by DRM
  • GPRS modem function (tethering) was broken

The Vodaphone 800 had pretty good specifications for that time: it was built by Ericsson in collaboration with Sony. Yet most of the features I wanted did not work. I was using Mac OS X, which certainly did not help: there were Windows, Japanese only drivers available, but even then, integration with computers was an afterthought.

Like many phones at that time, the phone had very different connectors: there was a USB connector, but it was only used for data exchange, not charging. There was not standard jack headphone port, but instead the wide Ericsson connector, for which I had a charging dock and a special headset. I never used it because of the crippled audio playback. The phone had a Sony Memory stick slot and an infrared port (which I never used).

One aspect of the phone I liked was that it supported many Bluetooth profiles:

  • Hands-Free Profile (HFP)
  • Headset Profile (HSP)
  • Object Push Profile (OPP)
  • Serial Port Profile (SPP)
  • Dial-up Networking Profile (DUN)
  • Synchronization Profile (SYNC)
  • Generic Access Profile (GAP)
  • Object Exchange (OBEX)
  • File Transfer Profile (FTP)
  • Basic Imaging Profile (BIP)
  • Human Interface Device Profile (HID)

For comparison my iPhone only supports the following profiles:

  • Hands-Free Profile (HFP)
  • Advanced Audio Distribution Profile Source (A2DP)
  • Audio/Video Remote Control Profile target and controller (AVRCP)
  • Personal Area Network (PAN)
  • Serial Port (SPP)
  • Device Identification (DID)
  • Generic Access Profile (GAP) – Low Energy
  • Battery Service – Low Energy
  • Current Time Service – Low Energy

While some profiles have replaced others, for instance Personal Area Network (PAN) replaces Dial-up Networking Profile (DUN), with the added advantage that PAN actually works, I miss some of the old profiles, in particular Object Exchange (OBEX) which let me push a file from my laptop to my phone and vice-versa and Human Interface Device (HID) which let me use my phone as a mouse, very convenient for presentations.

Having left Japan, I never managed to sim-unlock the device, so it rotted away in a drawer…

Vodafone 802SE (Sony Ericsson V800) mobile phone © Episteme – Public Domain

Flattr this!

Bluetooth Logo

Bluetooth LE

Bluetooth Logo

Bluetooth is one of these standards which have been around for so long that they finally work. These days, I’m using bluetooth mice, keyboards and speakers without any serious problem, but this took many years since the introduction of the standard, more than 20 years. In fact the company that introduced Bluetooth, Ericsson, stopped producing mobile phones.

The protocol has seen many revisions, of course, but version 4 included an interesting addition: low energy (LE) devices. The notion of low energy is of course relative – the key point here is that Bluetooth LE devices use less energy that classical Bluetooth ones. The general idea is that they can run a few months on a small lithium battery.

There was a lot of noise when Apple introduced which is a standard for building beacons, i.e. Bluetooth LE devices that simply broadcast their identity. In turn, Google introduced Eddystone, an open specification for beacons, so I assumed that Bluetooth LE was about these beacons. I was wrong.

Turns out a lot of devices use Bluetooth LE. My iPhone connects to my Fitbit Charge using bluetooth LE, in turn the iPhone implements a Bluetooth LE profile and reports its battery level and local time, two bits of information that could be read by my laptop. The cadence measuring device I added to my bike? Bluetooth LE, with a standard profile! That was a good surprise and me realise there are many profiles for sport and medical sensors.

The Bluetooth explorer provided by Apple with the Hardware development tool supports Bluetooth LE. Turning it on revealed a few devices besides my phone and my watch in my close neighbourhood: an Apple TV and a Samsung TV, both advertising over Bluetooth LE. I found a pretty good introduction to Bluetooth LE on Github. While classical Bluetooth is connection based, Bluetooth LE is based on read/write/notify operations, closer to low-level protocols like SNMP or I²C.

While there is a lot of attention on the beacon use case, Bluetooth LE has the potential to integrate a lot of electronic devices: sensors, but also things who needs some for of setup or configuration: clocks, washing machines, ovens, etc. Currently the focus seems to be on sport and health equipment, but I could see move this to food and cleaning appliances. Only time will tell…

Flattr this!

Python Logo

Python Woes – Boolean Casting

Python Logo

The C language has the strange feature that it does not really distinguish between integer, pointers and booleans, True is any integer value different from zero and False is zero. Nowadays it is considered bad form to (over)use that feature.

Python has a feature which is similar: most build-in types evaluate to a boolean, like in C, a-non zero number is considered true. The feature extends to collections: any non empty collection is true, an empty collection is false. Any class can implement this behaviour by implementing the __nonzero__ or __len__ if it is a collection. It is considered pythonic to use the implicit boolean evaluation instead of checking if an integer is zero or a collection is empty.

Another important aspect of Python is duck typing, i.e. having code that does not make strong assumptions on what types it gets as an input, if it quack like a duck, treat it as a duck. This typically means that a function that takes in a collection does not need to worry about which type of collection it gets: it can be a tuple, a list, a set. All built-in collection have a constructor that take another collection, so you can freely convert between the collections.

Python also has object that behave like collections: files, iterators, generators. You can use them instead of a collection in a loop, with an in statement and of course cast them into a list. There is one hitch: while that casting preserves the boolean property for real collections, it does not for these quasi-collections.

e = itertools.repeat(0, 0)
bool(e) → True
bool(list(e)) → False

The same thing happens with an existing, empty file. This is pretty annoying because this means that the boolean operator does not return the answer to the question does this thing contain elements, instead it answer a more convoluted question is this thing a pseudo collection or if it is a real collection, does it contain any elements, so basically, to know what this operator means, you need to know its type, which goes against the whole idea of duck typing. This goes against the intuition that the boolean property represents some high-level property…

It’s worth noting that you have a similar problem with numbers:

bool(1) → True
bool(int(True)) → True
bool(int(False)) → False
bool(0.5) → True
bool(int(0.5)) → False

Flattr this!

DC62 LED Display USB Power Charger Data Transmit Current Voltage Tester and Apple A1205 Power Supply

USB Power – Apple

DC62 LED Display USB Power Charger Data Transmit Current Voltage Tester and Apple A1205 Power Supply

One comment I got about my previous blog post about USB power supplies is that it depends on the manufacturer of the power-supply, that Apple supplies would work better with Apple devices. This makes sense, so I did another quick run of tests. The set of power supplies I tested is a bit smaller, mostly because I stored some of them into boxes which are now in the attic.

I connected my iPhone 5 using a lighting cable to the power meter and the various supplies. The results are interesting: basically all the power supplies I tested output more power when connected to the iPhone, the only exception is the Mac Book Pro and that was expected. The iPhone seems to more aggressively draw power regardless of the manufacturer of the power supply. I really need to try with another Android device…

Power Supply Volts Ampères Watts
Apple A1400 5.07 0.93 4.72
Apple A1205 5.04 0.87 4.38
Apple Mac Book Pro (laptop) 5.07 0.52 2.64
Asus PSM06A 5.09 0.87 4.41
HTC TC-E250 5.00 0.8 4.00
Jet AC Adapter 4.92 0.83 4.08
Kensington Absolute Power 4.2 4.99 0.89 4.44
LG MCS-02ER 4.95 0.51 2.52
Steffen Swing Steko 5.07 0.89 4.51

Flattr this!

View from the Wahoo Blue SC installed on my Merida bike, with replacement magnets

Any Magnet

View from the Wahoo Blue SC installed on my Merida bike, with replacement magnets

Biking apps seem to be built to appeal to competitive people: the notion of King of the Mountain (KoM), e.g. the fastest guy for a given segment is pretty prominent in Strava. I can’t say this interest me much. The current KoM of the A1 segment back from Aikidō is some guy called Matthias W., this had me quite confused. Be assured it is not me.

What I find interesting is to see data about how I ride, where I’m slow, which day I was fast, etc. Any good geek will tell you, more data is better, so I looked into adding some sensors to my bike. Surprisingly these things are not very expensive anymore, so I ended up buying a Wahoo Blue SC speed and cadence sensor.

The device is basically a bluetooth transmitter with two sensor plates that measure the frequency at which two magnets pass by: one on the pedal, one on the wheel. The installations instructions sounded pretty simple, except for one thing: one needs to unscrew the pedal to slip on the crank a rubber band with a magnet.

The thing is, even with the right key, I can’t unscrew the pedal – clearly I would need a longer key, the kind the guy in the bike shop has. There is a bike shop close to my flat, but it is typically closed in the morning, and closed when I come back in the evening. He is usually open on Saturdays, but this Saturday was the national holiday.

Yesterday it stuck me while I was swimming: this device probably just measures the frequency of the magnetic field, so the actual strength of the magnet would not matter, as long as it strong enough, so any magnet would do.

A few months back, I had, on a whim, bought some Neodymium magnets from Deal Extreme, I wanted to use them to fix things to the metallic frame of my office desk, which never really worked. The cool thing with these magnets is that they are really strong, and really hold on to any metal they are stuck to, like the screw that holds the pedal, the exact one I can’t unscrew.

So instead of the small magnet with its rubber band, I just stuck a bunch of magnets to the pedal, aligned everything and it works: I can now measure both speed and cadence of my biking. Sometimes, any magnet does the trick…

Flattr this!

Internal board of a Protek PAC - 1200 WH Power Supply

USB Power

Internal board of a Protek PAC - 1200 WH Power Supply

One of the annoyances of electronic devices in the past used to be the myriad of power supplies, each with their own connector, voltages. They were all black and you would always mix them up or misplace them so that the relevant device would become useless.

USB solved this problem, which is kind of surprising because USB was first a data connector that happened to carry some power. The upshot is that you can use any USB power supply to charge any device with a USB connector.

These power-supplies typically have a longer life span than the device they came with, so they tend to accumulate. I was wondering what the difference is, so I ran a simple test on all of them: charge the same device, a Nexus 5, and measure the output of the various power supplies.

I only measured the supplies that have a USB A female connector – many power supplies have either a male micro or a male mini connector. I also tested various devices with such a connector for comparison.

Power Supply Volts Ampères Watts
Apple A1400 5.07 0.63 3.19
Apple A1205 5.04 0.61 3.01
Apple Mac Book Pro (laptop) 5.06 0.47 2.38
Asus PSM06A 5.08 0.57 2.90
Brother 4040 (printer) 4.84 0.34 1.65
Denon AVR-3310 (amplifier) 5.02 0.45 2.26
Google MSTK3K-US 5.08 0.43 2.18
HTC TC-E250 5.03 0.56 2.82
HTC MCS-01ED 4.99 0.76 3.79
Jet AC Adapter 4.99 0.47 2.35
Kensington Absolute Power 4.2 5.04 0.54 2.72
LG MCS-02ER 4.75 0.21 1.00
Model SM-600B 4.97 0.34 1.69
Steffen Swing Steko 5.18 0.67 3.47
Tylt UPPLANT (battery) 4.94 0.43 2.12

The first thing to notice is that the LG power supply barely meets the USB specification, which requires a 5 volt output ± 0.25 volts. The second is that while many power-supplies have similar sizes, their output changes quite a lot. The relatively low output of the Google power supply was expected, as it is meant to be used with a Chromecast, which consumes 2 Watts at peak.

Similarly the output of the Apple A1205 power supply was expected, as it was originally meant to recharge an iPad. The output of the Steffen Swing Steko power plug was a surprise, with nearly 3.5 Watts of output, officially it can output 500 Milliampères per connector (there are two).

So while there is a standard, it is pretty undefined what actual power you get from a USB plug, the actual USB spec only mandates 500 millampères, which is what the Denon amplifier provided. As often, it was nearly impossible to know beforehand how the various plugs would perform: LG is a pretty well know brand and the Jet AC Adapter I got from some small shop in Akihabara. Testing seems to be the only real way of figuring out; I also figured out that one adapter I had, a Protek PAC – 1200 WH was dead. I opened it up and used the board for the image of this blog post.

What would be interesting would be to measure the efficiency of these power-plugs, sadly the device I have to measure power-consumption is not that precise, so it does not see their consumption.

Flattr this!