Jul 022015
 

CrashPlan Issue For Synology – Fixing the 4.3.0 update

Recently CrashPlan updated to version 1427864400430, which broke the CrashPlan package Patters had created for Synology installations again. They then (July 2nd?) released 1427864410430 as well, which means that if your CrashPlan installation on Synology broke with version 1427864400430, you will need to upgrade, wait for it to break again, and then fix with version 1427864410430. In general the fix process has been the same over the last few breaks, and I’ve outlined those steps below for the latest version.

There is one major change introduced from CrashPlan. Starting with the 1427864400430 update, a guid (think of it as a key) is needed to securely log into the headless client. Thanks to Mathew Stocks, I’ve made those instructions available as well.

The log for the failing CrashPlan package would look something like this for a failing 1427864400430 upgrade:

Upgrades available at central.crashplan.com:443
Downloading a new version of CrashPlan.
Download of upgrade complete – version 1427864400430.
Installing upgrade – version 1427864400430
Upgrade installed – version 1427864400430
CrashPlan stopped, version 4.2.0, GUID 559750658046558476

If the package was attempted to start again, it would write a line similar to the following, and then stop:

Synology repairing upgrade in /var/packages/CrashPlan/target/upgrade/1427864400430.

Note that the following instructions are for the 1427864410430 upgrade, which is the latest (as of July 2nd, 2015) update. If your Synology didn’t make it to this version, run the following steps, but substitute “1427864400430” where there are any references to “1427864410430”.

Connect as root to SSH

First, connect to Synology using SSH and the root account (uses admin password).  Connecting as the admin account will give you permission failures!

In SSH, run commands to extract the update

In SSH, run unique command to cleanup the package

The next command will be different for everyone, as part of the file path is randomized.  In this case, you will need to see what your path is first by running ls, and then editing the second statement below, replacing whatevervalue with the rest of  your path:

Start CrashPlan package, check log

After the above completes, you should be able to start the CrashPlan package again in Synology and get it running once more. The log should show:

CrashPlan started, version 4.3.0 GUID 559750658046558476

Get the headless key from the .ui_info file

While connected to SSH as root, run the following command to get the headless key file. The funky formatting of this command is because the file does not contain the special newline character:

The command will output a line similar to the following (everyone’s will be different):
4243,13d436c0-230a-4242-b258-574e60e62a9f

Update .ui_info on the computer connecting to Synology

On the computer where you are connecting to CrashPlan on Synology, go to the .ui_info file under the CrashPlan directory. NOTE: I had to manually upgrade my computer’s version of CrashPlan (via https://www.code42.com/crashplan/thankyou/) in order to see the .ui_info file.
Typically on Windows, this will be found under:
C:\ProgramData\CrashPlan\.ui_info
Enter in the new key in the file, replacing the current value, and save it. You should now able able to connect to the headless client. Note that you may need to also update the values in ui.properties again if you had to upgrade CrashPlan.

May 122015
 

The latest round of updates from CrashPlan (4.3.0) has broken the CrashPlan package on Synology again. Please see http://chrisnelson.ca/2015/07/02/fixing-crashplan-4-3-0-on-synology/ for the newest instructions.

Archived information for 4.2:

After installing Synology DSM 5.2, CrashPlan recently pushed an update (4.2.0) which broke the CrashPlan package Patters had created for Synology. The log for the failing CrashPlan package would look something like this:

CrashPlan started, version 3.7.0, GUID 559750658046558476
Upgrades available at central.crashplan.com:443
Downloading a new version of CrashPlan.
Download of upgrade complete – version 1425276000420.
Installing upgrade – version 1425276000420
Upgrade installed – version 1425276000420
CrashPlan stopped, version 3.7.0, GUID 559750658046558476

If the package was attempted to start again, it would write a line similar to the following, and then stop:

Synology repairing upgrade in /var/packages/CrashPlan/target/upgrade/1425276000420.

This seemed to be similar to the previous issue seen in 3.7.0, so I used the following steps to fix crashplan on my synology box: Note that this will likely be fixed by Patters soon, this is just a workaround if your CrashPlan install has stopped as a result of the 4.2.0 update.

Connect as root to SSH

First, connect to Synology using SSH and the root account (uses admin password).  Connecting as the admin account will not give you enough permissions.

In SSH, run commands to extract the update

In SSH, run unique command to cleanup the package

The next command will be different for everyone, as part of the file path is randomized.  In this case, you will need to see what your path is first by running ls, and then editing the second statement below, replacing whatevervalue with the rest of  your path:

Start CrashPlan package, check log

After the above completes, you should be able to start the CrashPlan package again in Synology and get it running once more. The log should show:

CrashPlan started, version 4.2.0 GUID 559750658046558476

Jan 102015
 

If you recently upgraded to DSM 5.2 and had CrashPlan break, this is likely due to the CrashPlan 4.2.0 update. Please see http://chrisnelson.ca/2015/05/12/fixing-crashplan-4-2-0-on-synology-after-dsm-5-2-update/

NOTE: This manual fix should no longer be needed after the 0029 update from Patters:

0029 Updated to CrashPlan version 3.7.0, improved detection of temp folder (prevent use of /var/@tmp), added support for Annapurna Alpine AL514 CPU (armhf) in DS2015xs, added support for Marvell Armada 375 CPU (armhf) in DS215j, abandoned practical efforts to try to support Code42’s upgrade scripts, abandoned inotify support (realtime backup) on PowerPC after many failed attempts with self-built and pre-built jtux and jna libraries, back-merged older libffi support for old PowerPC binaries after it was removed in 0028 re-write

Archive content:
CrashPlan recently pushed an update (3.7.0) to all clients which broke the CrashPlan package Patters had created for Synology. The log for the failing CrashPlan package would look something like this:

CrashPlan started, version 3.6.4, GUID 574956158631543214
Upgrades available at central.crashplan.com:443
Downloading a new version of CrashPlan.
Download of upgrade complete – version 1388728800370.
Installing upgrade – version 1388728800370
Upgrade installed – version 1388728800370
CrashPlan stopped, version 3.6.4, GUID 574956158631543214

If the package was attempted to start again, it would write a line similar to the following, and then stop:

Synology repairing upgrade in /var/packages/CrashPlan/target/upgrade/1388728800370.

After some investigation by Stig, Casper, and Harv on the comments for the package a working solution was found to manually install the update files and disable the failing upgrade.sh file. Note that this will likely be fixed by Patters soon, this is just a workaround if your CrashPlan install has stopped as a result of the 3.7.0 update.

1. First, connect to Synology using SSH and the root account (uses admin password).  Connecting as the admin account will not give you enough permissions.
2. Run the following commands:

 
3. The next command will be different for everyone, as part of the file path is randomized.  In this case, you will need to see what your path is first by running ls, and then editing the second statement below, replacing whatevervalue with the rest of  your path:

4. After the above completes, you should be able to start the CrashPlan package again in Synology and get it running once more.

Nov 212014
 

SmartThings does a lot of things well, but their main failing has been support for larger screens. If you have a tablet, you can run the phone interface, but it doesn’t take advantage of the larger format. For use on my desktop computer I installed an Android emulator to have access to the app on my computer without a phone. SmartThings really needs a larger interface, especially if you have a lot of devices.

I ran across a really cool project on the SmartThings community forums about a home automation dashboard for larger interfaces like computer/tablet screens. I finally got around to trying it out and I’m happy to report it is working really well and was relatively easy to setup.

FlorianZ posted the code for the home automation dashboard as well as some excellent instructions on how to get it running for other users. This is a relatively complex task, but if you are at all familiar with HTML and simple command line instructions, you should be able to figure it out due to the comprehensive documentation. A good overview of the project from the creator:

The interface consists of a Dashing installation running on a free Heroku instance. Dashing is a really cool dashboard framework. What I love most about it is how minimalist, yet customizable it is. It’s just a few hundred lines of code on top of some widely adopted web technologies, including Sinatra, Batman.js, Gridsterand Sprockets. You can easily create new backend services using Ruby, and frontend widgets using CoffeeScript, SASS and HTML.

The following screen shot is what my dashboard looks like after some configuration and customization to my devices and settings:

Home Automation Dashboard

The dashboard does a great job of giving you a lot of information at a glance, but it is also interactive as the switches can be turned off and on from the interface. The full thread on the SmartThings forum is a worth a read, as the next step for many has been to take the dashboard and connect it with a motion activated & wall mounted tablet for a pretty slick presentation. Sounds like a good future project…

Nov 072014
 

I’ve been using home automation as type of morning wake-up alarm for several years, but always found the scheduling to be cumbersome. In most home automation systems you need to rely on motion detection (what if I just got up to use the restroom, but am headed back to bed?) or timer events (what if I need to wake up early one day and not the next?). When I moved my home automation over to SmartThings with IFTTT integration I could see an easier way to accomplish this.

Smart Alarm Clock

My “smart” alarm clock uses a combination of services and devices to accomplish the following things:

  1. Read my calendar to know when my morning wake up should occur (but only if I’m home).
  2. Turn off my white noise machine and change the SmartThings mode from Night to Home
  3. Play the weather report (text to speech) on a Sonos speaker, and then play a local radio station
  4. Has the ability to trigger other SmartThings items during the change from Morning to Home (e.g. turn on lights, switches, etc).

Devices Used

For my smart alarm clock I’m using several different physical devices:

  1. SmartThings home automation hub
  2. White noise machine – Marsona TSCI-330 in my case
  3. GE Zwave outlet (connected to SmartThings) which turns the white noise machine on and off
  4. Sonos speaker (Play:1)

Sonos & White Noise machine

Services Used

Want to see how it works? In order to have everything work together I’m using several services:

  1. Google Calendar
  2. SmartThings
  3. IFTTT with the SmartThings and GCal channels activated

How To

Want to know how it works? I’ll describe exactly how I’ve configured these devices and services to work together:

Create a virtual switch

The creation of a virtual switch will give us a reference point for connecting other SmartApps in the SmartThings system, as well as externally via IFTTT. In order to create a virtual switch you will need to request access at ide.smartthings.com. After requesting developer access, select My Devices and create a new device. For the name and label, use something descriptive like “Good Morning Switch”. Set the Type as On/Off Button Tile. You will also be asked to give a device network id, enter a large number as to not interfere with existing devices (I used 399).

SmartThings good morning switch

Set actions for SmartThings Phrases

SmartThings has several built-in phrases (Good Morning! Good Night! Goodbye! I’m Back!) which can control devices as well as the mode of the home hub (home, away, night). In this case, we will be using the Good Night! phrase when we go to bed, and the Good Morning! phrase when we want to wake up in the morning. I’m going to make some adjustments to the actions performed when these phrases are sent to SmartThings.

SmartThings phrases

For the Good Morning! phrase, I’ve added one additional step – turn off the while noise machine that we run while sleeping. This could of course include any other devices you may have which you want to run when you wake up – turn on the coffee machine, the bedroom lights, etc. For the Good Night! phrase I have it already making sure the front door is locked and the lights are all out. I’ve further modified this phrase to have it turn on the sound machine via the zwave switch and turn off the Good Morning Switch. This last detail about turning off the Good Morning Switch may not make sense until the next step.

SmartThings good morning phrase SmartThings good night phrase

Set the switch to change SmartThings modes by using Hello Home Phrases

We want the virtual switch created in the first step to trigger the phrase for “Good Morning!”. To do this, we will need to install an app in SmartThings named “Big Switch for Hello Home Phrases“.

Big Switch for Hello Home Phrases is an app created by tslagle13 for the SmartThings community, and is not available in SmartThings by default. In order to use this app, you will need to add it manually. I’ve created a guide on how to do that here: Add Community Created SmartApps to SmartThings. Some additional information about app creation can be found here: Writing your first SmartApp.

After the app has been added, you can configure a new instance of it in the SmartThings app. I’ve configured this app to turn on the Good Morning! phrase when the Good Morning Switch is turned on. As I’m using this for morning wake-ups, I’m only going to have it happen when the switch is turned on, and only if the mode is Night. I’ve limited the switch to only work in this way because I only want the switch to trigger once per day (and is only reset when the Good Night! phrase is used), and I don’t want it to trigger when I’m not home (SmartThings mode would be set to Away automatically by phone geo-fencing).

Big Switch Good Morning 1 Big Switch Good Morning 2

Add Sonos Weather Speech to Text and Play a Radio Station

I want the Sonos to play a weather report, and then a local radio station. To do this, I need to select one of the Sonos SmartApps from the SmartThings Labs area of the SmartSetup.

SmartThings Sonos Weather App

After the app has been selected, we can begin to configure it. The first item is to set the trigger event. The app supports a lot of different options, but we are going to use the virtual switch created earlier as the trigger for this app. Once triggered I’ve configured the app to play the weather for our zipcode, and then a local radio station at 25% volume.

SmartThings Sonos good morning switch

SmartThings Sonos good morning switch 2

Automate the Schedule with IFTTT and Google Calendar

At this point we have the Good Night! phrase turning on the sound machine and the Good Morning Switch turning the sound machine off and triggering the weather report & radio. Now it is time to automate it to trigger from events configured in my Google Calendar. To do this, I’m using a service named IFTTT (If This Then That) to talk to both GCal and SmartThings. Once you create an account, you will need to activate the Google Calendar & SmartThings channels on IFTTT. For the SmartThings channel you will also need to allow IFTTT access to the Good Morning Switch.

ifttt

After the channels have been created, you can create a new recipe. Select Google Calendar as the Trigger starting point, and choose Event From Search Starts. There, pick a phrase you want to use to label the time slot you want to wake up which will not also be used by other events. In my case, I’ve used “ST Wakeup” as my search phrase. Note that the event will trigger approximately 15 minutes before the event start. So that means if you want to wake up at 8 AM, you will need to create your event to start at 8:15 AM. Next select SmartThings as the action for the trigger. You should be able to select Switch On and choose the Good Morning Switch from the drop-down.

ifttt action and trigger

 

All done

After the IFTTT integration has been completed, you only need to do the following to make use of the logic created:

  1. Create named calendar events on your Google Calendar, 15 minutes after the time you want them to trigger (I’ve created repeating events on my calendar, can edit or delete single days if needed).
  2. Use the Good Night! phrase when you go to bed

The beauty of using SmartThings and IFTTT is all of the other possibilities.  For example, perhaps you are using a sleep tracker which integrates into IFTTT, you could have it trigger the wakeup routine instead of a calendar event.

Additional Considerations

There is one way to simplify the above workflow – have Sonos provide the whitenoise as well.  I looked into this but didn’t pursue it much further as I already had a device that was working fine.  There don’t seem to be any white noise streams available for the sonos, but you could try streaming/direct playing a dedicated file hosted on Amazon S3 or something similar.  I started this, but gave up when the creation of a seemless 10 hour white noise MP3 looked a bit more complicated than I was expecting.

One other way to simplify things is to have a physical button or remote trigger the Good Night! phrase, rather than selecting it from the app on our phones.  Thus far it hasn’t seemed worth it, as we usually have phones or ipads handy before we go to bed, but it might be worth looking into at some point.

Oct 302014
 

One of the great things about SmartThings is how easy it is to develop for and how active the development community is. Users can create SmartApps for specific scenarios, and then use those SmartApps multiple times in their SmartThings environment as needed. Unfortunately, there isn’t an “app store” type concept within SmartThings. Unless a SmartApp has been officially published through SmartThings, each user has to create their own app with the SmartApp code. In other words, everyone has their own unique copy of the SmartApp, rather than one shared app code base. This is great if you want to make changes to existing apps, but adds extra complexity for regular usage and can lead to maintenance issues down the road (though I haven’t seen any examples yet of the SmartThings platform breaking older versions of apps). Ultimately for regular users this can be frustrating – there are a lot of great SmartApps created by the community, but it is not so simple to get them up and running on your SmartThings hub. This guide is an attempt to demystify the SmartApps process a little bit.

Add a SmartApp to SmartThings

Access to My SmartApps is all controlled through the development website for SmartThings, https://graph.api.smartthings.com/. If you already have SmartThings configured, you can use your existing login at the site. However, you will need to enable access to the development environment once logged in, or you will not see all of the options available. After logging in to the website, select the My SmartApps menu link. Once that page loads you will see any SmartApps you have created, as well as a button: + New SmartApp.

For this guide we will be adding an existing community app named “Big Switch for Hello Home Phrases”. This app allows you to use a virtual or physical SmartThings switch to run a Hello Home Phrase. Hello Home Phrases allows actions and mode changes, like Home to Away or Night to Home.

Click the +New SmartApp button. It will ask you to enter some information about your app, add the basic required data in (app name, author, app description) but don’t worry about the rest of the data as it will be replaced by the next step. When finished, select the Create button at the bottom of the screen.

New Smart App
NewSmarAppCreate

After the app has been created, you will be looking at a code view of the app which was just created. Don’t worry, there is no coding needed. In the top right corner of the screen there is now a drop-down named Browse SmartApps, select it and then Browse SmartApps again.

Browse SmartApps

You will now see a large list of preconfigured Community SmartApps. Find the Big Switch for Hello Home Phrases under the Convenience group and select it. You will now see an Overwrite button in the lower right.

Select Big Switch

Select that Overwrite button and you will see the code from the SmartApp appear in your version of the app. Next, select Save, and then Publish, For Me. A green success message should appear “SmartApp published successfully for me”. The SmartApp is now published and ready to be installed & used in your SmartThings environment.

Installing & Using the SmartApp

Now that the SmartApp has been published, it can be installed and configured. SmartApps are added via the SmartSetup, which is started with the large + icon on in the app.

InstallSmartApp

After the SmartSetup screen loads, swipe to the right until you see the My Apps category. There you should see the app which was just published. One key thing to note – I wasn’t able to figure out why the My Apps category wouldn’t show up under SmartSetup the first time I tried this. I had to log out of the app, and then back in again before My Apps would appear – simply relaunching and refreshing the app was not enough.

My Apps

When you select the app from My Apps it will launch the configuration & installation screen for the app. There you can configure all of the available options and save your settings.

Configure SmartApp

Once configuration has been saved, the app will typically show up under the “Convenience” section of the main SmartThings app, where it can be further configured or uninstalled.

Oct 272014
 

Xipiter has a great write-up on how they hacked the MiCasaVerde Vera quickly and easily:

The device has embedded SSH private keys on THE IMMUTABLE sections of the firmware image so we know that all these devices have the same embedded ssh key. It uses that key to access the manufacturers backend and set up ssh port forwards… While this a simple little device, the ability to attack it on the local network and potentially reach it THROUGH the manufacturers own servers as a beachhead to other computers on your home network is a reminder of why devices like this need to be understood better

This is a good illustration how the funky remote access methods for Vera got them into trouble. They would be better served with the API keys & calls other IoT hubs have been focused on. If you are running a Vera, it may be worth investigating offline mode until there is some confirmation that the remote access is possible or not.