[Résolu] Impossible de me connecter de l'extérieure sur Domoticz

Forum dédié à l'accès à DomoticZ depuis l'extérieur de chez vous : routage de ports, VPN, VPS ...
La sécurité, c'est important !!
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: Impossible de me connecter de l'extérieure sur Domoticz

Message par vil1driver »

Salut,

Bah utilise le port indiqué par ta box, c'est tout.

Et configure domoticz pour écouter ce même port.

Rien de bien tordu
MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

Tout d'abord merci pour la rapidité de ta réponse !
Pour la configutation du port dans Domoticz, il faut aller dans :
- configuration
- paramètres
- Port (pour les clients Domoticz distants): celui que l'on veut, par exemple 17044
C'est bien ça ?
Car cela ne fonctionne toujours pas :?
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: Impossible de me connecter de l'extérieure sur Domoticz

Message par vil1driver »

Non !

C'est indiqué dans ce thread !
Le port 6144 est pour la com entre 2 domoticz

D'ailleurs pourquoi vouloir changer une chose qui n'est pas 8080?

C'est le fichier domoticz.sh qu'il faut éditer,
Celui dans /etc/init.d

D'ailleurs il ne faut pas chercher loin...

https://easydomoticz.com/forum/viewtopi ... 563#p23563
MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

ok, j'avais bien lu ces infos mais je pensais qu'on pouvait peut-être le faire directement.
Je vais essayer ça après manger alors et je reviens pour la réponse (positive j'espère :lol: )
Encore merci
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

Merci à toi, cela a fonctionné.
Bonne fin de journée ...
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: [Résolu] Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

Re bonjour
Je pensais que le problème était résolu ... mais ce n'est le cas qu'en apparence !
En effet, j'ai bien accès à Domoticz en SSH et aussi maintenant sur firefox MAIS cela se déconnecte très rapidement.
Je ne comprends pas pourquoi ? ? ?
A chaque fois je suis obligé en SSH de faire un reboot puis ça marche à nouveau.
Je n'avais pas ce problème là avant changements de ports (obligé de le faire suite mise à jour de freebox sans port 8080 disspo).
C'est pourquoi j'ai l'impression que cela vient d'un paramétrage d'un fichier de redémarrage (auto) puisque un reboot résoud mon problème.
Sur les conseils (avisés ;) ) de vil1driver j'ai modifié les ports (17044 en HTTP et 17443 en HTTPS) dans /etc/init.d.
Il y aurait-il un autre ficier (ou plusieurs à modifier) ? ? ?
Je suis un peu perdu là ...
Pourtant cela fait 2 jours que je recherche ici des solutions. A chaque fois je crois que c'est bon car après reboot j'ai de nouveau accès à Domoticz puis aprèsun nouveau délai ... offline :oops:
Ci-joint les "problèmes" vus en SSH et dans le log si cela peut aider
Merci à vous pour vos retours
2020-08-21 09:50:03.023 Error: WebServer(SSL) startup failed on address 0.0.0.0 with port: 443: bind: Permission denied
2020-08-21 09:50:03.023 Error: WebServer(SSL) check privileges for opening ports below 1024



pi@raspberrypi:~ $ ps -aef | grep domoticz
root 1651 1 22 09:52 ? 00:00:19 /home/pi/domoticz/domoticz -daemon -www 17044 -sslwww 17443
pi 1797 1581 0 09:53 pts/0 00:00:00 grep --color=auto domoticz
Vous avez du nouveau courrier dans /var/mail/pi

From: root@raspberrypi (Cron Daemon)
To: pi@raspberrypi
Subject: Cron <pi@raspberrypi> sudo /home/pi/domoticz/scripts/check_domoticz_online.sh 2>&1 >> /dev/null#
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/pi>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=pi>
Message-Id: <E1k91v4-0000VM-3m@raspberrypi>
Date: Fri, 21 Aug 2020 09:57:02 +0200

/bin/sh: 1: cannot create /dev/null#: Permission denied

From pi@raspberrypi Fri Aug 21 09:58:01 2020
Return-path: <pi@raspberrypi>
Envelope-to: pi@raspberrypi
Delivery-date: Fri, 21 Aug 2020 09:58:01 +0200
Received: from pi by raspberrypi with local (Exim 4.92)
(envelope-from <pi@raspberrypi>)
id 1k91w1-0000XN-D4
for pi@raspberrypi; Fri, 21 Aug 2020 09:58:01 +0200
From: root@raspberrypi (Cron Daemon)
To: pi@raspberrypi
Subject: Cron <pi@raspberrypi> sudo /home/pi/domoticz/scripts/check_domoticz_online.sh 2>&1 >> /dev/null#
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/pi>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=pi>
Message-Id: <E1k91w1-0000XN-D4@raspberrypi>
Date: Fri, 21 Aug 2020 09:58:01 +0200

/bin/sh: 1: cannot create /dev/null#: Permission denied
En SSH :
Pb 
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Thu Aug 20 23:52:15 2020 from 192.168.0.38
pi@raspberrypi:~ $ sudo service domoticz.sh status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated)
Active: active (exited) since Thu 2020-08-20 23:53:48 CEST; 9h ago
Docs: man:systemd-sysv-generator(8)
Process: 10389 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/

août 20 23:53:48 raspberrypi systemd[1]: Starting LSB: Home Automation System...
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.818 Status
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.819 Status
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.819 Status
août 20 23:53:48 raspberrypi domoticz.sh[10389]: domoticz: Domoticz is starting
août 20 23:53:48 raspberrypi domoticz[10395]: Domoticz is starting up....
août 20 23:53:48 raspberrypi domoticz[10396]: Domoticz running...
août 20 23:53:48 raspberrypi systemd[1]: Started LSB: Home Automation System.
août 20 23:53:48 raspberrypi sudo[10365]: pam_unix(sudo:session): session closed
lines 1-15/15 (END)
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated)
Active: active (exited) since Thu 2020-08-20 23:53:48 CEST; 9h ago
Docs: man:systemd-sysv-generator(8)
Process: 10389 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)

août 20 23:53:48 raspberrypi systemd[1]: Starting LSB: Home Automation System...
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.818 Status: Domoticz V2020.2 (build 12252) (c)2012-2020 GizMoCuz
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.819 Status: Build Hash: ce7f13306-modified, Date: 2020-08-20 15:38:42
août 20 23:53:48 raspberrypi domoticz.sh[10389]: 2020-08-20 23:53:48.819 Status: Startup Path: /home/pi/domoticz/
août 20 23:53:48 raspberrypi domoticz.sh[10389]: domoticz: Domoticz is starting up....
août 20 23:53:48 raspberrypi domoticz[10395]: Domoticz is starting up....
août 20 23:53:48 raspberrypi domoticz[10396]: Domoticz running...
août 20 23:53:48 raspberrypi systemd[1]: Started LSB: Home Automation System.
août 20 23:53:48 raspberrypi sudo[10365]: pam_unix(sudo:session): session closed for user root
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: [Résolu] Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

et peut-être plutôt cette erreur !
2020-08-21 11:04:52.393 Error: mainworker seems to have ended or hung unexpectedly (last update 301.000000 seconds ago)
2020-08-21 11:04:52.393 Error: Domoticz(777) is exiting due to watchdog triggered...
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: [Résolu] Impossible de me connecter de l'extérieure sur Domoticz

Message par vil1driver »

MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
ker49
Messages : 85
Inscription : 08 janv. 2016, 18:13

Re: [Résolu] Impossible de me connecter de l'extérieure sur Domoticz

Message par ker49 »

re bonjour,
suis allé faire un tour sur le post indiqué et après une recherche sur ce qui est proposé par Thier (merci à lui au passage :) ) j'ai modifié mon domoticz.sh ... mais pas mieux.
Encore planté après un petit moment et accessible après reboot en ssh :cry:
voici mon domiticz.sh, si quelqu'un y voit quelque chose d'anormal je suis preneur car c'est galère je dois rebooter à chaque fois, au minimum le matin et soir pour pouvoir ouvrir et fermer un velux qui n'est commandable que par domoticz (pour le reste de la maison je peux faire manuellement)
#! /bin/sh
### BEGIN INIT INFO
# Provides: domoticz
# Required-Start: $network $remote_fs $syslog $time
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
# Description: This daemon will start the Domoticz Home Automation System
### END INIT INFO

# Do NOT "set -e"

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=pi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 17044"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 17443"
#OPTIONS="-www 17044"
#OPTIONS="-www 17443"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

pidof_domoticz() {
# if there is actually a domoticz process whose pid is in PIDFILE,
# print it and return 0.
if [ -e "$PIDFILE" ]; then
if pidof domoticz | tr ' ' '\n' | grep -w $(cat $PIDFILE); then
return 0
fi
fi
return 1
}

#
# Function that starts the daemon/service
#
do_start()
{

# Wait For Time Synchronization
while [ "$(timedatectl status | sed -n 's|^System clock synchronized: \(.*\)|\1|p')" != "yes" ]
do
echo -n "."
sleep 1
done
echo ""
#fin de Wait For Time Synchronization

# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}

case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
PID=$(pidof_domoticz) || true
if [ "${PID}" ]; then
kill -HUP $PID
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload}" >&2
exit 3
;;
esac

:
Répondre