Page 1 sur 1

PB Installation MotionEye

Publié : 21 avr. 2021, 22:20
par DavidFromRouen
Bonsoir à tous,

Ayant reçu aujourd'hui mes ESP32-CAM, je souhaitais installer MotionEye et ainsi profiter de la détection avec Domoticz.
J'ai tenté plusieurs fois, mais sans succès.
J'ai systématiquement une erreur quand je vérifie l'état du service.
Aucun message d'erreur lors de l'installation.
Lorsque je check avec la commande : sudo service motioneye status

J'ai ceci:

Code : Tout sélectionner

● motioneye.service - motionEye Server
   Loaded: loaded (/etc/systemd/system/motioneye.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2021-04-21 21:54:54 CEST; 7min ago
  Process: 361 ExecStart=/usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf (code=exited, status=1/FAILURE)
 Main PID: 361 (code=exited, status=1/FAILURE)

avril 21 21:54:53 raspberrypi systemd[1]: Started motionEye Server.
avril 21 21:54:54 raspberrypi meyectl[361]: Traceback (most recent call last):
avril 21 21:54:54 raspberrypi meyectl[361]:   File "/usr/local/bin/meyectl", line 5, in <module>
avril 21 21:54:54 raspberrypi meyectl[361]:     from motioneye.meyectl import main
avril 21 21:54:54 raspberrypi meyectl[361]:   File "/usr/local/lib/python3.7/dist-packages/motioneye/meyectl.py", line 28, in <module>
avril 21 21:54:54 raspberrypi meyectl[361]:     import settings
avril 21 21:54:54 raspberrypi meyectl[361]: ModuleNotFoundError: No module named 'settings'
avril 21 21:54:54 raspberrypi systemd[1]: motioneye.service: Main process exited, code=exited, status=1/FAILURE
avril 21 21:54:54 raspberrypi systemd[1]: motioneye.service: Failed with result 'exit-code'.


Lorsque je vais voir mon fichier "meyectl" (au passage le fichier n'est pas accessible en écriture)

Code : Tout sélectionner

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from motioneye.meyectl import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Lorsque je vais voir mon fichier "meyectl.py"

Code : Tout sélectionner

#!/usr/bin/env python

# Copyright (c) 2013 Calin Crisan
# This file is part of motionEye.
#
# motionEye is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import argparse
import logging
import os.path
import pipes
import sys

# make sure motioneye is on python path
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

import settings


_LOG_FILE = 'motioneye.log'


def find_command(command):
    if command == 'relayevent':
        relayevent_sh = os.path.join(os.path.dirname(__file__), 'scripts/relayevent.sh')

        cmd = relayevent_sh + ' "%s"' % (settings.config_file or '')

    else:
        cmd = __file__
        cmd = sys.executable + ' ' + cmd
        cmd = cmd.replace('-b', '')  # remove server-specific options
        cmd += ' %s ' % command
        cmd += ' '.join([pipes.quote(arg) for arg in sys.argv[2:]
                if arg not in ['-b']])

    return cmd


def load_settings():
    # parse common command line arguments

    config_file = None
    debug = False

    for i in xrange(1, len(sys.argv)):
        arg = sys.argv[i]
Je ne comprends pas vraiment où est le problème... :?
Avez-vous une idée s'il vous plait ?

Re: PB Installation MotionEye

Publié : 21 avr. 2021, 23:34
par garycooper
Bonjour, au début de l'installation, il faut te mettre en mode root en tapant
sudo-i
.
Motioneye ne fonctionne que sur python 2. C'est pour cela que pour l'installer il faut entrer
pip2 install motioneye
.
Pour information, je n'ai pas réussi à l'installer sur mon pi 4 qui gère Domoticz. Pour ce pi, j'ai du mettre en python 3 par défaut.
Je l'ai installé sur mon pi 4 que j'utilise en NAS avec un rock pi quad hat.
Je l'ai également installé sur un pi0w.

Re: PB Installation MotionEye

Publié : 21 avr. 2021, 23:46
par DavidFromRouen
Merci pour ta réponse.
J'ai effectivement tenté, lors de mes trois tentatives en passant en root (sudo -i)
Les Frères Poulain n'ont pas précisé cela, pour Python, les saligos ! Ils auraient pu le dire.

https://www.youtube.com/watch?v=PxVoiS94w5c&t=675s
https://www.youtube.com/watch?v=YIt121zebMM

Merci à toi, je vais retenter avec Python 2 !

Re: PB Installation MotionEye

Publié : 21 avr. 2021, 23:52
par DavidFromRouen
;) Impeccable, it works !
Merci

Re: PB Installation MotionEye

Publié : 22 avr. 2021, 06:53
par Keros
David, peux-tu éditer ton post de 22h20 pour mettre le script entre les balises Code (petit bouton crayon en haut à droite du message pour l'éditer, puis le petit bouton </> pour ajouter les balises). Ceci faciliterait la lecture. Merci

Re: PB Installation MotionEye

Publié : 22 avr. 2021, 10:29
par DavidFromRouen
Pas de soucis, C'est fait. ;)

Re: PB Installation MotionEye

Publié : 22 avr. 2021, 23:47
par garycooper
;) Impeccable, it works !
Merci
Content d'avoir pu t'aider ! Pour une fois que c'est pas à moi qu'on donne la solution :lol: !