Friday, December 30, 2011

Bluetooth link key types

From http://lxr.linux.no/#linux+v3.1.6/include/net/bluetooth/hci.h#L254 :


/* Link Key types */
#define HCI_LK_COMBINATION        0x00
#define HCI_LK_LOCAL_UNIT        0x01
#define HCI_LK_REMOTE_UNIT        0x02
#define HCI_LK_DEBUG_COMBINATION    0x03
#define HCI_LK_UNAUTH_COMBINATION    0x04
#define HCI_LK_AUTH_COMBINATION        0x05
#define HCI_LK_CHANGED_COMBINATION    0x06

Pairing Bluetooth devices from command line

Following appear to be commands required to trigger pairing process from the command line:

hcitool cc <bdaddr>; hcitool auth <bdaddr>

Commands must be on the same line, separated by the semicolon, as described in previous post.

At this point, Bluez auth agent should kick in, asking for a code, if you have GUI one.

I found a page which suggests that only "hcitool cc" was enough for the author to trigger pairing, this could be explained by the fact that prior to 2.1, Bluetooth supported security modes which could protect either entire device access or just some of its profiles.

Saturday, November 12, 2011

Shopping for 3D TV...

Shopping for 3D TV (again), few findings:
  • There are no non-LED 3D TVs for sale in this part of world anymore (in particular, my older favorite, LE40C750 is no longer available)
  • Samsung D6xxx series (the cheapest) were caught red-handed not providing FullHD resolution in 3D: via Samygo. (Note from myself: Samsung was caught because lots of people actually buy their stuff, what one can think about other vendors?)
  • LG goes out of line of vendors with 3D shutter glasses technology with their FPR ("Cinema 3D" in marketing speak) technology. It uses passive (no power needed) polarized glasses, like RealD cimenas. Announced April (on these longitudes), already in local shops at not-so-indecent prices. FPR is Film Patterned Retarder, and I hope the last word is spelled right, because I have high hopes for this tech. It shares the same issue as Samsung D6xxx: there won't FullHD here for sure, but at least it's official and there're other benefits.

Wednesday, November 9, 2011

Kindle Packages I use

  • jailbreak
  • usbnetwork
  • physkeyb

Tuesday, November 8, 2011

Links for November 2011

Kindle:

Linux kernel module tricks:

Sunday, October 23, 2011

Fixing fan cooler in Asus X34F notebook

I spent good deal of day today fixing howling, growling, roaring and making other unpleasant noises fan in my Asus X34F notebook. X34F appears to be region-specific version of U35F, and motherboard bears labels of UL30A, so I guess this may be pertinent to them either.

I wasn't able to find a service manual, so I proceeded with disassembly by experience and intuition. It turns out that to detach cooler one needs to unscrew one motherboard plate completely (there're two, bound with a connector). The cooler part number turned out to be KDB04505HA by Delta Electronics. Vendor site showed no trace of this part no. But quick googling showed that it's the same part no used in Macbook Pro with similar performance stories. One another reason you don't need to pay a lot to get the same c.r.a.p.

Once I completely detached it, I figured how it could make those noises - impeller could dance on its axis, and while doing so could touch plastic casing. So, my idea was to either cut the corresponding side of impeller, or increase vertical space in which it "dances". I went for the latter, adding two washers between metal and plastic casing parts and gluing another washer on third point to get more support.

I decided also to oil fan, and considering oiling with machine oil could lead to just more dust accumulation, figure I take a pencil and oil it with graphite. Big mistake - either that pencil didn't really have pure graphite, or I put it there too much, but after re-assembling and powering all stuff, I saw that the cooler stopped working at all.

I almost gave up and started to look for closest repair shop, then figured I already have thing half-disassembled, and they would need to extract the fan anyway, so guessed I do it myself and deliver it to repairman in pieces. But before then, heck, I'll make another pass it it - first of all, try to power it on despite its rather home-use unfriendly connector.

Couldn't reliably figure the connector pinout (found pinout only for 12V desktop fans, who knows if laptop one would be proprietary), so tried googling for wire color codes instead. This page gave me good hints (black - GND, red - VCC, blue - PWM for speed control, yellow or another - speed sensor) which I decided to try with power supply at last. Unfriendly connector? Was able to stick into it breadboard wires, then breadboard, then breadboard power adapter. Saw the motor nudge, as struggling with friction. Took off the impeller, wiped its axis, and cleaned other part as best as I could. Put it back and powered, and so it moving - but, with whistling and vibration, even though suspected plastic part was off. Well, decided there's little to lose and oiled it with smallish drop of machine oil.

That was it! The thing stopped its hellish screams and just monotonically buzzed if move ear close to it. Reassembled all the stuff - the noise level is close to that which was when I bought it, as far as I can tell. acpitz sensor temperature is down to 55dC from 95dC I saw before. Finger crossed that oiling will help for decent time.

Conclusion and note to myself: It's indeed nice idea to be in power of your hardware, no doubts, and fears off. And its better to invest into tools than to pay for services of unknown quality (could easily imagine the same oiling to be done, but charged as replacement).

UPDATE: No, it didn't last even a day :-(

Wednesday, October 19, 2011

Making hcitool commands work

It's a shame how some now-ubiquitous technologies, like Bluetooth, are under-used and under-understood. And by usage I don't mean here occasional business card exchange, net access, being bluesnarfed and other boring consumer-level activity, but page scans, inquiries and having secure wireless communication you can trust (or not).

Anyway, if you ever tried using hcitool you may think it barely works. For example:


# hcitool cc <bdaddr>
# hcitool lq <bdaddr>
Not connected.


Ok, so here's the matter. First of all, hcitool accesses hci device directly, and that requires root access. Secondly, it works on low protocol level (ACL), so connection established by "cc" is of course not pairing or service-level connection. It's low level connection, which persist only while data is transferred and shutdown quickly to preserve the power. Yep, it shuts down while you type or even re-run next command. That's how it should be done:


# hcitool cc <bdaddr>; hcitool lq <bdaddr>
Link quality: 255


More fun:


# hcitool cc $BDADDR; hcitool auth $BDADDR; hcitool enc $BDADDR; hcitool key $BDADDR; hcitool con
Connections:
< ACL 7D:75:75:xx:xx:xx handle 12 state 1 lm MASTER AUTH ENCRYPT SECURE