Archive for January, 2010

Somewhere between shell & perl…

I’ve created a “Twitter” gadget. I have to make this easier to do, but at least it *works*

Here’re some examples of calling the Perl:

ep=`./momento Wall "Hello you" $ep`

./momento -d Wall

The first usage creates an application “Wall” on the frame. The UUID for the application is based on a unique string, so each time you update “Wall” it will update the same gadget on the frame.

It also outputs the endpoint on the frame for future reference. If the endpoint is present then it doesn’t delete previous instances of the app, or create a new one, it just updates the content.

The second usage deletes the application from the frame.

Obviously you can see now that interfacing bash to the frame now becomes trivial.

Now I want to make the frame appear as an instance of Growl.

This will involve broadcasting my existence via Bonjour. I haven’t played with that before.

Success! (mostly)

I’ve managed to display a clock and the current time by sending the whole #1 command in a huge packet and sending the content after receiving a packet on 9k4. Only trouble is, neither my BMP or my (pushing my luck, successfully) PNG have a transparent background on the frame. It’s transparent in Preview though. There were some tense seconds when I thought it was still failing, but then the next time around, it showed!

Some investigation

08:33:17.348887 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 9338
0×0000: 4500 05dc 04c3 2000 8011 8ceb c0a8 010b E……………
0×0010: c0a8 0107 232c 232b 2482 dc24 0100 0000 ….#,#+$..$….

This is all header until the last 8 bytes. That’s a little endian long.

0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y

16 Bytes. Often used as UUID.

0×0030: 2a00 5700 6900 6e00 6400 6f00 7700 7300 *.W.i.n.d.o.w.s.
0×0040: 2000 4d00 6500 6400 6900 6100 2000 5000 ..M.e.d.i.a…P.
0×0050: 6c00 6100 7900 6500 7200 0000 3624 0000 l.a.y.e.r…6$..

The string “Windows Media Player” with an ending double null. I wonder if that’s necessary or just a quirk? Null marks the end of strings in C, if you’ve got the length up front, this is unnecessary. Usually.

Speaking of lengths, 0×2436 is 9270 and the packet is 9338 long.

0×0060: 424d 3624 0000 0000 0000 3600 0000 2800 BM6$……6…(.
0×0070: 0000 3000 0000 3000 0000 0100 2000 0000 ..0…0………
0×0080: 0000 0024 0000 0000 0000 0000 0000 0000 …$…………

Bitmap header by the looks of it. My current icon doesn’t start like this, perhaps that’s the problem.

08:33:19.040812 IP 192.168.1.7.cvc > broadcasthost.9004: UDP, length 56
0×0000: 4500 0054 0db4 0000 8011 6b36 c0a8 0107 E..T……k6….
0×0010: ffff ffff 05d7 232c 0040 8af7 a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…

Ignoring headers, this is my Frame’s UUID, followed by 40L.

0×0030: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y
cf: 0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y

This is familiar, it’s what we just sent above.

0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O

I’ve seen this in all the packets from the frame.

0×0050: 0000 0000 ….

Always seems to be null.

08:33:29.074954 IP 192.168.1.7.liberty-lm > broadcasthost.9004: UDP, length 56
0×0000: 4500 0054 0db5 0000 8011 6b35 c0a8 0107 E..T……k5….
0×0010: ffff ffff 05d8 232c 0040 1d88 a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…

Same as before

0×0030: 0000 0000 0000 0000 0000 0000 0000 0000 …………….

Gone! Will this show what information is attached to this slide? Or is there some other meaning.

0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….

Same as before.

At this point, Vista resends the huge packet #1 again.
Followed by this:

08:33:41.861814 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 401
0×0000: 4500 01ad 04c7 0000 8011 b116 c0a8 010b E……………
0×0010: c0a8 0107 232c 232b 0199 0f40 0400 0000 ….#,#+…@….

#4 this time.

0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y

Our chosen UUID

0×0030: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O

The other UUID from the packet.

0×0040: 7017 0000 6501 0000 4749 4638 3961 1000 p…e…GIF89a..

0×1770, 0×165, Gif Header. (0×165 is the remaining bytes in the packet)

08:33:41.864910 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 1033
0×0000: 4500 0425 04c9 0000 8011 ae9c c0a8 010b E..%…………
0×0010: c0a8 0107 232c 232b 0411 ddca 0400 0000 ….#,#+……..
0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y
0×0030: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0040: 7217 0000 dd03 0000 4749 4638 3961 1000 r…….GIF89a..

Another GIF, same two IDs, 0×1772 differentiates them.

08:33:41.868012 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 399
0×0040: 7617 0000 6301 0000 4749 4638 3961 1000 v…c…GIF89a..

Another, 0×1776 this time… and several more like that all starting 0×17.

08:33:41.888890 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 285
0×0000: 4500 0139 04d2 0000 8011 b17f c0a8 010b E..9…………
0×0010: c0a8 0107 232c 232b 0125 80d5 0400 0000 ….#,#+.%……

Another #4

0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y
0×0030: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O

Same two IDs.

0×0040: 0100 0000 f100 0000 3c62 6f64 793e 3c6d ……..<m

#1 this time. A type identifier? This is ascii markup. I wonder if the images correspond to the actions? They don't get displayed anyway.

0×0040: 0900 0000 f300 0000 3c62 6f64 793e 3c6d ……..<m

#9 is more markup.

0×0040: 0800 0000 4d00 0000 3c62 6f64 793e 3c6d ….M…<m

So is #8

0×0040: 6600 0000 2e02 0000 3c62 6f64 793e 3c6d f…….<m

so is #0×66.

0×0040: 0700 0000 7a00 0000 3c62 6f64 793e 3c63 ….z… broadcasthost.9004: UDP, length 56
0×0000: 4500 0054 0dbd 0000 8011 6b2d c0a8 0107 E..T……k-….
0×0010: ffff ffff 05da 232c 0040 1d86 a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…
0×0030: 0000 0000 0000 0000 0000 0000 0000 0000 …………….
0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….
08:33:44.872752 IP 192.168.1.7.fhc > broadcasthost.9004: UDP, length 56
0×0000: 4500 0054 0dbf 0000 8011 6b2b c0a8 0107 E..T……k+….
0×0010: ffff ffff 05db 232c 0040 8af3 a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…
0×0030: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y
0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….

And we repeat our content #0.

08:34:04.785784 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 74
0×0000: 4500 0066 0909 0000 8011 ae1b c0a8 010b E..f…………
0×0010: c0a8 0107 232c 232b 0052 bea2 0400 0000 ….#,#+.R……
0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y
0×0030: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0040: 0000 0000 1e00 0000 5b20 5374 6f70 7065 ……..[.Stoppe
0x0050: 6420 5d0a 4e6f 2073 656c 6563 7465 6420 d.].No.selected.
0×0060: 6d75 7369 6300 music.

Clicked remove:
08:34:57.014103 IP 192.168.1.11.9004 > 192.168.1.7.9003: UDP, length 20
0×0000: 4500 0030 09a2 0000 8011 adb8 c0a8 010b E..0…………
0×0010: c0a8 0107 232c 232b 001c a16a 0200 0000 ….#,#+…j….
0×0020: b948 1259 35ad c247 b2fa 2d7c 120a dc79 .H.Y5..G..-|…y

Edging nearer

OK, there’s a big difference between UTF8 and Unicode. What did I think I was sending? What was I sending? *sigh*

my $uname=pack(“n*”,unpack(“C0U*”,$name));

This will convert UTF8 into Unicode in Perl (should you ever need to).

It’s no longer “ignoring me” per se: I can see it recognised my message. But it still isn’t displaying them on screen. Time to capture some more traffic from Windows Blister.

08:08:13.763007 IP 192.168.1.4.60969 > 192.168.1.7.9003: UDP, length 54
0×0000: 4500 0052 1464 0000 4011 e2db c0a8 0104 E..R.d..@…….
0×0010: c0a8 0107 ee29 232b 003e 65d7 0400 0000 …..)#+.>e…..
0×0020: 91ad e7a5 77a7 4d0f 9f74 9645 a900 25b5 ….w.M..t.E..%.
0×0030: a8fb 0750 13d3 9f43 bea2 a502 01d3 e9a8 …P…C……..
0×0040: 0000 0000 0a00 0000 0043 006c 006f 0063 ………C.l.o.c
0×0050: 006b .k
08:08:17.210158 IP 192.168.1.7.1289 > 255.255.255.255.9004: UDP, length 56
0×0000: 4500 0054 06d9 0000 8011 7211 c0a8 0107 E..T……r…..
0×0010: ffff ffff 0509 232c 0040 dbdc a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…
0×0030: 91ad e7a5 77a7 4d0f 9f74 9645 a900 25b5 ….w.M..t.E..%.
0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….

9k4?

My Frame keeps chattering to noone in particular.

17:59:29.566914 IP 192.168.1.7.anynetgateway > broadcasthost.9004: UDP, length 56
0×0000: 4500 0054 26f8 0000 8011 51f2 c0a8 0107 E..T&…..Q…..
0×0010: ffff ffff 05d3 232c 0040 1d8d a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…
0×0030: 0000 0000 0000 0000 0000 0000 0000 0000 …………….
0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….

It’s obviously trying to get the attention of something.

My replies seem to be going unnoticed :(

iPad… shame about the name.

Inductive charging. The device will come with an iMac style stand with a power cord and that will power the device while it sits in a monitor like pose. It will also provide USB ports.

Whilst there’s no inductive charging, they allow you to plug a USB port into the dock connector.

The only openings on the tablet will be headphone socket and SD slot.

Disappointed by this. I would have liked to see media import being easier. You will get SD, but only if you stick a chunk of plastic into the dock connector first.

You’ll also be able to buy additional stands so that you can dock in various places.

Of course you can get extra stands, but they’re only like the existing iPhone stand, with a little extra support for the device… or you can get one with a built-in keyboard (Who would do that rather than bluetooth?)

You’ll also be able to buy your choice of sleeve and because the charger is inductive you won’t need to remove it to sit it on the stand.

I didn’t see that their cover will make a stand, that’s a good idea – only works in landscape layout though. Expect many third party products available by the time it hits the shelves.

Anyone will be able to develop for the tablet and software will be available within and without a helpful app store.

I wish this had happened. It would have killed the jokes about ‘just a large iPod touch’ dead.

The tablet will multitask and come with iLife and iWork apps out of the box.

Well no, it doesn’t have out-of-the-box background tasks (apart from mail) but when it’s jailbroken, we can expect all of that to arrive. The iLife and iWork apps *are* there (albeit for $30 extra) and they look more like applications than apps.

The tablet will present itself as a bluetooth printer so that you can simply print a document from your work (where they may not use macs) where it will appear in finder as a PDF.

I’m sure this is an app waiting to happen. When it does, we’ll see this in meeting rooms around the world.

Folios with built in bluetooth keyboards will appear for those who need to type more on the go and who don’t like virtual keyboards. If a keyboard is connected, the virtual keyboard doesn’t restrict the display.

I’m taking this as a correct prediction, it does allow bluetooth keyboards and the virtual keyboard doesn’t come up when it’s in place it seems.

The screen will be demonstrated to be able to work with a rollerball capacitive stylus which is pressure sensitive allowing artists to use the tablet as an all in one drawing device.

There’s opportunity for a third party to add this on, and incentive now the device is big enough to draw on.

It will have a Snapdragon type processor and gaming quality graphics. Battery life will enable you to go most of a day without a recharge, and several days standby. It will have bluetooth and 802.11n wireless.

Yay, correct on all 6.

It will also have a built-in front facing webcam for conferencing.

Apparently the OS has support for this. Perhaps you will see swivel cameras which connect to the dock port. This may be why it can explicitly work in any direction (ie with the dock facing upward)

The UI will be content driven, with the metaphor of having applications on pages in a pad. Rather than scribbling over the document, you’ll scrunch your fingers quickly toward each other, balling the current document (visually) which then can be dragged to the bin icon which will appear.

I guess they still haven’t erased the shadow of Newton. I understand WHY they have kept the interface people know. They seem to have blended it with context menus and modal dialogs, this seems like a step back to me.

The device will be fully capable of playing and interacting with iTunes content, including Albums and also Comics/Books/Magazines/Newspapers. You’ll be able to schedule the download of podcasts, magazines and newspapers so that it is ready for when you leave for work to read on the train.

It has all this except for the podcast like delivery of magazines and newspapers. I think this is a missed trick. If Apple expect content publishers to create apps for their media, then they need to allow them to schedule updates automatically.

Free newspapers like “The Metro” will be able to be downloaded for free, other newspapers will carry a slight discount over the paper version (perhaps only as an early incentive), but the main advantage will be their early delivery to your device, “hot off the presses”. Content will be interactive with hyperlinks and videos.

I had this before the announcement. Metro’s iPhone app does all these things, including downloading to your device so you can read on the train. You can click hyperlinks once you’re overground again too. I think this app is crying out for a bigger display. I’m going to keep an eye on the number of discarded Dead-Tree versions of Metro I see on the tube.

All in all, I think I did quite well. The things I missed were more esoteric, and to be honest, if the price starts at £299 then they have a seriously compelling product out there. The nice to haves I listed above would probably have added significantly to the base cost.

The applications which appear for this will be what drives it to success or failure. Let’s hope people step up to the plate and produce compelling content.

Personally, I think I *will* get one. I’m fed up with running my phone out of battery doing things I’d rather be doing on a bigger device… and I still don’t want to carry a laptop on the tube. Ever tried using a physical keyboard when your elbows are in adjacent people’s ribs?

Oooh. Aah.

Oooh: There’s a button to turn on expecting Sideshow stuff.

Aah: It still doesn’t like what I send it.

If I do get this working, I think I’ll make it interface with Growl. Growl is a popular notifier application for MacOS that developers have already written plugins for.

It may well be the strange 4k packets the mac is somehow sending. Bizarre. MTU is 1500bytes.

Side show no show.

Neither this
0000000: 0100 0000 91ad e7a5 77a7 4d0f 9f74 9645 ……..w.M..t.E
0000010: a900 25b5 0500 436c 6f63 6bbe 2500 0000 ..%…Clock.%…
0000020: 0001 0001 0030 3000 0001 0020 00a8 2500 …..00…. ..%.
0000030: 0016 0000 0028 0000 0030 0000 0060 0000 …..(…0…`..

Nor this
0000000: 0000 0001 91ad e7a5 77a7 4d0f 9f74 9645 ……..w.M..t.E
0000010: a900 25b5 0005 436c 6f63 6b00 0025 be00 ..%…Clock..%..
0000020: 0001 0001 0030 3000 0001 0020 00a8 2500 …..00…. ..%.
0000030: 0016 0000 0028 0000 0030 0000 0060 0000 …..(…0…`..

Elicit a response from the frame. More work to be done.

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on en1, link-type EN10MB (Ethernet), capture size 65535 bytes
23:01:19.151797 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 4096
23:01:19.151861 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 4096
23:01:19.151908 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 1501
23:01:19.155348 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 4096
23:01:19.156945 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 4096
23:01:19.157718 IP 192.168.1.4.52439 > 192.168.1.7.9003: UDP, length 1501

Why is it sending >1500 byte packets from bash? Bizarre.

Back in business

I’ve successfully configured DNS for momentolive.com on my MacMini Server, I’ve added the certificate & key I created to the server’s keychain. I’ve added an https server on 1066 and set it to point at my code.

Then I hit a brick wall. The momento refused to connect to my BT Home Hub. I struggled for hours, trying to make it first see the hub, then make a connection to it. I succeeded in the first, but didn’t manage to succeed in the latter until I changed to WEP. I guess I’m going to be a little less secure at home until I complete this. It used to connect to my old AP ok with WPA PSK but it keeps attempting “Open” authentication with the BT Home Hub.

I finally hooked it all up and the frame said it wasn’t registered.

I registered it against my software. It said all was well, but then I had a glitch where it kept calling GET frame.sync, it just wasn’t happy. I eventually satisfied it by sending it something which I only remember receiving by POST before:

object momento.synccommit, item momento.registered

Once I sent that to the frame, it became quiet, and then it was happy to receive pictures.

I have a picture on my frame.

Now, finally, I can play with the uPNP/Sideshow stuff.

The Apple Tablet

Apple? Here’s my wishlist:

Inductive charging. The device will come with an iMac style stand with a power cord and that will power the device while it sits in a monitor like pose. It will also provide USB ports.

The only openings on the tablet will be headphone socket and SD slot. You’ll also be able to buy additional stands so that you can dock in various places. You’ll also be able to buy your choice of sleeve and because the charger is inductive you won’t need to remove it to sit it on the stand.

Anyone will be able to develop for the tablet and software will be available within and without a helpful app store. The tablet will multitask and come with iLife and iWork apps out of the box. The tablet will present itself as a bluetooth printer so that you can simply print a document from your work (where they may not use macs) where it will appear in finder as a PDF.

Folios with built in bluetooth keyboards will appear for those who need to type more on the go and who don’t like virtual keyboards. If a keyboard is connected, the virtual keyboard doesn’t restrict the display. The screen will be demonstrated to be able to work with a rollerball capacitive stylus which is pressure sensitive allowing artists to use the tablet as an all in one drawing device. It won’t come with the stylus however, since the OS will be able to be driven perfectly well with a finger.

It will have a Snapdragon type processor and gaming quality graphics. Battery life will enable you to go most of a day without a recharge, and several days standby. It will have bluetooth and 802.11n wireless. It will also have a built-in front facing webcam for conferencing.

The UI will be content driven, with the metaphor of having applications on pages in a pad. Rather than scribbling over the document, you’ll scrunch your fingers quickly toward each other, balling the current document (visually) which then can be dragged to the bin icon which will appear.

The device will be fully capable of playing and interacting with iTunes content, including Albums and also Comics/Books/Magazines/Newspapers. You’ll be able to schedule the download of podcasts, magazines and newspapers so that it is ready for when you leave for work to read on the train.

Free newspapers like “The Metro” will be able to be downloaded for free, other newspapers will carry a slight discount over the paper version (perhaps only as an early incentive), but the main advantage will be their early delivery to your device, “hot off the presses”. Content will be interactive with hyperlinks and videos.

Tune in next week to see how much humble pie I get to eat!