ldleman / yana-server

Interface PHP de domotique Y.A.N.A (You Are Not Alone)
http://projet.idleman.fr/yana
107 stars 59 forks source link

Probleme Prise Chacon | RESOLU #310

Open ruf147 opened 6 years ago

ruf147 commented 6 years ago

Bonsoir a tous,

J' ai décider depuis peu de ressortir mon raspberry pour recommencer a m' amuser avec Yana. A l' install, pas de problème, que ce soit serveur ou client, mais la ou je bloque, c' est au niveau des relais radio via l' interface web... Je pense un soucis de droit que je n' arrive malheureusement pas à résoudre...

Pour faire simple quand je crée un relais radio via le plugin, que je le déclenche, rien ne ce passe.. Alors qu' en ligne de commande pas de soucis.. Que ce soit avec le plugin d' Idle ou de maditnerd.. Le seul hic, c est seulement via la page web...

Dans : /var/log/apache2/eror.log j' ai cela

/usr/bin/gpio: Unknown command: /usr/local/bin/gpio.
setuid: Operation not permitted

Pour ce qui est des droits avec ls -l

total 852
-rwxrwxrwx  1 www-data www-data   2725 janv. 15 17:41 404.html
-rwxrwxrwx  1 www-data www-data  11078 janv. 15 17:41 action.php
drwxrwxrwx  2 www-data www-data   4096 janv. 15 17:41 api
-rwxrwxrwx  1 www-data www-data    211 janv. 15 17:41 apigen.neon
-rwxrwxrwx  1 www-data www-data 607416 janv. 15 17:41 apigen.phar
drwxrwxrwx  4 www-data www-data   4096 janv. 15 17:43 cache
drwxrwxrwx  2 www-data www-data   4096 janv. 15 17:41 classes
-rwxrwxrwx  1 www-data www-data   5865 janv. 15 17:41 common.php
-rwxrwxrwx  1 www-data www-data   1450 janv. 15 17:43 constant.php
-rwxrwxrwx  1 www-data www-data   1457 janv. 15 17:41 constant.sample.php
drwxrwxrwx  2 www-data www-data   4096 janv. 15 19:05 db
-rwxrwxrwx  1 www-data www-data   1002 janv. 15 17:41 db.json
-rwxrwxrwx  1 www-data www-data      1 janv. 15 17:43 dbversion
-rwxrwxrwx  1 www-data www-data     41 janv. 15 17:41 doc.bat
-rwxrwxrwx  1 www-data www-data    139 janv. 15 17:41 footer.php
-rwxrwxrwx  1 www-data www-data    257 janv. 15 17:41 header.php
-rwxrwxrwx  1 www-data www-data    341 janv. 15 17:41 index.php
-rwxrwxrwx  1 www-data www-data  11897 janv. 15 17:41 install.php
-rwxrwxrwx  1 www-data www-data  32427 janv. 15 17:41 install.sh
drwxrwxrwx  3 www-data www-data   4096 janv. 15 17:41 lib
drwxrwxrwx  2 www-data www-data   4096 janv. 15 17:43 log
-rwxrwxrwx  1 www-data www-data  47228 janv. 15 17:41 nerve
-rwxrwxrwx  1 www-data www-data   5525 janv. 15 17:41 nerve.cpp
drwxrwxrwx 25 www-data www-data   4096 janv. 15 19:00 plugins
-rwxrwxrwx  1 www-data www-data  36945 janv. 15 17:41 RainTPL.php
-rwxrwxrwx  1 www-data www-data   3626 janv. 15 17:41 README.md
-rwxrwxrwx  1 www-data www-data   2870 janv. 15 17:41 setting.php
-rwxrwxrwx  1 www-data www-data  15955 janv. 15 17:41 socket.php
drwxrwxrwx  3 www-data www-data   4096 janv. 15 17:41 templates

Voili voilou, si une âme charitable ou même le big boss pouvait passer me donner un coup de main, cela serait bien apprécier :)

EDIT: Je tiens à préciser que j' ai déplacer le dossier web dans /var/www/

maditnerd commented 6 years ago

Droits de radioemission (idleman)

Quand je fais

ls -l /var/www/yana-server/plugins/radioRelay/radioEmission

Ca me donne

-rwsr-sr-x 1 root www-data 13331 janv. 15 20:23 radioEmission

J'ai utilisé cette commande pour les droits

sudo chown root:www-data /var/www/yana-server/plugins/radioRelay/radioEmission 
sudo chmod +s /var/www/yana-server/plugins/radioRelay/radioEmission

Yana a des logs ici :

/yana-server/log/.log.txt

Erreur apache

Pour l'erreur dans apache, radioemission utilise pas la commande /usr/bin/gpio donc je pense pas que ce soit lié. C'est l'affichage des gpios dans l'interface web qui provoque cette erreur je pense. Ca peut valoir le coup de réinstaller wiringPi pour vérifier si tout va bien de ce coté là (il y a la commande gpio dedans)

sudo git clone git://git.drogon.net/wiringPi /opt/wiringPi 
cd /opt/wiringPi
sudo ./build
ruf147 commented 6 years ago

Merci de ta réponse rapide. Moi quand je fais ls -l /var/www/plugins/radioRelay/radioEmission Me retourne -rwsrwsrwx 1 root www-data 13331 janv. 15 17:41 /var/www/plugins/radioRelay/radioEmission Quand je tape cat /var/www/log/.log.txt Me retourne

15-01-2018 21:35:03 - [notice] :Launch system command : /var/www/plugins/radioRelay/radioEmission 0 12325261 12325261 1on
15-01-2018 21:35:13 - [notice] :Launch system command : /var/www/plugins/radioRelay/radioEmission 0 12325261 12325261 0off
15-01-2018 21:35:41 - [notice] :Launch system command : /var/www/plugins/radioRelay/radioEmission 0 12325261 12325261 1on
15-01-2018 21:35:48 - [notice] :Launch system command : /var/www/plugins/radioRelay/radioEmission 0 12325261 12325261 0off

J' ai recompiler wiringPi Et quand je tape /usr/bin/gpio -v Me donne

gpio version: 2.44
Copyright (c) 2012-2017 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: /usr/bin/gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.

/usr/local/bin/gpio -v Me donne

gpio version: 2.44
Copyright (c) 2012-2017 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: /usr/local/bin/gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.

Du coup, la je suis un peu perdue, mais je reste dans l' idée que c' est un problème de droits, car ils ne sont pas les mème que les tiens..

EDIT: Je tiens juste à préciser, que l' erreur /usr/bin/gpio: Unknown command: /usr/local/bin/gpio. Arrive uniquement quand je suis l' installation et que l' ont me demande de changer dans classes/Gpio.class.php '/usr/bin/gpio' par '/usr/bin/gpio /usr/local/bin/gpio'

ruf147 commented 6 years ago

Toujours dans mes investigation, à changer les droits... Maintenant j ai cette erreur dans les logs d' apache2

Segmentation fault

ruf147 commented 6 years ago

Bon j' avance doucement mais surement, j' ai réussi à avoir les mêmes droit que toi tu as -rwsr-sr-x 1 root www-data 13376 janv. 15 22:41 /var/www/plugins/radioRelay/radioEmission

Par contre, dans le dashboard, pour le widget de la prise chacon, il y est maintenant écris

Attention, les droits vers le fichier
radioEmission sont mal réglés.
Référez vous à la doc pour les régler

Et j' ai toujours cette erreur dans les logs d' apache Segmentation fault

ruf147 commented 6 years ago

RESOLU

En suivant ce post

https://github.com/ldleman/yana-server/issues/110