Access Keys:
Skip to content (Access Key - 0)

Installing OpenRemote 2.0 Controller on Synology NAS

This documentation is provided by our user community and is maintained by OpenRemote user community.

If you wish to comment, suggest updates or correct errors, please leave a comment on this page or contact us on the forums.

These instructions have been verified using Synology DS211J. If you've successfully installed OpenRemote Controller on other models, kindly leave a note to let us know.

It is recommended that you install OpenRemote on Synology NAS using the prepackaged version available at PC Loadletter Blog.

The rest of the instructions on this page are no longer necessary, and will eventually be removed.


Disclaimer: The modifications described here may go against terms of use established by Synology. This might impact your software-warranty. In particular, the statement from Synology Wiki is as follows:

However, modifying your NAS will invalidate your software support warranty, although not normally your hardware warranty, as described in General Disclaimer on Modifying the Synology Server. Modifying your Synology Server is also not without considerable risk of making it either temporarily unstable or temporarily unuseable. In virtually all cases the Synology Server can be returned to its former as new condition (in software terms) by fully re-installing the Synology firmware. Re-installing the firmware can (but not normally) result in losing your data, so ensure you have a backup of your data before modifying the NAS.

Step 1: Install Bootstrap Script on Synology

In order to manage third party installation packages, a package manager must be installed. This can be achieved by installing the correct bootstrap script on the Synology NAS which will install a ipkg package manager.

The process is described on Synology Wiki. For the latest information, please check and follow the instructions there. For the sake of web rot (dead links, moving sites) some of the relevant parts are quoted below (as of Oct 13, 2011).

Please follow the instructions with care and download the correct bootstrap script. Synologys use different CPU's and each CPU requires a different bootstrap. The system models and their CPU types can be found on Synology Wiki.

  • Installing ipkg on Synology NAS (retrieved Oct 13, 2011)

Step 2: Install Java Development Kit on Synology

The instructions for installing Java on Synology was first published on pcloadletter.co.uk blog. We recommend that you follow the instructions there, including the comments section if you have questions.

We've reproduced some of the information here for archiving purposes.


Download Java

First, download Oracle Java VM Embedded. Again, you'll need to choose the correct binary download based on your CPU architecture (ARM or x86). OpenRemote will require Java 6 or higher:

Note that Oracle will ask you to fill in some of your personal information in order to access the download.

Follow the instructions on pcloadletter.co.uk blog. The downloaded Oracle Embedded Java archive should be saved on the public shared folder on your Synology NAS. The installation scripts will attempt to find the Java archive from this location. It has been done this way because the Oracle Embedded Java is not free software and cannot be freely distributed as part of the installation package.

Note that if you're using a multi-bay NAS, you may need to create the public shared folder yourself. You can do so from the Shared Folder control panel – create a shared folder with name public and assign read and write access to this folder for everyone. On single-bay models, the shared public folder is created by default.

Using Other Java VMs

Use of the Oracle Embedded Java SE is cumbersome due to the distribution restrictions. However, for ARM CPU architectures there aren't currently many production-quality options. The closest is OpenJDK VM on ARM (a.k.a Zero VM) but at the time of writing this was still lacking a just-in-time compiler (JIT) which has a large performance impact on the OpenRemote Controller. So while Zero VM is available for ARM architectures, it is not yet recommended until the related Shark JIT has also matured to production quality.

For x86 archictures such as Atom CPU, there are other JVM choices that could be used, including OpenJDK runtime which doesn't have the same distribution restrictions as Oracle Embedded SE. However, we haven't attempted to run OpenJDK on x86 based Synology NAS, nor is there currently an installation package for such.

If you're successful in using other Java VMs with Synology, please let us know either in the comments section of this page or on the forums.

Download Synology DiskStation Manager 3.1 ToolChain

Synology DSM Toolchains are free software and available for download from Sourceforge.

Again, a choice needs to be made based on your Synology NAS CPU architecture:

Save the Synology DSM archive to the same public shared folder that was described in the previous step.

Note 1: Make sure your NAS is running DSM 3.1 or later.

Note 2: If you upgrade DSM after the Java packages have been installed, you will need to remove and re-install them. This is due to UTF-8 local support that has been added to the install packages which will get deleted on DSM upgrade.

Install Packages

After completing the above steps of downloading Java VM and DSM Toolchain and saving them into the public shared folder, you can run the package install scripts from Package Center in Synology DiskStation Manager.

For archiving purposes (and if you want to investigate what the package installation scripts do), they've been attached below.

  • Synology Install Package Scripts (retrieved Oct 13, 2011)

Step 3: Install OpenRemote Controller on Synology

First, download OpenRemote Controller.

Extract the zip archive on your Synology NAS. You can create a new directory for this, for example under /usr/local directory.

Change Controller Default Port

OpenRemote Controller attempts to listen on port 8080 by default. This is already taken by other Synology services. You'll need to configure OpenRemote Controller to run on a different port (for example, 8081).

To do so, locate the server.xml file in [/usr/local/OpenRemote]/config directory. It contains the following section:

    <!-- Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
    -->
    <Connector executor="HTTP-ThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

Change the port value to 8081 (or any other unused port number) so you will have:

    <Connector executor="HTTP-ThreadPool"
               port="8081" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

Save the file.

Next login to your account at http://designer.openremote.org – switch to the 'Building Modeler' view and on the left-hand side selection choose 'Configuration'. From configuration select 'Discovery' and then change the port number to 8081, as shown below:

Save your configuration.

Test Your Controller Setup

After finishing the above, you can give your controller a quick test drive.

First, change to the controller's bin directory (the default scripts assume you execute them from within OpenRemote/bin). Then start the controller:

> cd /usr/local/OpenRemote/bin
> ./openremote.sh run

Step 4: Start OpenRemote Controller Automatically at Boot

These next steps explain how to make sure the OpenRemote Controller is started automatically when/if the Synology NAS is restarted. There are more than one way to accomplish this – the steps below have been adapted from the pcloadletter.co.uk blog.

Create OpenRemote User

Go to Synology DSM User Control Panel and create a new user with name 'openremote' and give this user a password. Also, grant that user read and write access to the directory where you installed OpenRemote controller (if you used /volume1/software/openremote as described in previous steps, then this directory should grant user 'openremote' read and write access). Click the User Home button and enable the User Home Service.

Go back to your shell session (PuTTY, ssh, etc.) and modify the /etc/passwd file:

> nano /etc/passwd

Locate the line for user 'openremote' and at the end of the line, change /sbin/nologin to /bin/sh.

Now change the owner of all files under /usr/local/OpenRemote to 'openremote' user using the following command:

> chown -R openremote /usr/local/OpenRemote

Create Startup Scripts

In /etc/init.d directory create the following file (copy and paste from below). Also make sure it's 'execute' bit has been set :

> nano /etc/init.d/openremote.sh
> chmod +x /etc/init.d/openremote.sh
#!/bin/sh

User=openremote

cd /usr/local/OpenRemote/bin

case "$1" in

stop)
        echo "Stopping OpenRemote Controller..."
        su -l $User -c "/usr/local/OpenRemote/bin/openremote.sh stop" > /dev/null 2>&1 &
        ;;

start)
        # start OpenRemote in background mode
        su -l $User -c "/usr/local/Openremote/bin/openremote.sh start" > /dev/null 2>&1 &
        echo "OpenRemote Controller started..."
        ;;

restart)
        $0 stop
        sleep 5
        $0 start
        ;;
*)
        echo "usage: $0 { start | stop | restart}" >&2
        exit 1
        ;;

esac

Restart Synology and the script in /etc/init.d should be executed at the next boot up.

Startup Scripts

There's more than one way to skin the cat when it comes to boot scripts. If you've alternative scripts you've used or would like to offer enhancement to the existing bash scripts or the Synology SPK package / scripts themselves, please leave a note here on the comments section of this page or contact us on the forums.

Acknowledgements

Thanks to all of the community members who contributed to this content: daendekerk, Stein oy, davy lowet

See Also

Added by Juha Lindfors , last edit by Juha Lindfors on Apr 24, 2012 13:10

  1. Oct 24, 2011

    Patters says:

    Hi, I'm the author of the pcloadletter blog. It's very interesting to see the th...

    Hi, I'm the author of the pcloadletter blog. It's very interesting to see the things my package has helped with I've got a couple of suggestions:

    . I'm not sure you need to bootstrap your NAS to install this software. Looks to me from this HOWTO that your only dependency is the JavaVM.
    . If you do bootstrap though - the files you install for OpenRemote should be placed in /opt. That goes for the daemon init script too. That way it would survive a DSM upgrade.
    . It may not be such a good idea to directly link to a particular version of my package files, in case they change in future. This will happen when Oracle increment the build numbers.

    However - how would you like me to build a Synology package for OpenRemote? Since I already maintain a few it should be pretty simple, especially since you have no dependency to any architecture-specific compiled binaries, so one package would fit all.

    Cheers,

    Patters

    1. Oct 24, 2011

      Juha Lindfors says:

      Hello Patrick, Cool that you found your way back to us – there's quite so...

      Hello Patrick,

      Cool that you found your way back to us – there's quite some interest in running Java on Synology and this page is more or less put together from the information people delivered to us through the forum thread : Success with installing Controller on Synology NAS.

      Thanks for your suggestions as well, will apply them as I best can.

      Regarding ipkg, I agree with your point, it doesn't look like the process requires any packages to be installed through it, at least we don't mention any So seems like it wouldn't be necessary indeed, although I'm not able to verify since I don't have Synology at hand myself.

      Regardless, I will change the recommended install location to under /opt – which seems the best choice.

      Also agreed on direct linking – both from the point of view of Oracle changing their packages and any fixes/updates you make to your Synology package scripts. At the same time I'd prefer to have as much information as possible in a single location because it makes it easier for the users to complete all the steps.

      On Oracle updates, they do them fairly regularly (bug fix releases) – however, they are usually consistent in their naming conventions for the updates. Would it be feasible to modify the scripts to pick up the correct distribution file not on exact file name match but on some naming pattern? Just an idea. Of course the ideal solution would be to include Java in Synology package distributions themselves but this is a bit iffy at least for the ARM versions at the moment.

      Regarding other updates to your package scripts, would definitely want to stay in sync for those too. I'm open to suggestions what you feel is the best way to handle this. I've included copies on this page mostly for archiving purposes – websites go down, blogs move, and the current versions have been verified to work – but would definitely be interested in better solutions.

      I think having a proper Synology package would be excellent, as it reduces the steps – albeit still leaves the issue of Java download – and I suggested this here: http://www.openremote.org/display/forums/Success+with+installing+Controller+on+Synology+NAS?focusedCommentId=19433035#comment-19433035.

      Of course this just moves the maintenance issue to OpenRemote side when we update our binary, then the Synology packages need to be updated. Again I'm open to suggestions here since I'm not familiar with the Synology system. One option would be if it's possible to generate the packages as part of our build process then the process to create them would be codified and automatically updated with a new OpenRemote release.

      Let me know what you think?

      1. Oct 24, 2011

        Patters says:

        Making a package for Open Remote would massively simplify it and remove the need...

        Making a package for Open Remote would massively simplify it and remove the need for users to edit config files etc. The requirements are pretty identical to Serviio which I have already packaged - create a user with a random password, have the daemon run as that user, survive a DSM upgrade, etc. Is there user data that needs to persist during a version upgrade? If so where is it? I can have a go at making something, and I can just have it exit with a warning if Java is not already installed (as I do with Serviio). Do you have a suitable 72x72 logo icon in PNG format on a transparent background?

        My next aim is to make a proper Synology package repository, to leverage functionality built in to the Package Center. Then all users need to do is add the repo URL to their NAS. They are only shown which packages correspond to their platform, package dependencies are checked, there's an automatic notification of updates to packages, and a changelog field for updates too. All that would simplify the user experience even more.

        As for whether the Java package could have looser filename matching - it is possible, but there are other things which are likely to change (like the Syno toolchain versions), and the package version tags would need updating to match - they're static in fact so that's not possible. Given that it only changes every quarter or so I'll leave it as is for now. Plus Oracle could change their naming. They do seem to keep re-organising their website which is why I only link to their top level page for Java Embedded.

        1. Oct 24, 2011

          Juha Lindfors says:

          I agree proper Synology package would be the best way. There is user data that ...

          I agree proper Synology package would be the best way.

          There is user data that needs to be preserved – right now all files are written within the Apache Tomcat's directory structure which is included in the standard OpenRemote distribution – so in our case it is under OpenRemote[Tomcat]/webapps/controller.

          Apache Tomcat also creates other additional work files in its temp and work folders – if you've packages that already include Tomcat you've probably gone through this. If not, we can work through the details.

          You can find 72px logo attached to this issue: http://jira.openremote.org/browse/ANDROID-94

          Let me know if the logo needs further modifications.

          Long term, a proper package repository would be really cool indeed.

          Let me know if you need further assistance with this – either here or email me directly at juha@openremote.org

          1. Nov 22

            Patters says:

            The package is done - scripts published too: http://pcloadletter.co.uk/2011/10/2...

            The package is done - scripts published too: http://pcloadletter.co.uk/2011/10/25/openremote-package-for-synology/

            Install directly from inside Package Center by using the repository URL: http://pcloadletter.comlu.com

            This repo also hosts my Java packages for ARM and Intel, which you'll need.

© 2008-2011 OpenRemote Inc. OpenRemote is a trademark of OpenRemote, Inc.
Adaptavist Theme Builder (3.3.3-conf210) Powered by Atlassian Confluence 2.10.3, the Enterprise Wiki.
Free theme builder license