Forum Smart'ny Dom

Domoticz błąd po de...
 

Domoticz błąd po deklaracji GPIO jako 'in'  

  RSS
marekm
(@marekm)
Nowy

Witam

Jestem 'nowy' w środowisku domotowicza i napotkałem na problem. Posiadam raspberry pi 4 i chciałbym dodać do niej kontaktron. Skorzystałem z tego poradnika (metoda 2ga) http://kostrzewinki.pl/podlaczenia-kontaktronu-raspberry-pi-systemie-domoticz/ i niestety po dodaniu wpisu w pliku domoticz.sh domoticz nie uruchamia się i wyrzuca w logu coś takiego: 

2019-07-08 18:18:24.926  Status: Domoticz V4.10717 (c)2012-2019 GizMoCuz
2019-07-08 18:18:24.931  Status: Build Hash: b38b49e5, Date: 2019-05-09 13:04:08
2019-07-08 18:18:24.931  Status: Startup Path: /home/pi/domoticz/
2019-07-08 18:18:25.055  Sunrise: 04:22:00 SunSet: 21:19:00
2019-07-08 18:18:25.055  Day length: 16:57:00 Sun at south: 12:50:00
2019-07-08 18:18:25.055  Civil twilight start: 03:29:00 Civil twilight end: 22:12:00
2019-07-08 18:18:25.055  Nautical twilight start: 01:53:00 Nautical twilight end: 23:48:00
2019-07-08 18:18:25.055  There is no astronomical twilight in the space of 24 hours
2019-07-08 18:18:25.058  Status: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
2019-07-08 18:18:25.062  Status: Using 1-Wire support (kernel W1 module)...
2019-07-08 18:18:25.077  Active notification Subsystems: (0/13)
2019-07-08 18:18:25.101  Status: WebServer(HTTP) started on address: :: with port 8080
2019-07-08 18:18:25.118  Status: WebServer(SSL) started on address: :: with port 443
2019-07-08 18:18:25.170  Starting shared server on: :::6144
2019-07-08 18:18:25.171  Status: TCPServer: shared server started...
2019-07-08 18:18:25.171  Status: RxQueue: queue worker started...
2019-07-08 18:18:27.172  Status: 1Wire: Added Device: 28-000008f38c62
2019-07-08 18:18:28.067  Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!
2019-07-08 18:18:28.081  Status: GPIO: Interrupt handler for GPIO 3 started (TID: 641)
2019-07-08 18:18:28.082  Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!
2019-07-08 18:18:28.084  Error: Domoticz(pid:552, tid:586('MainWorker')) received fatal signal 6 (Aborted)
2019-07-08 18:18:28.084  Error: siginfo address=0x228, address=0xffffffff
2019-07-08 18:18:28.100  Status: GPIO: Interrupt handler for GPIO 3 started (TID: 644)
2019-07-08 18:18:29.068  (DS18B20#1) Temp (Temperatura dom)
2019-07-08 18:18:29.069  (DS18B20#1) Temp (Temperatura dom)
2019-07-08 18:18:31.027  Error: Thread 12 (Thread 0xb0cff220 (LWP 586)):
2019-07-08 18:18:31.027  Error: #0  __waitpid (options=0, stat_loc=0xb0cfdd78, pid=645) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2019-07-08 18:18:31.027  Error: #1  __waitpid (pid=645, stat_loc=0xb0cfdd78, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2019-07-08 18:18:31.027  Error: #2  0x002d8840 in dumpstack_gdb(bool) ()
2019-07-08 18:18:31.027  Error: #3  0x002d8e2c in signal_handler(int, siginfo_t*, void*) ()
2019-07-08 18:18:31.027  Error: #4  <signal handler called>
2019-07-08 18:18:31.027  Error: #5  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2019-07-08 18:18:31.027  Error: #6  0xb6bb2230 in __GI_abort () at abort.c:79
2019-07-08 18:18:31.027  Error: #7  0x00a1ad7c in __gnu_cxx::__verbose_terminate_handler() ()
2019-07-08 18:18:31.027  Error: #8  0x0097b45c in __cxxabiv1::__terminate(void (*)()) ()
2019-07-08 18:18:31.027  Error: #9  0x0097b4d0 in std::terminate() ()
2019-07-08 18:18:31.027  Error: #10 0x0026ca30 in std::_Sp_counted_ptr_inplace<std::thread, std::allocator<std::thread>, (__gnu_cxx::_Lock_policy)1>::_M_dispose() ()

 

Tak wygląda mój plik domoticz.sh: 

#! /bin/sh
### BEGIN INIT INFO
# Provides:          domoticz
# 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: 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/pi/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
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()
{
        # 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

:

/usr/bin/gpio export 2 out
/usr/bin/gpio export 3 in
/usr/bin/gpio edge 3 both

 

Może ktoś z was się z tym spotkał? Przeszukałem chyba cały internet, jednak nie znalazłem odpowiedzi 🙁

Z góry dziękuję za pomoc!

Cytuj
Dodane : 10/07/2019 2:59 pm
Tagi tematu
isom
 isom
(@isom)
Szef Moderator Zasłużony dla Forum, Donator 2019

@marekm nie mam pewności bo nie mam RBPi 4 czy nowy system ( buster) toleruje starą metodę obsługi GPIO , ale jedno jest pewne źle deklarujesz te GPIO w pliku domoticza 

powinno być 

/usr/local/bin/gpio export 2 out
/usr/local/bin/gpio export 3 in
/usr/local/bin/gpio edge 3 both

i oczywiście muszą być zainstalowane biblioteki wiringPi

I pamiętaj że po zmianie pliku konfigu domoticza trzeba albo zrestartować malinę albo chociaż domoticza

sudo /etc/init.d/domoticz.sh restart
OdpowiedzCytuj
Dodane : 10/07/2019 4:26 pm
marekm
(@marekm)
Nowy

Dzięki za odpowiedź,

Gdy wpisuje tak jak ty podałeś, to gdy wpiszę komendę 'gpio exports' to nie ma żadnego wyniku. Zrobiłem to zgodnie z wiki: https://www.domoticz.com/wiki/GPIO próbowałem również za pomocą 'echo 2 > ......' Rezultat niestety taki sam ;/

OdpowiedzCytuj
Dodane : 10/07/2019 4:45 pm
Udostępnij:



Udostępnij
  • 1
    Share

Proszę Zaloguj Się lub Zarejestruj