Beiträge von Pat054

    Hello, Errors appear when installing MJPG-Streamer.


    At the first instruction of the installation, I have an error:

    At the 3rd instruction, I have the following error :






    How to avoid these errors?


    Patrick


    PS: my RPI is a RPI3

    I inform you that I finally managed with DOORPI to send me a message with an attachment with the command "... cat ... mutt ..."


    In fact, you must force mutt to use the .muttr file


    Here is the command to integrate in the file send_mail.sh:


    / Bin / cat /home/pi/Doorpi/mail.txt | / Usr / bin / mutt -F /home/pi/.muttrc -s "There's someone!" -a /home/pi/Doorpi/message_absence.wav - xxxxxxx@orange.fr


    Thanks again to all the participants.


    PatI


    PS : nteresting link is on MUTT : http://cedricduval.free.fr/mutt/en/sitehtml/manual-6.html

    Hello everyone,


    At the request of Thomas, I issued the following command:

    Code
    Pi @ raspberrypi: ~ $ / usr / bin / python /usr/local/etc/DoorPi/main.py start --configfile /usr/local/etc/DoorPi/conf/doorpi.ini --trace
    > / Usr / bin / python: can not open file '/usr/local/etc/DoorPi/main.py': [Errno 2] No such file or directory


    I then search the file main.py of DOORPI with the command:

    Code
    Pi @ raspberrypi: ~ $ sudo find / -name main.py
    /usr/local/lib/python2.7/dist-packages/doorpi/main.py
    /usr/share/geany/templates/files/main.py
    /usr/lib/pypy/lib-python/2.7/unittest/main.py
    /usr/lib/pypy/lib-python/2.7/lib2to3/main.py
    /usr/lib/python2.7/unittest/main.py
    /usr/lib/python2.7/lib2to3/main.py
    /usr/lib/python3.4/unittest/main.py
    /usr/lib/python3.4/lib2to3/main.py
    Pi @ raspberrypi: ~ $

    I've launched the command with: /usr/local/lib/python2.7/dist-packages/doorpi/main.py
    This gives:


    Code
    Pi @ raspberrypi: ~ $ / usr / bin / python /usr/local/lib/python2.7/dist-packages/doorpi/main.py start --configfile /usr/local/etc/DoorPi/conf/doorpi.ini --trace
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/doorpi/main.py", line 10, in <module>
        Import doorpi
      File "/usr/local/lib/python2.7/dist-packages/doorpi/doorpi.py", line 19, in <module>
        From keyboard.KeyboardInterface import load_keyboard
      File "/usr/local/lib/python2.7/dist-packages/doorpi/keyboard/KeyboardInterface.py", line 11, in <module>
        From doorpi.keyboard.AbstractBaseClass import KeyboardAbstractBaseClass
    ImportError: No module named keyboard.AbstractBaseClass
    Pi @ raspberrypi: ~ $

    Pat

    I added in my send_mail.sh scrypt: / bin / cat and / usr / bin / mutt (for cat and mutt) such as:


    Bash
    #!/bin/bash
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    
    
    /bin/cat /home/pi/Doorpi/mail.txt> mail.copy1
    /bin/cat /home/pi/Doorpi/mail.txt | /usr/bin/tee> mail.copy2
    /bin/cat /home/pi/Doorpi/mail.txt | /usr/bin/mutt -s "y a quelqu'un!" xxxxxxxxxx@orange.fr

    After launching DOORPI (with start) and pressing the button, the line '... cat ... mutt ...' still does not work.


    Only "echo" lines and the first 2 lines "... cat ..." work: the mail.txt file is updated and the test files mail.copy1 and mail.copy2 are created .

    In doorpi.ini, I wrote:

    Code
    10 = os_execute:/usr/local/etc/DoorPi/scripts/envoi_mail.sh


    In send_mail.sh, I wrote:


    Bash
    #!/bin/bash
    /usr/bin/touch /tmp/mytestfile

    => After starting DOORPI and pressing the button, the file mytestfile was created in tmp.
    We know that it works.


    Then, in send_mail.sh, I wrote:


    Bash
    #!/bin/bash
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt

    => After starting DOORPI and pressing the button, the mail.txt file was created in / home / pi / Doorpi /.
    Again, we know that it works.


    Then, still in send_mail.sh, I wrote:


    Bash
    #!/bin/bash
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    cat /home/pi/Doorpi/mail.txt> mail.copy1
    cat /home/pi/Doorpi/mail.txt | tee> mail.copy2
    cat /home/pi/Doorpi/mail.txt | mutt -s "y a quelqu'un!" xxxxxxxxx@orange.$

    => After starting DOORPI and pressing the button, the file mail.txt is created in / home / pi / Doorpi / with the 3 commands "echo"


    But the 3 lines "cat" give nothing.

    Hello Streicher,


    The directory (full path) is my file send_mail.sh is:
    /usr/local/etc/DoorPi/scripts/


    Why?


    The rights are:


    Pi @ raspberrypi: ~ $ ls -l /usr/local/etc/DoorPi/scripts/envoi_mail.sh
    -rwxr-xr-x 1 root staff 468 Mar 27 19:22 /usr/local/etc/DoorPi/scripts/envoi_mail.sh


    Pat

    Hello Han-solo,


    Thank you for your answer: I did not know for! BASEPATH !.
    We learn every day!


    For my part, it does not work. I do not know why!


    To understand, I have minimized things:


    My doorpi is like you:

    Code
    [DoorPi]
    base_path = /usr/local/etc/DoorPi
    
    
    [EVENT_OnKeyDown_onboardpins.11]
    10 = os_execute:!BASEPATH!/scripts/envoi_mail.sh

    And my file send_mail.sh is minimalist such as:

    Bash
    #!/bin/bash
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    cat /home/pi/Doorpi/mail.txt | mutt -s "y a quelqu'un!" xxxxxxxxx@orange.fr

    Except DOORPI, this executable file works: it sends the message in my box orange.fr


    In DOORPI after:
    Pi @ raspberrypi: ~ $ sudo /etc/init.d/doorpi start


    And press button, I do not receive any message in my mailbox. I do not understand why!


    Do you use the parameters of the .muttrc file?


    In the waiting, thank you.


    Cordially.


    Pat

    Is there anyone who has the solution?


    Here I dry: it may be an internal doorpi problem, a rights issue (but I doubt it because my txt file is updated)
    Or it lacks an import in my file bash (but there I do not have the skills)


    Ideas?


    Pat


    For information: I have updated by: update, upgrade, dist-upgrade and rpi_update. And, I always have the same thing

    I inform you that I finally managed with DOORPI to send me a message with an attachment with the command "... cat ... mutt ..."


    In fact, you must force mutt to use the .muttr file


    Here is the command to integrate in the file send_mail.sh:


    / Bin / cat /home/pi/Doorpi/mail.txt | / Usr / bin / mutt -F /home/pi/.muttrc -s "There's someone!" -a /home/pi/Doorpi/message_absence.wav - xxxxxxx@orange.fr



    PatI


    PS : nteresting link is on MUTT : cedricduval.free.fr/mutt/en/sitehtml/manual-6.html

    Hello Pah and thank you for your reply.


    1. Yes, the /home/pi/Doorpi/mail.txt file is generated correctly.
    Its contents are: Date: Sunday 19 March 2017, 10:14:13 (UTC + 0100)


    2. I ran in the console: / bin / cat /home/pi/Doorpi/mail.txt> /home/pi/Doorpi/mail.copy
    The mail.copy file is generated correctly. Its contents are identical: Date: Sunday 19 March 2017, 10:14:13 (UTC + 0100)


    The files belong to pi:


    Pi @ raspberrypi: ~ / Doorpi $ ls -l
    -rw-r-r- 1 pi pi 75 March 19 10:14 mail.txt
    -rw-r-r- 1 pi pi 75 March 20 14:45 mail.copy


    3. I ran in the console: / bin / cat /home/pi/Doorpi/mail.txt | Tee> /home/pi/Doorpi/mail.copy2
    The file mail.copy2 is generated correctly. Its context is identical: Date: Sunday 19 March 2017, 10:14:13 (UTC + 0100)


    The files belong to pi:


    Pi @ raspberrypi: ~ / Doorpi $ ls -l
    -rw-r-r- 1 pi pi 75 March 19 10:14 mail.txt
    -rw-r-r- 1 pi pi 75 March 20 14:45 mail.copy
    -rw-r-r- 1 pi pi 75 March 20 14:51 mail.copy2


    I also integrated the 2 lines in my file send_sh :


    Bash
    #!/bin/bash
    
    
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    /bin/cat /home/pi/Doorpi/mail.txt> mail.copy
    /bin/cat /home/pi/Doorpi/mail.txt | tee> mail.copy2


    The launch of this file in a terminal works.



    But integrated in doorpi.ini behind "os_execute", it does not work: the 2 files mailcopy and mail.copy2 are not created.
    Only the mail.txt file is updated


    What is your conclusion?


    In waiting, thank you. cordially


    Pat

    Hello Thomas,


    There is a bug: Doorpi does not execute the last 2 commands of the following .sh file:


    Bash
    #!/bin/bash
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    echo "objet" | mutt -s "texte" xxxxxx@orange.fr
    cat /home/pi/Doorpi/mail.txt | mutt -s "texte" xxxxxx@orange.fr

    The mail.txt file is updated with the first echo statement but the last 2 statements are not executed.


    The proof also is that the last 2 instructions seize separately in a console, work properly.


    See the following message: https://www.doorpi.org/forum/t…ile/?postID=6217#post6217


    Waiting, cordially.


    Pat

    I searched the shell on my Raspberry Pi behind the pi user name with:


    Pi @ raspberrypi: ~ $ cat / etc / passwd | Cut -d: -f1,7 | Grep pi
    Pi: / bin / bash


    Following this, I put "#! / Bin / bash" at the beginning of my file send_mail.sh.


    I also looked for the existence of the cat command with:


    Pi @ raspberrypi: ~ $ which -a cat


    My RASPBERRY Pi gave me:


    Pi @ raspberrypi: ~ $ which -a cat
    / Bin / cat


    And I added / bin / front cat in my file send_mail.sh.


    Nothing makes it: it does not work


    I even searched the mutt path with:


    Pi @ raspberrypi: ~ $ which -a mutt
    / Usr / bin / mutt


    My file send_mail. Sh looks like this:

    Bash
    #!/bin/bash
    
    
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    
    
    /bin/cat /home/pi/Doorpi/mail.txt | /usr/bin/mutt -s "il y a quelqu un à la porte!" xxxxxxxxx@orange.fr

    And it does not work in doorpi!


    I will soon throw in the towel.

    Hello,


    Sorry but i tried the shell bash, sh ... The file send_mail.sh does not work with os-execute in doorpi.ini.


    That's crazy.


    I use in my file send_mail.sh a few lines of the file doorpi_email.sh https://www.doorpi.org/forum/thread/296-doorpi-von-han-solo/ membre de la Han Solo et il ne fonctionne pas.


    Are there specific rights in doorpi?
    (Other than do: chmod + x /home/pi/Doorpi/envoi_mail.sh before running doorpi for it to be executable)

    1: I did not understand what you meant
    2 and 3: I reassure you: sudo works in a script bash the equivalent of a terminal (console). This is why the program starts with: #! / Usr / bin / env bash. If I run the program send_mail.sh with sudo to all lines, it works. On the other hand, if it is integrated in doorpi.ini, only the line "cat ..." does not give the message (does not work). And, there is no error display on the screen.

    Hello streicher,


    All on board thank you for your message that helped me well.


    Indeed, I had trouble finding the right settings for SMTP
    Of ORANGE and GMAIL but I got there.


    Already, I was on a bad port 587 when it was port 465 that was working.


    You will tell me why you chose port 587. Initially, in Doorpi, port 587 of ORANGE worked for phone calls but not emails.
    For me, already there, it was bizard: there was a problem. At the beginning, I went to port 587 simply because
    Of the installation of my cameras at home, I had installed the software SSMTP, MUTT and MOTION with port 587.
    For me, it worked with port 587, so necessarily DooPI had to work with this port 587.
    He well no !!!


    Finally, I tried several ports and parameters and it is port 465 that works with Doorpi.


    My Doorpi.ini is:


    What does my doorpi.ini do:
    - at startup, doorpi sends an email to ORANGE indicating that the doorpi restarts
    - on the pushbutton pushbutton (pin 11 GPIO17):
    - doorpi calls me on my smartphone equipped with linphone
    - doorpi sends me on my mail ORANGE that someone is ringing at the door
    - and we can do the same on GMAIL.


    Now it works well.


    On the other hand, the last line does not work and I do not know why?
    This line is:


    Code
    40 = os_execute:/home/pi/Doorpi/envoi_mail.sh

    My file sent_mail.sh (equipped with MUTT) works because when I run it or I run it in a terminal, I get the message, after doing:
    Sudo chmod + x send_mai.sh


    My sendmail.sh uses the MUTT software:


    Code
    #!/usr/bin/env bash
    
    
    echo " " > /home/pi/Doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/Doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/Doorpi/mail.txt
    
    
    sudo cat /home/pi/Doorpi/mail.txt | mutt -s "il y a quelqu un à la porte!" xxxxxxxxx@orange.fr

    For those who are interested, the MUTT software works with a file such as:
    Sudo nano /home/pi/.muttrc


    There I stumble on the line:


    40 = os_execute: /home/pi/Doorpi/send_mail.sh


    This command does not send me the message: why?


    Pat

    Hello,


    How does it happen that the "os_execute" statement does not execute my send_mail.sh file in its entirety?


    That's crazy!


    Explanations: I have a file send_mail.sh whose contents are as follows:
    -----------------

    Code
    #!/usr/bin/env bash
    echo " " > /home/pi/doorpi/mail.txt
    echo  "On a sonné à la porte!"  > /home/pi/doorpi/mail.txt
    echo  "Date: " `date`  >> /home/pi/doorpi/mail.txt
    cat /home/pi/doorpi/mail.txt | mutt -s "il y a quelqu un à la porte!" xxxxxxxxx@orange.fr


    The first echo deletes the text file mail.txt.
    The second echo put the text "We rang the door!" In the text file mail.txt.
    The third echo sets the date in the text file mail.txt.
    The cat (with mutt) statement must send the contents of the mail.txt file to the e-mail address xxxxxxxxx@orange.fr


    Now in doorpi.ini, the "os_execute" statement does not execute my file send_mail.sh:


    Code
    [keyboards]
    onboardpins = gpio 
    
    
    [onboardpins_InputPins]
    11 = sleep:0 
    
    
    [EVENT_OnKeyUp_onboardpins.11]                         
    30 = os_execute:/home/pi/doorpi/envoi_mail.sh

    I do not receive the message in my mail xxxxxxxxx@orange.fr
    While the sending date appears in the mail.txt file.


    Does anyone understand something?


    My file send_mail.sh works because when I click on it (on the file sendmail.sh) I send and I receive the message in my mail.


    For me Doorpi does not execute the cat command.


    If someone has an idea...


    Cordially.


    Pat