LinkStation Pro from a Mac: Wake On LAN

This is a case of a little knowledge getting me into trouble and then back out. If you have stumbled on this article it might possibly save you some time, or at least provide answers to questions that I struggled to find. Also, I don’t claim what I’ve done here to be elegant or even finished [I’m certainly not an Apple developer, in fact I haven’t written any code beyond the odd script for about 10 years and the world is undoubtedly a safer place :)]. But it does work. On with the story…

First the photography context for my buying the NAS unit: I recently purchased a Buffalo 2 Tb Linkstation Pro LS-WTGL/R1 because my manual, multi-hop back-up process was getting swamped. I was keeping two copies across the camera card, my mac, an external hard drive, and then finally DVD. If you bake editing and trimming of duff pictures into this, it rapidly turns into a mess. This is part of my motivation for getting into Lightroom for streamlining my workflow.

So the process was buckling under the load: for instance, I still haven’t sorted out my photos from Cuba. Of a more immediate concern is the fact that my external drive, a 1/4 Gig Maxtor OneTouch, has started to make a strange noise. It must be about 5 years old so it doesn’t owe me anything.

So last week I took the plunge and went through the Domestic Investment Governance process, and got blessing for the LinkStation, which I chose on the basis of a positive review in the Register [not the same model but near enough].

Out of the box I configured it as RAID 1 as the first step, and copied 50 gig of pictures over successfully on the first evening, which all worked fine with the default share configuration.

However, the night before last, I started getting some really odd errors errors when I was trying to do a similar sized copy: specifically, the finder was reporting an error code -36, which equates to the rather uninformative, and apparently quite common, catchall ‘I/O error’.

At this point I made the mother of all assumptions. When you configure your Mac for Windows file sharing as a server, you are sending incantations to Apple’s Samba implementation. Samba is something that I have used a lot, and administered briefly, at work. Anyway, because the Mac works out of the box as a server, I assumed that it would be fine being a client. It isn’t, at least with the Samba implementation under the hood of the LinkStation box.

The simple answer is, of course, to press the ‘Apple’ button when you configure your share, which is turning on Apple’s own file sharing protocol, AFP. You then need to change the reference in the server connection configuration [in the Finder] from SMB:// to AFP://.

Simple of course, but undocumented. I get the feeling that the documentation is very much aimed at Windows users, where you don’t need to tinker as much.

On a related theme, the Mac software appears to be… dissapointing, in the non-functional sense of the word. The back-up scheduling software [Memeo] hung when I tried to configure it. I tried installing it twice, and have given up on it. No disrepect intended to whoever develops the software, I’m sure I was doing something wrong. To be honest I didn’t really persevere, as I intend to use the RAID 1 storage as a ‘top copy’, with occasional manual backup to DVD.

What was more irksome was the Mac specific power management capability, when you set the power switch to ‘auto’. The manual says that you ‘…must have the Nas Navigator software installed on your PC for this feature to work”.

And sure enough, the Mac version doesn’t wake up the unit.

Because this is sending a ‘wake on LAN’ instruction I did a bit of googling to see if there were any little utilities that you could point at a given network device to tickle it into wakefulness. I didn’t find any.

What I did find was a piece of open source code which works perfectly. Usual caveats apply: if you are not comfortable putting this code on your machine, don’t. Anyway, it compiles an absolute treat. Just download the full install [not the diff] and then:

  • open the tar file in the finder to expand;
  • open a terminal window and change into the directory; [all of the following are commands, comments in brackets]
  • ./configure
  • make
  • sudo make install [you will be asked for the admin password]

This will then put the resulting executable ‘wol’ into /usr/local/bin. Next you need to grab the MAC address of your LinkStation. Again in your terminal window, type

  • arp -a

which will give you a list of results, including a line indicating the name of the NAS box which is set during the initial configuration, and the MAC address, which is the list of colon separated Hex characters.

The Linkstation is listening on port 9 [one of the standard UDP ports apparently], so firing a command like:

  • /usr/local/bin/wol -p 9 0:1d:63:19:b7:32

will wake up the  box. One instance should do it, but I’ve turned this into a little AppleScript which calls the command 3 times:

repeat 3 times

do shell script “/usr/local/bin/wol -p 9 0:1d:63:19:b7:32”

delay 1

end repeat

which I have saved on my desktop. After executing the command, it takes about a minute or so for the LinkStation to pull itself back onto the network. The next part I haven’t had a chance to play with fully, as I only got this working pretty late last night.

Articles I’ve found online suggest that the disk will go back to sleep after 5 minutes of non-use. It would be simple to move the entire loop in the script above to a shell script, add a 4 minute delay, and then run it in the background by using:

do shell script "command &> file_path &"

which is explained fully here. However, if it’s not easy to stop the process you might as well not use the ‘auto’ power-save, so this is a pretty inelegant mechanism.

It’s a shame that it doesn’t seem to be possible to configure the idle time on the LinkStation.

I’ll come back to this when I have a bit more time…

eBook Reader Power Management Problems

Typical: 5 weeks after I wrote a review of long-term experiences with my eBook Reader in which I said, “the hardware has worked flawlessly”, I hit a problem last week, so much so I thought I was going to have to send it back to Sony for repair.

The problems started when I ran the battery completely flat for the first time ever. I charged it the next day and, having connected it to my PC in work for about 5 hours, found that it was still flat. I unplugged it and tried again, and it started to take the charge. For the next couple of days, I noticed that the battery seemed to be running down unusually fast: I was finding that I needed to charge it every day. I didn’t notice the cause of this until Thursday: I couldn’t turn the device off [or more specifically put it into standby mode].

I googled this and couldn’t find any articles on people having a similar problem. Some people have had issues with the on/off button detaching, but nothing sounding similar to what I was seeing. I dived back into the manual and found the power off functionality in the top level menu. I never really figured this as a long term fix, but we’re going on holidays in just over two weeks and I was starting to think about the likelihood of a round trip to a repair centre, so I was looking for a sticking plaster. This worked for about a day, but the device became completely unresponsive on Friday night.

I’d tried a few remedies. I had recently uploaded my first PDF content, so thinking that that might be corrupt in some way I deleted it. When that didn’t work I tried deleting everything, using the top level menu item. Either this takes longer than I had patience for [an hour] or else didn’t work at all [my money is on the latter]. Soft resetting, with the recessed button on the back in combination with the on/off button failed as well, and eventually locked the device up completely. At this point I assumed that it was irretrievable, as it was completely unresponsive. I gave it another charge the following morning, and while I was waiting, I tried googling for a hard reset key combination [I had previously googled just for ‘reset’, not explicitly a ‘hard reset’]. This, finally, worked. Unplugging the reader from the USB prompted a reboot. While this was happening, I held down the bookmark and volume key, which prompted the full reset, restoring the device to factory settings. This requires the re-authorisation of the ePub account with Adobe.

With the benefit of hindsight, it was a pretty nasty way for the device to fail. The recovery process was effective, but not an awful lot of use if the device crashes when you are lying on a beach somewhere. It remains to be seen if it’s the start of a pattern or a one-off.

Six Months With an eBook

It’s just under six months since I bought my eBook, and I thought it would be interesting to summarise what it’s like to use one of these devices over the long term, at a time when Sony has just released a couple of new models.

I’ve ordered 16 ebooks, all from Waterstones, at an average price of £6.99 per book. I’ve had mixed results with the other online stores available in the UK, most notably W H Smiths. I tried to buy a couple of books on separate occasions. The first time, there was a tax added to the price at the checkout which made it more expensive than Waterstones; the second time there were repeated servers error when I tried to place the order. I haven’t been back since.

Waterstones is reasonably good, but it’s hard to get out of the mindset that Amazon has instilled in me in terms of price: I simply can’t cease to be surprised at how expensive the ebooks are. I enjoy the convenience, but I’m not prepared to pay much over the odds for an electronic copy. One example of this was Azincourt by Bernard Cornwell. When this was first released as an ebook, it was around £13 [it has subsequently dropped to £6.39 at the time of writing], which didn’t compare favourably with £3.99 that Sainsbury was charging for the paperback. I’ve therefore not stuck exclusively with the eBook reader over the last few months.

The selection of books that are on offer, whether it’s because of the price or ebook availability, has changed my reading patterns. This is both a positive and a negative: I’ve tried and enjoyed books simply because of the immediacy of the selection and delivery process. Equally I’ve been frustrated by non availability of titles. If you are thinking of buying one, I’d suggest sitting down with a pen and paper and researching the next 10 books that you are thinking of buying, and then seeing how many of them you can actually find in electronic form. That might sound like a hassle, but the cost of the device warrants the effort and I guarantee that there will be some divergence from your wishlist. What I did, and what I imagine most people do, was to sit down and browse through the charts in Waterstones, and think ‘yep, this looks like a runner’. You need to dig deeper.

Another unexpected, albeit minor, annoyance is with the quality of some of the ebooks themselves. I’ve just finished the Pillars of the World by Ken Follett, which was fantastic. But I found this quite distracting:

img_7093

Every single accented character in the book is represented incorrectly in the text. This is not an endemic problem with the ebook reader itself, just this [and at least one other] title. I can only guess that something has gone wrong with the encoding of the epub file. It also had more typing errors than I’d expect to see in a book. It’s an old title [originally published in 1989]. I was wondering [and this is major speculation] if it was something to do with the age of the original manuscript. Perhaps what gets produced further down the line in the production of the physical book wasn’t available or amenable to conversion to the epub format, and what has been used is actually quite an early version of the text [despite the much more up to date forward].

One final annoyance is with footnotes. I decided to give my first ever Terry Pratchett book a whirl and the title [Guards! Guards!] has lots of them. The inline references were converted to asterisks which hyperlinked to a numeric list on a page. There are two problems with this: the jumping forwards and back within the file is quite slow, but it’s also only possible to hyperlink to a page, rather than to a point in a page, so there was no way of correlating the individual links to the items in the list. This is obviously easy to solve, with numeric links. But the speed of the transition from one section of the file to the other is sufficiently slow that reading, say, a proper textbook would be a fairly painful experience.

So there a couple of niggles with the Reader but I still love it. Going on holiday with 3 books installed was an absolute godsend: that’s when it really comes into its own. I’m probably reading more than I did before I got the device. This is in a small part due to the fact that I have dropped a magazine subscription, but in the main it’s because of the reader. I’ve also just installed the Mac version of the synchronisation software and also Adobe Digital Editions which all seems to be working very well.

The hardware has worked flawlessly. The screen works fantastically well in every type of lighting condition, including blazing sunshine. The battery life is very impressive: I get a couple of weeks of hard use between charges. Sony do design their toys very well, it’s got to be said.

So bottom line, would I recommend one? Not unreservedly. The pricing of the ebooks, and the reader itself, underlines the fact that these devices are a luxury.