Reputation: 11
I have installed linphone with the following guide: https://wiki.linphone.org/xwiki/wiki/public/view/Linphone/Linphone%20and%20Raspberry%20Pi/
I have fiew to none experience with python.
I found a script that reacts on a button press and this seems to work, but the command I want to make is not working.
My Script:
#!/usr/bin/python
import RPi.GPIO as gpio
from subprocess import call
import time
import subprocess
import os
gpio.setmode(gpio.BCM)
gpio.setup(5, gpio.IN, pull_up_down = gpio.PUD_UP)
os.environ['PATH'] = '/home/pi/linphone-sdk/build-raspberry/linphone-sdk/desktop/bin'
subprocess.Popen(["sudo -u pi linphonecsh init -a -C -c /home/pi/.linphonerc -d 6 -l /tmp/log.txt"])
def doorbell(channel):
subprocess.Popen(["linphonecsh dial **9"])
gpio.add_event_detect(5, gpio.FALLING, callback=doorbell, bouncetime=300)
while 1:
time.sleep(360)
I get this error
FileNotFoundError: [Errno 2] No such file or directory: 'sudo -u pi linphonecsh init -a -C -c /home/pi/.linphonerc -d 6 -l /tmp/log.txt'
This seems to be the case because the PATH variable is not set right. I also tried to set the PATH in the "/etc/rc.local" like in the guide is set. Also I tried to set it in /etc/crontab.
How do I set the Path right?
Upvotes: 1
Views: 403
Reputation: 503
Since you are using python to make your script, why not build the linphone SDK's python wrapper? https://gitlab.linphone.org/BC/public/linphone-sdk#python-wrapper-wheel-packaging
This way you can more easily control your calls etc...
Cheers,
Upvotes: 0