Displaying your windows mobile device on a bigger screen via VNC

[(2) Comments]

Some time ago I was tasked with creating some training sessions for staff using smartphones running WM6. So I could both record procedures from the smartphone using a flash-video creation software, and demo things on a big screen live in front of the class, I setup my phone with VNC which allowed me to do both.

I needed to create and deliver several training sessions for PDAs covering the following topics:

  • Connection to the wireless network and config of proxies etc for internet access
  • Synching with the exchange server and related calendaring and email
  • Transferring files back and forth to the device

As well as a few other items which came up on the day.

You’ll need a VNC server (not client) on the windows mobile device. I ended up downloading Pocket VNC Server and running that, with a regular VNC client connection from the laptop.

Once the service is running you have to figure out which IP each device is listening on, then initiate a client vnc connection from the PC to the mobile device. After this you can use the PDA and the PC  (eg projector or big screen) will display what is happening on the PDA in a window, which can be recorded or screenshot as required.

There are two ways to get a VNC session to the PDA – either via an activesync connection (I used a USB cable, possibly you could use ActiveSync via bluetooth if you’re adventurous), or via a local wireless LAN. I wasted a lot of time trying to setup a Bluetooth PAN (Personal Area Network) between my laptop and the PDA so I could connect via a small private subnet, but couldn’t get it working. <rant>I remain convinced that most of bluetooth networking is junk and not yet much good for enterprise use</rant>.

Option 1: Activesync (Cabled)

Activesync is actually the easiest way to get an IP connection. It wasn’t documented anywhere obvious, but once you have an activesync connection established, the two devices (host PC/laptop, PDA) should have the following IPs:

  • 192.168.55.100 – Host PC
  • 192.168.55.101 – PDA

As long as you’re not going to be messing with the activesync connection and don’t want to walk around or move far from the PC, this is fine to use. Its actually preferable in that you’re not at the mercy of a wireless connection for your presentation. Having the wireless drop out or go flaky when you’re trying to demonstrate something to a room full of people is not what you want.

Option 2: Wireless

This method could be used either in AP or ad-hoc config. As there was a good wireless signal from one of our campus access points in the room, I went with the AP option. I also allowed each device to DHCP an address: somewhat risky in case the leases changed for some reason but it worked out ok. A more leak-proof method would have been to hardwire the IP’s to something static while still using the wireless network.

I used a well known freeware tool called VXUtil to determine the ip address of my PDA to use for connection to the VNC server.

Pros: You can walk around the room, you can demonstrate the full range of exchange/activesync settings, you can demonstrate internet connectivity. (I’ve demo’d google earth on the pda on a big screen via this method – it can be a bit of a slideshow over VNC, but it gets the point across).

Cons: Wireless can have random connection issues. You cant demonstrate setup of a wireless connection on the PDA since its already using one. Even if your setup doesn’t involve disabling and re-enabling wireless, You’ll probably end up disconnecting yourself anyway. (Windows mobile networking is fun like that).

Option 3: Both Wireless and Activesync, or: Heres one we prepared earlier.

To get this done, You can use any live screen recording software, or even take screenshots of the steps in your demo. I used an app for windows (camtasia) since we had a license for it, but there are likely suitable programs for linux as well (provided you can get your networking going with or without activesync).

Pros: Its rock solid. Networking is taken out of the picture so you shouldn’t have a problem.

Cons: You have to have it all pre-prepared, if you want to deviate from the prepared material you have to augment your presentation with either option 1 or 2.

That’s about it. Get the VPN server installed, get some form of networking up, connect to it from the PC, and you’re good. Its a little slow but a lot better than trying to get a room full of people to see what’s going on by holding your 320×240 PDA screen above your head…

How to fix Huawei E620 USB 3G Modem in Ubuntu 9.10 Karmic Koala

[(8) Comments]

I recently upgraded my laptop to Ubuntu 9.10 (Karmic Koala) and among a few other niggles (mostly related to intel video support, or lack thereof) it completely broke support for my Huawei 3G (E620) modem. Fortunately the fix is fairly straightforward: install a new kernel. I went with the latest (v2.6.32 release candidate available over here at kernel.ubuntu.org ) and the problem is solved.

If you want the gory details, check the thread over at bugs.launchpad.net. I’ll distil the useful bits below.

After the upgrade, my huawei 3G modem stopped being detected by NetworkManager. I’d see the fake ‘ZeroCD’ drive try to map itself and occasionally a gnome message box would be thrown up about a failed mount attempt, but no modem.

A look in the logs revealed /var/log/messages filling up with lines like this:

kernel: option 3-1:1.2: GSM modem (1-port) converter detected
kernel: usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
kernel: option 3-1:1.1: GSM modem (1-port) converter detected
kernel: usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
kernel: option 3-1:1.0: GSM modem (1-port) converter detected
kernel: usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2
kernel: option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
kernel: option 3-1:1.0: device disconnected
kernel: option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
kernel: option 3-1:1.1: device disconnected
kernel: option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
kernel: option 3-1:1.2: device disconnected

So the modem was being disconnected and reconnected at least a couple of times a second for some reason, and the storage device was not appearing at all.

I tried the usb_modeswitch tool which is supposed to jolt misbehaving HUAWEI (and other brand) devices out of their stupor with some undocumented SCSI/USB commands, but no success this time.

After a bit of googling, it turns out this is (was) a known bug in the way the more recent linux kernel handles the combination USB Modem/Storage device hardware (and was allowed to remain in a major release of Ubuntu which is a bit unfortunate as it seems these types of USB modems are pretty common).

There are a couple of fixes pending an official update: either install a patched version of the kernel, or temporarily disable the USB Storage kernel module which looks pretty easy and apparently worked for a few people:

# rmmod usb-storage

Untested by me: Your mileage may vary.  Be warned that even if this works, by unloading the usb-storage kernel module you will lose support for any USB based storage devices, so this is strictly a temporary workaround. I thought I’d try the more permanent and possibly dangerous (?) kernel solution first, which worked.

Steps to upgrade your kernel to a compatible version:

  1. Check your current version with the uname -a command. My post-9.10-Karmic upgrade version was: 2.6.31-14-generic #48-Ubuntu SMP  x86_64 GNU/Linux
  2. Go to http://kernel.ubuntu.com/~kernel-ppa/mainline/ and download the .deb files for the kernel headers (“all”) and the kernel for your architecture (“amd64” or “i386”). If you don’t have any kind of internet on the affected ubuntu box, grab them via another connected machine and copy them via removable media (windows or mac should be fine for just getting the files). You want the “linux-header” and “linux-image” files from within the folder with the latest (hopefully stable) version number. You can ignore the source file for now.
  3. Go to a command prompt, change to the folder where the downloaded .deb files are located, and execute the following, substituting the .deb file names for the versions you have (make sure you install the headers first).
  4. sudo dpkg -i ./linux-headers-2.6.32-020632rc8_2.6.32-020632rc8_all.deb
  5. sudo dpkg -i ./linux-image-2.6.32-020632rc8-generic_2.6.32-020632rc8_amd64.deb

After this, provided everything worked, you’re a reboot away from your modem working again. After the boot, uname -a should reveal the newly installed kernel version. Mine is: 2.6.32-020632rc8-generic #020632rc8 SMP

Once plugged in, the modem worked instantly and my mobile broadband account connected fine. Hooray!

While lsusb output looked the same as before:

Bus 006 Device 004: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem

My /var/log/messages also looked a lot healthier:

kernel: USB Serial support registered for GSM modem (1-port)
kernel: option 6-2:1.0: GSM modem (1-port) converter detected
kernel: usb 6-2: GSM modem (1-port) converter now attached to ttyUSB0
kernel: option 6-2:1.1: GSM modem (1-port) converter detected
kernel: usb 6-2: GSM modem (1-port) converter now attached to ttyUSB1
kernel: option 6-2:1.2: GSM modem (1-port) converter detected
kernel: usb 6-2: GSM modem (1-port) converter now attached to ttyUSB2
kernel: usbcore: registered new interface driver option
kernel: option: v0.7.2:USB Driver for GSM modems
kernel: scsi 8:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
kernel: scsi 8:0:0:1: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
kernel: sr0: scsi-1 drive
kernel: Uniform CD-ROM driver Revision: 3.20
kernel: sr 8:0:0:0: Attached scsi generic sg1 type 5
kernel: sd 8:0:0:1: Attached scsi generic sg2 type 0
kernel: sd 8:0:0:1: [sdb] Attached SCSI removable disk

Additionally, with the new kernel, both the pseudo cdrom, the 3G modem, and presumably the SD storage (though I don’t use it) are working at the same time. So, problem solved.

(Another improvement I noticed with the new version of ubuntu/kernel is I can disconnect the wireless broadband account via networkmanager without nasty gnome freeze-ups. Not sure what the culprit was for this: I worked around by disconnecting the hardware to avoid freezes, but looks like this too is now solved).

Procrastination Busting Strategies

[No Comments]

Procrastination is a topic of particular interest to me. I suspect most people suffer from it to a certain degree, myself most certainly included, and this is seldom more clear to me than when wearing my university student hat during the final month of semester, assignment due season, or ‘hell week(s)’ as I sometimes affectionately call it.

I have plenty in my schedule and it would be easy to simply attribute the stress of last-minuteism as an inevitable consequence of a busy life: however while some stress and being busy goes hand in hand I can’t honestly lay the blame squarely there. I am instead of the opinion that most of the pain could have been avoided with more foreplanning and self-discipline: or in short, less procrastination, and that I can always fit more into my schedule, by means of the proper organisation. In the words of Lucille Ball: If you want something done, ask a busy person to do it. The more things you do, the more you can do.”

So in order to see forward motion on the plethora of items on my life to-do, procrastination, the tarball of progress, the thief of time must be dealt with, and more effective personal organisation strategies established. I have recently given this some thought.

Proper identification and subsequent recognition of the beast is a very important step to defeating it. After some examination of my own behaviour related to assignment work, I realise that for me, procrastination has two primary modes.

The first is the putting off of starting a task, I’ll call it “Getting Started Procrastination”. This phase, depending on the due date, can last for weeks, months, years. The further away or the more indistinct a deadline is, the easier this one is to perform (I have since learned this is a documented phenomena called Temporal Discounting). The void between intention and action is filled with other activities, and the odd pang of regret at the already lost time, whilst simultaneously repeating the patterns which ensure more time continues to be lost.

The second and more immediately painful mode is the unnecessary prolonging of the task once I have finally been prodded into action, more often than not by a screaming deadline. This is the more memorable state, and the one I am going to talk about here, as I think its the most difficult for me personally to deal with (Getting started is usually not a problem, staying started is). I am labelling this type “On-Task Procrastination”.

On-Task Procrastination begins after I have made the decision to begin work, and has a number of guises which can make it tricky to recognise. It can be as mundane and obviously time wasting as finding myself staring at the screen, my calendar, or a piece of paper, having allowed my mind to wander, or an obsessive tidying of my room which started with picking up a few socks. Then there are the ‘escapist’ activities. These are blatant escapes from the unpleasantness or difficulty of the immediate, important task. These usually manifest as grabbing a book, putting a movie on, or deliberate, mindless web surfing. These are actually pretty easy to recognise and once spotted, simply require an effort of will to overcome – put the book away, turn the movie off, close the distracting web browser.

Less obvious and more difficult to defeat is when on-task procrastination cloaks itself in legitimate seeming activity. I have found some of the most insidious on-task procrastination attempts to insert itself into my workflow in the form of other productive tasks – just not the ones I’m supposed to be doing at the moment. Stuff like catching up on emails, sorting long overdue bills and tax papers, tweaking my linux setup to fix some annoying quirk that’s been bugging me, even working on other assignments which are not due yet.

Harder yet to spot are time-wasters which are somehow – however tenuously, related to the more important task I am supposed to be working on (for example, I will find myself looking up ‘interesting’ wikipedia and other articles which are peripherally related to the assignment topic). These require constant evaluation to detect, as they hide like weeds amongst the crops of productivity.

The product of this categorisation is a simple litmus test I can now apply whenever something attempts to divert me from my main task: If the diversion amounts to swapping progress towards my goal for activity on anything of a lesser priority – drop it and get back on task. It sounds very simple, but often easier to conceptualise than implement.

A recent bout of on-task procrastination in the face of a looming assignment deadline just about had me beat so I went on a little search-engine journey to see what others have to say about it. Plenty, as it turns out: The Google is brimming with anti-procrastination links:  and I found a couple of gems which I’ll share.

First, this blog article on Psychology Today was enlightening. It casts procrastination as a misfiring of our basic evolutionary survival trend to instinctively avoid unpleasantness. In other words, procrastination is a mind game which is played against yourself, a conflict with your own desire to avoid having to do something difficult. It is the opposition of your long term desire to accomplish something, versus your short term need to feel good.

This resonated strongly with me: often my on-task procrastination is triggered instantly as knee-jerk avoidance when running into difficulties, getting bored with a tedious piece of work, or encountering a particularly vexing sub-task. I realised that this was exactly what I had been doing: task hard = brain hurts = swap to something more gratifying. Procrastinate.

An interesting and related tip I read somewhere is forming the habit of staying on task even when you are blocked and feel like you are unable to progress. Procrastination is positive reinforcement of a bad habit – instant feel-good, getting away from an unpleasant task to a pleasant one. By the same principle, if you make a rule not to get distracted no matter what, then stick at the unproductive-feeling yet goal-related task for long enough, eventually not-working becomes more arduous than actually doing something on the task, anything at all, and you will start. (Its largely down to removing distraction as an available option – limit your choices to those which involve progress).

A particular wake up call for me was the authors comment that to indulge this behaviour is to carry on like a three year old with no self discipline beyond what feels good at a particular moment. Children might not want to pick up their toys simply because its not the most fun thing they could be doing: mature, goal oriented adults behave differently, and I would prefer to count myself amongst the latter.

Next, I discovered an extremely insightful, helpful piece of writing on procrastination which has since helped me no end.

The article, written by someone sharing what they learned while writing a doctoral thesis, espouses several very simple, very important ideas, and manages to encapsulate an entire procrastination-busting formula within three crisp statements. These words made it onto a yellow sticky notes which are now stuck to my monitors wherever I work:

1) Don’t get distracted
2) You must keep starting
3) That’s all

Extremely simple, and if you keep reminding yourself whenever distraction looms, very effective.

“Don’t get distracted”. This simple command set me up as a watchdog on my own activities, categorising them according to a simple formula: goal related, and not goal related. Every time I noticed myself diverging from the goal-related workflow, I look at the note, and halt the distraction. (In a short period of time the note is no longer required: a habit is formed, and the idea becomes internalised).

Next: “You must keep starting”. This is also very very helpful, as one of the tricks of on-task procrastination is to lever the interruption of a distraction to break your flow. Once you’re stopped, its easier to stay stopped. This next command simply gets you back on track. If interrupted, or distracted, you simply start again. Whether that means re-reading the task spec, or re-reading the document you are writing from the beginning to re-attain your flow, this is what you must do. “You must keep starting”.

Also written on my sticky note, from the same article and of particular help when I am working on something difficult and / or confusing (when most prone to diversion): “You are particularly vulnerable to distractions when you can’t decide quickly how to proceed… Make a decision”.

This last directive follows “keep starting“. I actually wrote myself an easy-reference formula on another piece of paper about how to re-start the particular project I was working on at the time if I found myself stalled, eg: Re-read the assignment spec, read my notes, read the document from the beginning and start when I reach a part that needs working on. (If nothing needs working on either I am either finished or I need to add more content!)

I’ll be doing more investigation into effective procrastination busting strategies, but for now these simple ideas have been very helpful.

References:

Jung, W.E (2003). Eddies Anti-Procrastination Site: Don’t get distracted. Keep starting. That’s all. Retrieved October 25th, 2009 from http://www.geocities.com/writethethesis/index2.html


Update: Above site disappeared, linking to Internet Archive: http://web.archive.org/web/20091022222819/http://geocities.com/writethethesis/index2.html

Pychyl, T.A (2008) Giving in to feel good: Why self-regulation fails. Retrieved October 25th, 2009 from http://www.psychologytoday.com/blog/dont-delay/200804/giving-in-feel-good-why-self-regulation-fails

Except where specified otherwise, the content of this site is licensed under a
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.