Closed Davidba82 closed 6 years ago
Bonjour,
Comme tu me parles de .bashrc, j'imagine que tu es sous RaspberryPi ?
maintenant celui ci reste constamment vide
Tu veux dire que même si tu écris quelque chose dedans, celui-ci reste vide ?
Bonjour,
Oui effectivement je suis sur RaspberryPi.
Non le fichier est vide au moment de son ouvreture . J'ai patienté quelques minutes mais cela n'a rien changé fichier vide je n'ai pas tenté d'essayer de copier la ligne de commande malgré que celui-ci soit vide.
Merci pour votre aide.
Essaie de copier la ligne de commande et de poursuivre le tutoriel
Bjr,
J'ai essayé mais cela ne fonctionne pas dès que je tape la commande; node -v , la réponse est commande introuvable.
Je pense que tu n'utilises pas bash. Est-ce que tu peux essayer de taper les commandes suivantes :
bash
source ~/.bashrc
node -v
Et fais moi une capture d'écran stp !
voici le resultat
Tu dois taper la commande :
source .bashrc
Toi tu as tapé /.bashrc
...
quand tu dit ''source'' cela veux dire le dossier plus /.bashrc ou je tape pour de bon les mot "source .bashrc"
dans les 2 proposition cela ne marche pas Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Fri Mar 30 12:27:35 2018 from 192.168.0.12 pi@raspberrypi:~$ .bashrc -bash: .bashrc : commande introuvable pi@raspberrypi:~$ /.bashrc -bash: /.bashrc: Aucun fichier ou dossier de ce type pi@raspberrypi:~$ source.bashrc -bash: source.bashrc : commande introuvable pi@raspberrypi:~$
aucun resultat !
Tu dois taper source .bashrc
tel quel ... mais une fois encore tu n'as pas tapé correctement... tu n'as pas mis d'espace entre "source" et ".bashrc" ....
Et fais une copie d'écran si possible plutôt d'un copier/coller
J'aimerais aussi que tu tapes la commande suivante et que tu me fasses une copie d'écran :
ls -la
pi@raspberrypi:~$ source .bashrc -bash: .bashrc: ligne 2: erreur de syntaxe près du symbole inattendu « fi » -bash: .bashrc: ligne 2: `fi' pi@raspberrypi:~$ nano ~/.bashrc pi@raspberrypi:~$ ls -la total 33736 drwxr-xr-x 27 pi pi 4096 mars 30 12:52 . drwxr-xr-x 3 root root 4096 nov. 29 01:22 .. -rw------- 1 pi pi 16911 mars 30 12:28 .bash_history -rw-r--r-- 1 pi pi 220 nov. 29 01:22 .bash_logout -rw-r--r-- 1 pi pi 51 mars 30 12:52 .bashrc drwxr-xr-x 6 pi pi 4096 mars 26 22:21 .cache drwx------ 19 pi pi 4096 mars 28 21:39 .config drwxr-xr-x 2 pi pi 4096 mars 28 18:56 Desktop drwxr-xr-x 5 pi pi 4096 nov. 29 02:22 Documents drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Downloads drwx------ 3 pi pi 4096 nov. 29 02:56 .gnupg drwxr-xr-x 2 pi pi 4096 mars 28 15:09 .gstreamer-0.10 -rw-r--r-- 1 pi pi 80 mars 28 15:11 .gtkrc-2.0 drwxr-xr-x 3 pi pi 4096 nov. 29 02:22 .local drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Music drwxr-xr-x 2 pi pi 4096 mars 26 16:23 .nano drwxr-xr-x 3 pi pi 4096 mars 26 17:01 .node-gyp drwxr-xr-x 6 pi pi 4096 mars 21 11:39 node-v9.9.0-linux-armv7l -rw-r--r-- 1 pi pi 17190798 mars 21 11:40 node-v9.9.0-linux-armv7l.tar.gz -rw-r--r-- 1 pi pi 17190798 mars 21 11:40 node-v9.9.0-linux-armv7l.tar.gz. 1 drwxr-xr-x 5 pi pi 4096 mars 26 18:06 .npm drwxr-xr-x 4 pi pi 4096 mars 26 15:51 oldconffiles drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Pictures drwx------ 3 pi pi 4096 mars 26 22:21 .pki drwxr-xr-x 5 pi pi 4096 mars 28 18:57 .pm2 -rw-r--r-- 1 pi pi 675 nov. 29 01:22 .profile drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Public drwxr-xr-x 2 pi pi 4096 nov. 29 02:22 python_games drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Templates drwxr-xr-x 3 pi pi 4096 mars 26 18:00 .themes drwx------ 4 pi pi 4096 mars 28 18:55 .thumbnails drwxr-xr-x 2 pi pi 4096 nov. 29 02:56 Videos drwx------ 3 pi pi 4096 mars 28 21:36 .vnc -rw-r--r-- 1 pi pi 180 mars 26 16:58 .wget-hsts drwxr-xr-x 9 pi pi 4096 mars 26 18:00 .WolframEngine -rw------- 1 pi pi 56 mars 30 10:17 .Xauthority -rw------- 1 pi pi 3968 mars 30 10:17 .xsession-errors -rw------- 1 pi pi 3965 mars 29 17:17 .xsession-errors.old pi@raspberrypi:~$
je viens de supprimer le ''fi'' de fin également ,
Montre moi le contenu de ton fichier .bashrc
comment je fait ? je tape nano ~/.bashrc ?
Par exemple, ou more .bashrc
pi@raspberrypi:~$ nano ~/.bashrc pi@raspberrypi:~$ node -v -bash: node : commande introuvable pi@raspberrypi:~$ more .bashrc PATH=$PATH:/home/pi/node-v9.9.0-linux-armv7l/bin
Encore une fois tu n'as pas recopié ce qu'il fallait...
Dans ce fichier tu devrais avoir :
export PATH=$PATH:/home/pi/node-v9.9.0-linux-armv7l/bin
Tu as donc oublié le export
au début.
Modifier le fichier et ensuite fais un source .bashrc
fichier modifier pi@raspberrypi:~$ nano ~/.bashrc pi@raspberrypi:~$ source .bashrc pi@raspberrypi:~$
OK donc maintenant :
node -v
mais comme je te lai dit mon fichier est totalement vide juste la phrase que j'ai copier
Oui oui
la réponse est bonne maintenant
pi@raspberrypi:~$ node -v
v9.9.0
je vais continue l’installation et je te tien accourant de la suite merci déjà pour ton aide et ta patience avec moi !!!
3 jours sans nouvelles, donc je vais supposer que tu as réussi. Si ce n'est pas le cas, n'hésite pas à poser tes questions ici.
Bonsoir, Non pas eu le temps de finir en déplacement actuellement je rentre en fin de soirée !!
Bon pour te donner la suite ,,j'ai fais le test avec allume et éteint la freebox cella a fonctionner, mais après avoir redémarre le Raspberry j'ai du relancer le script avec la commande ""cd ~/assistant-plugins/ node index.js"" sinon sa ne fonctionne pas j'ai continue a suivre le tuto et a la fin j'ai une une erreur
dans la réponse de la commande il y'a une ligne qui est écrit ERROR [PM2][ERROR] script not found : /home/pi/index.js
[DONE] +---------------------------------------+ [PM2] Freeze a process list on reboot via: $ pm2 save
[PM2] Remove init script via:
$ pm2 unstartup systemd
pi@raspberrypi:~$ pm2 start index.js
[PM2][ERROR] script not found : /home/pi/index.js
script not found : /home/pi/index.js
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
Use pm2 show <id|name>
to get more details about an app
pi@raspberrypi:~$ pm2 save
[PM2] Saving current process list...
[PM2] Successfully saved in /home/pi/.pm2/dump.pm2
pi@raspberrypi:~$
Comme l'indique la documentation : « Si après un reboot, le programme ne s'est pas lancé, alors voici une méthode alternative »
Je t'invite donc à suivre la méthode alternative décrite sur la même page de documentation, tout en bas : https://github.com/Aymkdn/assistant-plugins/wiki/Installation-de-assistant-plugins-sur-RaspberryPi
Je viens de réorganiser un peu l'aide. Tu dois utiliser la "méthode 1" (et j'ai mis l'autre en "méthode 2" car plusieurs personnes m'ont dit que ça ne fonctionnait pas chez eux non plus)
après avoir exécuter la méthode 1 et redémarre plus rien ne marche j'ai ré approuver a l'aide https://ifttt.com/services/pushbullet/settings rien a faire alors que quand je lance la commande
[assistant] Installation terminée. pi@raspberrypi:~/assistant-plugins$ pi@raspberrypi:~/assistant-plugins$ node index.js [assistant] Assistant v2.0.2 : Chargement en cours... [assistant] 4 plugins trouvés. [assistant] Chargement du plugin 'freebox' (v2.0.7) [assistant-freebox] Récupération des chaines terminée ! [assistant-freebox] Plugin chargé et prêt. [assistant] Chargement du plugin 'ifttt' (v2.0.0) [assistant-ifttt] Plugin chargé et prêt. [assistant] Chargement du plugin 'notifier' (v2.0.0) [assistant-notifier] Plugin chargé et prêt. [assistant] Chargement du plugin 'wait' (v2.0.1) [assistant-wait] Plugin chargé et prêt. [assistant] Prêt à écouter les commandes via PushBullet
j'ai une réponse positive..
Tape crontab -l
et montre moi ce que tu as (copie d'écran)
pi@raspberrypi:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
@reboot /home/pi/node-v9.9.0-linux-armv7l/bin/node /home/pi/assistant-plugins/index.js > /home/pi/assistant-plugins.log &
Est-ce que tu as quelque chose dans /home/pi/assistant-plugins.log
?
quand je tape /home/pi/assistant-plugins.log il me dit Permission non accordée et quand je vais dans le dossier physique je n'est pas de fichier .log
Décidément, c'est dur dur avec toi....
Cela devrait pourtant fonctionner.
Pour commencer donne moi le résultat de la commande :
ls -l /home/pi/node-v9.9.0-linux-armv7l/bin/node
Ensuite, donne moi le résultat de la commande :
uname -a
pi@raspberrypi:~$ ls -l /home/pi/node-v9.9.0-linux-armv7l/bin/node -rwxr-xr-x 1 pi pi 31717170 mars 21 11:38 /home/pi/node-v9.9.0-linux-armv7l/bin/node
pi@raspberrypi:~$ uname -a Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux
Bizarre... d'autant que la documentation de Raspberry Pi confirme que ça doit marcher.
Alors, essaie de modifier un fichier avec la commande suivante (le sudo
permet d'exécuter en tant que root
):
sudo nano /etc/rsyslog.conf
Descends dans le fichier jusqu'à voir la ligne :
#cron.* /var/log/cron.log
Enlève le #
au début de la ligne, puis enregistre le fichier.
Ensuite, redémarre.
Une fois redémarré, montre moi ce que tu as dans le fichier /var/log/cron.log
manip effectuer pi@raspberrypi:~$ /var/log/cron.log -bash: /var/log/cron.log: Permission non accordée
pense tu qui serais mieux de remettre a réinitialiser en mode usine le rasbperry pour recommence a zero?
Est-ce que je t'ai dit de taper la commande /var/log/cron.log
??????
Non, je t'ai dit : "montre moi ce que tu as dans le fichier /var/log/cron.log
"
Donc soit en ouvrant avec nano
soit en faisant un more /var/log/cron.log
, ou toute autre méthode qui me montre le contenu du fichier.
Je veux bien t'aider, mais il faut y mettre un peu du tiens aussi....
Désole!! voila en tapent la commande more /var/log/cron.log
pi@raspberrypi:~$ more /var/log/cron.log Apr 3 14:15:19 raspberrypi cron[289]: (CRON) INFO (pidfile fd = 3) Apr 3 14:15:19 raspberrypi cron[289]: (CRON) INFO (Running @reboot jobs) Apr 3 14:16:23 raspberrypi CRON[1390]: (root) CMD (/usr/bin/php /var/www/html/c ore/php/watchdog.php >> /dev/null) Apr 3 14:16:23 raspberrypi CRON[1391]: (www-data) CMD (/usr/bin/php /var/www/ht ml/core/php/jeeCron.php >> /dev/null) Apr 3 14:16:24 raspberrypi CRON[1382]: (CRON) info (No MTA installed, discardin g output) Apr 3 14:17:01 raspberrypi CRON[1614]: (root) CMD ( cd / && run-parts --repor t /etc/cron.hourly) Apr 3 14:17:01 raspberrypi CRON[1613]: (root) CMD (/usr/bin/php /var/www/html/c ore/php/watchdog.php >> /dev/null) Apr 3 14:17:01 raspberrypi CRON[1619]: (www-data) CMD (/usr/bin/php /var/www/ht ml/core/php/jeeCron.php >> /dev/null) Apr 3 14:17:01 raspberrypi CRON[1602]: (CRON) info (No MTA installed, discardin g output) Apr 3 14:18:01 raspberrypi CRON[1795]: (www-data) CMD (/usr/bin/php /var/www/ht ml/core/php/jeeCron.php >> /dev/null) Apr 3 14:18:01 raspberrypi CRON[1796]: (root) CMD (/usr/bin/php /var/www/html/c ore/php/watchdog.php >> /dev/null) Apr 3 14:18:02 raspberrypi CRON[1787]: (CRON) info (No MTA installed, discardin g output) Apr 3 14:19:01 raspberrypi CRON[1879]: (www-data) CMD (/usr/bin/php /var/www/ht --More--(40%)
Il n'y a que 40% du contenu. Pour voir la suite tu dois appuyer sur la barre d'espace, qui te montrera la suite (et à moi aussi)
pi@raspberrypi:~$ more /var/log/cron.log
Apr 3 14:15:19 raspberrypi cron[289]: (CRON) INFO (pidfile fd = 3)
Apr 3 14:15:19 raspberrypi cron[289]: (CRON) INFO (Running @reboot jobs)
Apr 3 14:16:23 raspberrypi CRON[1390]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:16:23 raspberrypi CRON[1391]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:16:24 raspberrypi CRON[1382]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:17:01 raspberrypi CRON[1614]: (root) CMD ( cd / && run-parts --report /etc/cron.hour
ly)
Apr 3 14:17:01 raspberrypi CRON[1613]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:17:01 raspberrypi CRON[1619]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:17:01 raspberrypi CRON[1602]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:18:01 raspberrypi CRON[1795]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:18:01 raspberrypi CRON[1796]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:18:02 raspberrypi CRON[1787]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:19:01 raspberrypi CRON[1879]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:19:01 raspberrypi CRON[1878]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:19:01 raspberrypi CRON[1870]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:20:01 raspberrypi CRON[1999]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:20:01 raspberrypi CRON[2000]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:20:01 raspberrypi CRON[1991]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:21:01 raspberrypi CRON[2136]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:21:01 raspberrypi CRON[2137]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:21:01 raspberrypi CRON[2128]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:22:01 raspberrypi CRON[2216]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:22:01 raspberrypi CRON[2217]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:22:01 raspberrypi CRON[2208]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:23:01 raspberrypi CRON[2296]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:23:01 raspberrypi CRON[2297]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:23:01 raspberrypi CRON[2288]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:24:01 raspberrypi CRON[2371]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:24:01 raspberrypi CRON[2372]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:24:02 raspberrypi CRON[2363]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:25:01 raspberrypi CRON[2447]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:25:01 raspberrypi CRON[2450]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:25:01 raspberrypi CRON[2440]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:26:01 raspberrypi CRON[2601]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:26:01 raspberrypi CRON[2600]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:26:02 raspberrypi CRON[2592]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:27:01 raspberrypi CRON[2679]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:27:01 raspberrypi CRON[2678]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:27:01 raspberrypi CRON[2670]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:28:01 raspberrypi CRON[2757]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:28:01 raspberrypi CRON[2759]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:28:01 raspberrypi CRON[2749]: (CRON) info (No MTA installed, discarding output)
Apr 3 14:29:01 raspberrypi CRON[2837]: (root) CMD (/usr/bin/php /var/www/html/core/php/watchdog
.php >> /dev/null)
Apr 3 14:29:01 raspberrypi CRON[2838]: (www-data) CMD (/usr/bin/php /var/www/html/core/php/jeeC
ron.php >> /dev/null)
Apr 3 14:29:02 raspberrypi CRON[2828]: (CRON) info (No MTA installed, discarding output)
Quand tu fais un crontab -e
, puis que tu enregistres, est-ce que ça te dit : crontab: installing new crontab
?
Car, pour une raison inconnue, le cron que tu as mis n'est pas détecté.... Pourtant, dans ton copier/coller un peu plus haut, ça a l'air correct.... Donc je ne comprends pas.
pi@raspberrypi:~$ crontab -e crontab: installing new crontab
Ecoute je vais remettre mon système a zéro depuis l'installation initiale et je vais recommencer tout l'instal au propre et je te tien au courant
sa m’embête de prendre sur ton temps
je te tien au courant;
Merci milles fois pour ton Aide !!
OK pas de soucis. Tiens moi au courant !
Bon après avoir réinitialiser mon PI j'ai ré installer les plugins et fait les test tout est OK,
plusieurs redémarrage du PI également et tout parait ok
voila voila !!
Merci encore pour ton aide et pour le temps pris pour m'aider....
Cool 👍
bonjour
par errer j'ai supprimer de la corbeille également, le fichier a modifier nano ~/.bashrc maintenant celui ci reste constamment vide après reboute rien a faire
merci de m'indique la marche a suivre
en vous en remerciant par avance