Author Topic: Vera Concierge running on NAS Synology  (Read 391 times)

Offline gonzo41

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Vera Concierge running on NAS Synology
« on: April 08, 2018, 12:41:42 pm »
Hi,

I was trying to install the Vera Concierge Server on my NAS Synology and it was not very easy for me.

I will try to explain (sorry for my poor english) what i have done for those who want to do the same.

The install was done on a NAS Synology DS216play with DSM 6.1.6-15266

1 - Install the java package from the package Center : JAVA8 ver 8.0.151-0014 and reboot the NAS

2- SSH the NAS with Putty

3 - Create a directory to put the application.
   
Code: [Select]
mkdir /volume1/Disque_Interne/veraconcierge
4 - Go to the directory you create and upload the application
   
Code: [Select]
cd /volume1/Disque_Interne/veraconcierge
wget https://storage.googleapis.com/veraconcierge.appspot.com/ConciergeServerVersions/ConciergeServer.jar
   
5 -   Execute the application once, so it will create all the files in the directory
   
Code: [Select]
java -jar ConciergeServer.jar   
These files would be created : conciergeserver  ConciergeServer.jar  install.sh  uninstall.sh  update.sh
   
6 - Delete conciergeserver, install.sh, uninstall.sh and update.sh because it's not working on Synology OS and we will create new files
   
Code: [Select]
rm install.sh uninstall.sh update.sh conciergeserver   
   
If you launch the application as indicated : java -jar ConciergeServer.jar service
   
The server will listen to the 127.0.0.1 or localhost address and no way for me to access to the web page from my computer.
   
Fortunatly, the developper add a parametrer you can specify to change the default server address : -ip
   
The command line should be java -jar ConciergeServer.jar service -ip XX.XX.XX.XX (XX.XX.XX.XX is the internal IP address of your NAS (like 192.168.1.27))
   
7 - Create the file ConciergeServer.sh and copy this :
   
 
Code: [Select]
#!/bin/sh
    PATH=/opt/bin:/opt/sbin:/usr/sbin:/usr/bin:/sbin:/bin
APPPATH=/volume1/Disque_Interne/veraconcierge
    JAVADIR=/var/packages/Java8/target/j2sdk-image/jre/bin/java
SERVERIP=XX.XX.XX.XX
    DESC="VeraConcierge Server"
    PIDFILE=/var/run/VeraConcierge.pid

    set -e
    start() {
            if [ -f $PIDFILE ]; then
                    echo "Warning : $PIDFILE still present. Unclean shutdown ?"
                    kill -s 9 `cat $PIDFILE` 2>/dev/null
                    rm -f $PIDFILE 2>/dev/null
            fi
            echo -n "Starting $DESC... "
            $JAVADIR -jar $APPPATH/ConciergeServer.jar service -ip $SERVERIP -delay 60&
PID=$!
echo $PID > $PIDFILE
            echo "done"
    }
    stop() {
            echo -n "Stopping $DESC... "
            if [ -f $PIDFILE ]; then
                    kill -9 `cat $PIDFILE` 2>/dev/null
                    rm -f $PIDFILE 2>/dev/null
            fi
            echo "done"
    }
    case "$1" in
            start)
                    start
                    ;;
            stop)
                    stop
                    ;;
            restart)
                    stop
                    sleep 1
                    start
                    ;;
            *)
                    echo "Usage: $0 (start|stop|restart)"
                    exit 1
                    ;;
    esac
   
   You have to change :
      - The APPPATH value to the path of the directory you create at step 3,
      - the JAVADIR value to the full Path for java.exe
      - the SERVERIP value to the internal IP address of your NAS (like 192.168.1.27)
      
8 - Make the file executable
   
Code: [Select]
chmod +x  ConciergeServer.sh   
   You can now test the application :
   
   
Code: [Select]
sudo ./ConciergeServer.sh start   
   Wait about 1 min and you should be able to access to the interface on your web browser at https://XX.XX.XX.XX:8989 where XX.XX.XX.XX is the internal IP address of your NAS (like 192.168.1.27)
   
How to use
       To start the application :
       
Code: [Select]
sudo ./ConciergeServer.sh start
   To stop the application :
   
Code: [Select]
sudo ./ConciergeServer.sh stop   
   To restart the application :
   
Code: [Select]
sudo ./ConciergeServer.sh restart   
9 - Create now a task in the tasks scheduler of the Synology so the application will start with the NAS :
   Create a triggered task, user-defined task.
   task:Veraconcierge or whatever you want
   user:root
   event:boot-up
   
   to the user-defined script , copy-paste :
   cd /volume1/Disque_Interne/veraconcierge/
   ./ConciergeServer.sh start
   
   Change the directory to the one you created at step 3
   
10 - For future update, create the file update.sh and copy this

Code: [Select]
#!/bin/sh
./ConciergeServer.sh stop
mv ConciergeServer.jar old.jar
mv new.jar ConciergeServer.jar
./ConciergeServer.sh start

Now the vera concierge is running on my synology...i'ts time to learn how to use it   ;D

Many thanks to RichardTSchaefer for this app.
   
« Last Edit: April 08, 2018, 02:05:57 pm by gonzo41 »

Offline vicw

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
Re: Vera Concierge running on NAS Synology
« Reply #1 on: May 03, 2018, 03:13:58 pm »
You had provided a very good, detailed set of instructions. I wish I had found it sooner, as I had given up hope that Vera Concierge could be run on the Synology NAS. I set up a Raspberry Pi as an alternative, and have been using it successfully with Google Home, but I might try this, using your instructions.

I'm curious to hear if you have had success using the Synology NAS to work with Google Home since you completed the installation.
VeraEdge FW 1.7.2043

Offline 4Crawler

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +2/-0
    • YouTube channel
Re: Vera Concierge running on NAS Synology
« Reply #2 on: May 06, 2018, 02:24:08 pm »
Great post, worked fairly well.  One key step is to make sure and run the Java8 executable at that first time, I also have Java7 installed and that seems to be the one that runs from the $PATH. 

Did you have to do anything special with the firewall settings for the two ports, 8989 and 8998?
I installed this on my Synology DS1513+ and it seems to be working.  I have both ports allowed in the Security->Firewall, both source and destination and I still get the error message about blocked ports in the Connectivity test.

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10032
  • Karma: +759/-141
    • RTS Services Plugins
Re: Vera Concierge running on NAS Synology
« Reply #3 on: May 06, 2018, 07:05:05 pm »
If you know of a way for me to uniquely identify this is running on that platform ... I can fold the changes into the standard installation procedure.

Offline 4Crawler

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +2/-0
    • YouTube channel
Re: Vera Concierge running on NAS Synology
« Reply #4 on: May 07, 2018, 02:10:14 am »
Great post, worked fairly well.  One key step is to make sure and run the Java8 executable at that first time, I also have Java7 installed and that seems to be the one that runs from the $PATH. 

Did you have to do anything special with the firewall settings for the two ports, 8989 and 8998?
I installed this on my Synology DS1513+ and it seems to be working.  I have both ports allowed in the Security->Firewall, both source and destination and I still get the error message about blocked ports in the Connectivity test.

With Richard's help, was able to identify the issue.  Turns out an executable named "keytool" is required and it's in the Java8 binary directory.  That directory needs to be added to the path in the ConciergeServer.sh shell script, something like this:

Code: [Select]
    PATH=/opt/bin:/opt/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/var/packages/Java8/target/j2sdk-image/bin

The keytool is what generates the https certificate and without that, it seems the Vera - Server communication isn't working.  I did have to add a firewall rule for the two ports.  All is now working, although it took a few tries through Google Home to get the Vera Concierge service and what not all linked up. 

The Synology is a perfect host for this as it's always on, maybe with the hard drives powered down at night. 

Offline 4Crawler

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +2/-0
    • YouTube channel
Re: Vera Concierge running on NAS Synology
« Reply #5 on: May 07, 2018, 01:52:48 pm »
If you know of a way for me to uniquely identify this is running on that platform ... I can fold the changes into the standard installation procedure.

Here's the uname output (DiskStation is the machine name on my network), but the "synology_" string seems to be unique.  I imagine "cedarview" is the name of the Synology build tree.  DS1513+ is the model of my NAS.

Code: [Select]
uname -a
Linux DiskStation 3.10.102 #15266 SMP Mon Mar 26 15:08:22 CST 2018 x86_64 GNU/Linux synology_cedarview_1513+

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1160
  • Karma: +23/-13
Re: Vera Concierge running on NAS Synology
« Reply #6 on: May 07, 2018, 02:17:27 pm »
Just a suggestion- create a docker image and run that in the Synology client for Docker.   That is how some of us Synology users have been running the Echo Bridge for several years.

I actually see a Docker repository called "jrowland/vera-concierge"...
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)