Re: Nefit Easy™
Posted: Tuesday 31 January 2017 22:55
@jumbotroll
thanks, I see the devices now. I had a feeling it was something simple i forgot.
thanks, I see the devices now. I had a feeling it was something simple i forgot.
did as u said.jannl wrote:My crontab line is:The contents of the nefit.sh script:Code: Select all
@reboot /home/pi/domoticz/scripts/nefit.sh > /dev/null 2>&1
Take care of the path setting in the script. A script run by crontab never has any path settings. Not sure btw if the games thingie is needed.....Code: Select all
#!/bin/bash NEFIT_SERIAL_NUMBER=123456 NEFIT_ACCESS_KEY=mycode NEFIT_PASSWORD=mypassword PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games easy-server --serial=$NEFIT_SERIAL_NUMBER --access-key=$NEFIT_ACCESS_KEY --password=$NEFIT_PASSWORD 2>&1
ivovangastel wrote:Hi all,
is there a manual "installing nefit easy http server" on a synology NAS for dummies?
I have a DS214+ (DSM 6.0.2) with Domoticz V3.5877 and Node.JS V4 installed. I use it to control my blinds and a wallplug via RFXCOM.
now i would like to add control to my Nefit Easy.
I tried to add the server via the hardware menu in Domoticz. but no new devices appear. I see the following in the log:
2017-01-31 18:18:58.290 Error: Webserver: File '/bridge/ecus/rrc/uiStatus': No such file or directory (2)
2017-01-31 18:18:58.352 Error: NefitEasy: Invalid data received (main)!
2017-01-31 18:18:58.353 Error: Webserver: File '/bridge/system/appliance/systemPressure': No such file or directory (2)
2017-01-31 18:18:58.413 Error: NefitEasy: Invalid data received! (Press)
I logged in my NAS via SSH and tried to install the server with the command: npm i nefit-easy-http-server -g
but I get the following:
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path /var/services/homes
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir
npm ERR! EEXIST: file already exists, mkdir '/var/services/homes'
File exists: /var/services/homes
Move it away, and try again.
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.2825733194
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2825733194'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.2825733194']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.2825733194' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
So now I am a bit lost. where do I start?
jurgen wrote:Hi Ivo,
Please see https://www.domoticz.com/wiki/Synology
I have wrote the tutorial and post it on the wiki.
Good luck.
ivovangastel wrote:Hi all,
is there a manual "installing nefit easy http server" on a synology NAS for dummies?
I have a DS214+ (DSM 6.0.2) with Domoticz V3.5877 and Node.JS V4 installed. I use it to control my blinds and a wallplug via RFXCOM.
now i would like to add control to my Nefit Easy.
I tried to add the server via the hardware menu in Domoticz. but no new devices appear. I see the following in the log:
2017-01-31 18:18:58.290 Error: Webserver: File '/bridge/ecus/rrc/uiStatus': No such file or directory (2)
2017-01-31 18:18:58.352 Error: NefitEasy: Invalid data received (main)!
2017-01-31 18:18:58.353 Error: Webserver: File '/bridge/system/appliance/systemPressure': No such file or directory (2)
2017-01-31 18:18:58.413 Error: NefitEasy: Invalid data received! (Press)
I logged in my NAS via SSH and tried to install the server with the command: npm i nefit-easy-http-server -g
but I get the following:
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path /var/services/homes
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir
npm ERR! EEXIST: file already exists, mkdir '/var/services/homes'
File exists: /var/services/homes
Move it away, and try again.
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.2825733194
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2825733194'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.2825733194']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.2825733194' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
So now I am a bit lost. where do I start?
few messages backcheckdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops
Sent from my iPad using Tapatalk
Create the following script and save it in the directory /usr/local/etc/rc.d/checkdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops
Sent from my iPad using Tapatalk
Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: nefit easy http server
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nefit-easy-http-server
# Description: This daemon will start the nefit-easy-http-server for use by Domoticz
### END INIT INFO
# Do NOT "set -e"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Nefit Easy HTTP Server"
NAME=easy-server
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/usr/local/etc/rc.d/$NAME
NEFIT_SERIAL_NUMBER=ENTERYOURSERIAL
NEFIT_ACCESS_KEY=ENTERYOURKEY
NEFIT_PASSWORD=ENTERYOURPASSWORD
NEFIT_HOST=127.0.0.1
NEFIT_PORT=3000
DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER"
DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY"
DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD"
DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST"
DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
#
# Function that starts the daemon/service
#
do_start()
{
nohup $DAEMON $DAEMON_ARGS &
echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE`
}
wait_for_status ()
{
counter=$2
while [ ${counter} -gt 0 ]; do
do_status
[ $? -eq $1 ] && return
let counter=counter-1
sleep 1
done
return 1
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Kill the application
kill `cat ${PIDFILE}`
wait_for_status 1 20 || kill -9 `cat ${PIDFILE}`
rm -f ${PIDFILE}
}
do_status ()
{
if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then
return
fi
rm -f ${PIDFILE}
return 1
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 3
;;
esac
:
i have the script ready and saved on my laptop (.sh).jurgen wrote:Create the following script and save it in the directory /usr/local/etc/rc.d/checkdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops
Sent from my iPad using Tapatalk
Enter your key, password etc.. before save it in the directory.
Code: Select all
#! /bin/sh ### BEGIN INIT INFO # Provides: nefit easy http server # Required-Start: $network $remote_fs $syslog # Required-Stop: $network $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: nefit-easy-http-server # Description: This daemon will start the nefit-easy-http-server for use by Domoticz ### END INIT INFO # Do NOT "set -e" PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DESC="Nefit Easy HTTP Server" NAME=easy-server USERNAME=root PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/usr/local/etc/rc.d/$NAME NEFIT_SERIAL_NUMBER=ENTERYOURSERIAL NEFIT_ACCESS_KEY=ENTERYOURKEY NEFIT_PASSWORD=ENTERYOURPASSWORD NEFIT_HOST=127.0.0.1 NEFIT_PORT=3000 DAEMON=/usr/local/bin/$NAME DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER" DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY" DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD" DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST" DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT" # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # # Function that starts the daemon/service # do_start() { nohup $DAEMON $DAEMON_ARGS & echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE` } wait_for_status () { counter=$2 while [ ${counter} -gt 0 ]; do do_status [ $? -eq $1 ] && return let counter=counter-1 sleep 1 done return 1 } # # Function that stops the daemon/service # do_stop() { # Kill the application kill `cat ${PIDFILE}` wait_for_status 1 20 || kill -9 `cat ${PIDFILE}` rm -f ${PIDFILE} } do_status () { if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then return fi rm -f ${PIDFILE} return 1 } case "$1" in start) do_start ;; stop) do_stop ;; restart) do_stop do_start ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 exit 3 ;; esac :
Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: nefit easy http server
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nefit-easy-http-server
# Description: This daemon will start the nefit-easy-http-server for use by Domoticz
### END INIT INFO
# Do NOT "set -e"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Nefit Easy HTTP Server"
NAME=easy-server
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/usr/local/etc/rc.d/$NAME
NEFIT_SERIAL_NUMBER=ENTERSERIAL
NEFIT_ACCESS_KEY=ENTERKEY
NEFIT_PASSWORD=ENTERPASSWORD
NEFIT_HOST=127.0.0.1
NEFIT_PORT=3000
DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER"
DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY"
DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD"
DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST"
DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
#
# Function that starts the daemon/service
#
do_start()
{
nohup $DAEMON $DAEMON_ARGS &
echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE`
}
wait_for_status ()
{
counter=$2
while [ ${counter} -gt 0 ]; do
do_status
[ $? -eq $1 ] && return
let counter=counter-1
sleep 1
done
return 1
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Kill the application
kill `cat ${PIDFILE}`
wait_for_status 1 20 || kill -9 `cat ${PIDFILE}`
rm -f ${PIDFILE}
}
do_status ()
{
if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then
return
fi
rm -f ${PIDFILE}
return 1
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 3
;;
esac
: