Hallo
Ich möchte mein Doorpi auch an Loxone anbinden bzw eine Audio Verbindung über den asterisk server aufbauen.
Hat das schon jemand gelöst?
wie sieht da die sip conf aus?
grüsse
Hallo
Ich möchte mein Doorpi auch an Loxone anbinden bzw eine Audio Verbindung über den asterisk server aufbauen.
Hat das schon jemand gelöst?
wie sieht da die sip conf aus?
grüsse
Danke hmerk für den hinweis und das Beispiel, das ist genau was ich brauche.
http befehle kann ich natürlich auch nutzen, UDP kenn ich halt schon.
Ich glaube ich habe jetzt verstanden, wäre der Code richtig so?
[keyboards]
onboardpins = gpio
webservice = filesystem
[webservice_keyboard]
base_path_input = /var/DoorPI/keyboard/inputs/
base_path_output = /var/DoorPI/keyboard/outputs/
[webservice_InputPins]
klingel = os_execute:/usr/local/etc/DoorPi/scripts/LoxoneNotifyEsKlingelt.py
lichtein = out:led,1
lichteaus = out:led,0
[onboardpins_InputPins]
12=alarm
16=klingel
[onboardpins_OutputPins]
38=led
40=Amplifier
[onboardpins_keyboard]
bouncetime=2000
[[EVENT_OnStartup]
10 = sleep:1
20 = Amplifier,0
30 =led,0
Alles anzeigen
http*://User:PWD@doorpi/control/trigger_event?event_name=OnKeyPressed_webservice.lichtein&event_source=doorpi.keyboard.from_filesystem
http*://User:PWD@doorpi/control/trigger_event?event_name=OnKeyPressed_webservice.lichtaus&event_source=doorpi.keyboard.from_filesystem
thx
Danke,so habe ich meinen Garagentor Öffner realisiert:
# UDP-Socket oeffnen
addr = (host, portt)
UDPSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
UDPSock.bind(addr)
def auf():
print "Auf"
gpio.output(port.PC4, gpio.LOW)
sleep(5)
gpio.output(port.PC4, gpio.HIGH)
def ab():
print "Ab"
gpio.output(port.PC7, gpio.LOW)
sleep(5)
gpio.output(port.PC7, gpio.HIGH)
options = { "0" : auf,
"1" : ab,
}
# Recive data from client and decide which function to call
while True:
dataFromClient, addr = UDPSock.recvfrom(bufsize)
options[dataFromClient]()
Alles anzeigen
Aber ich verstehe nicht wie ich "Data" als variable oder zb "auf" "ab" als Eingänge, in doorpi integriere.
Für meine doorpi anwendung würde ich Variablen/Eingängewie "ledblinkein, ledblinkaus" beötigen.
Ein kurze beispiel wäre super
Hallo Albundy,
Habe das selbe Problem, wie hast du es gelöst?
Ich weiß wie man Mittels python skripte udp Befehle sendet und empfängt.
so sendet man einen udp befehl mit doorpi:
esklingelt.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
# Voreinstellungen für Host und Port
host = "10.10.x.x"
port = xxxx
# Die zu sendenden Daten
data = "esklingelt"
# # UDP-Socket oeffnen
addr = (host, port)
UDPSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Nachricht senden
UDPSock.sendto(data, addr)
UDPSock.close()
Alles anzeigen
Aber wie importiere/empfange ich einen udp befehl in doorpi?
Hallo,
Mein Projekt ist inspiriert von MarcusS, weil ich mir auch eine Loxone Haussteuerung gegönnt habe.
Zuerst:
DANKE an MarcusS und an alle die Doorpi entwickelt haben
HW & SW
Orange Pi WinPlus
Armbian Orange Pi Win Ubuntu 16.04.3 LTS /n /l desktop xfce legacy kernel
Installiert habe ich nach diesen 2 Anleitungen:
installation-doorpi-mittels-pypi-auf-einem-raspberry-pi-raspbian/
installation-doorpi-mittels-github-auf-einem-banana-pi-raspbian/
in dieser reihen folge:
mittels PyPi auf einem Raspberry Pi + Raspbian:
sudo apt-get install python-dev
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
sudo apt-get install python-pip
sudo apt-get install python-setuptools oder sudo apt-get install python3-setuptools ( hatte das genommen was das terminal vorgeschlagen hat.)
sudo pip install linphone4raspberry python-daemon
_________________________________________________________________________
GitHub auf einem Banana PI + Raspbian:
apt-get install -y git python
rm -r -f /tmp/DoorPi
git clone https://github.com/motom001/DoorPi.git -b master /tmp/DoorPi
cd /tmp/DoorPi
python ./setup.py install
doorpi_cli --trace
Alles anzeigen
danach habe ich Asterisk installiert und eingerichtet:
danach:
ZitatMit der Tastenkombination [Strg] + [c] beende ich DoorPi und prüfe die entstandenen Dateien:
- Datei /usr/local/bin/doorpi_cli
- Datei /etc/init.d/doorpi (falls nicht vorhanden -> Neuerstellung daemon-file)
- Ordner /usr/local/lib/python2.7/dist-packages/doorpi (sowie weitere Ordner für die installierten Sub-Module)
- Ordner /usr/local/etc/DoorPi
zum Schluss:
DoorPi als Daemon (Dienst / Service / Autostart) unter Jessie einrichten
Sound habe ich im Desktop eingerichtet.
Bis auf linphone4raspberry funktioniert alles.
weil es nicht erkannt wird habe ich es deinstalliert und die neueste Version installiert.
Danach habe ich Doorpi gestoppt und neu gestartet, mit dem selben Ergebnis im log.
mit den Benutzerrechten stimmt auch was nicht, komm aber nicht drauf was falsch ist.
gibt es eine Möglichkeit wie in linphone4raspberry zum laufen bekomme?
Mit der Desktop Version von Linphone würde meine Anwendung vermutlich auch funktionieren, aber mit der Implementierung in Loxone habe ich noch nicht begonnen.
Anhang:
doorpi.ini:
[DoorPi]
base_path = /usr/local/etc/DoorPi
eventlog = !BASEPATH!/conf/eventlog.db
is_alive_led =
last_snapshot =
snapshot_path =
[DoorPiWeb]
indexfile = index.html
ip =
loginfile = login.html
online_fallback = http://motom001.github.io/DoorPiWeb
port = 80
public = AREA_public
www = !BASEPATH!/../DoorPiWeb
[AREA_public]
.*
[AREA_config]
/control/config_value_get
/control/config_value_set
/control/config_value_delete
/control/config_save
/control/config_get_configfile
[AREA_dashboard]
/dashboard/pages/.*html
[AREA_status]
/status
/mirror
[AREA_control]
.*
[Group]
administrator = door
guests = visitor
#Alle Nummern zugelassen!
[AdminNumbers]
* = active
[EVENT_OnStartup]
10 = sleep:1
[User]
door = xxxxx
Alles anzeigen
doorpi.log:
2018-01-21 19:12:58,645 [INFO] [doorpi.conf.config_object] use configfile: /usr/local/etc/DoorPi/conf/doorpi.ini
2018-01-21 19:12:58,680 [INFO] [doorpi.status.webserver] Initiating WebService at ip and port 80
2018-01-21 19:48:02,410 [INFO] [doorpi.conf.config_object] use configfile: /usr/local/etc/DoorPi/conf/doorpi.ini
2018-01-21 19:48:02,467 [INFO] [doorpi.status.webserver] Initiating WebService at ip and port 80
2018-01-21 19:48:02,480 [ERROR] [doorpi.status.webserver] module installer doesn't exist but is assigned to group administrator in WritePermission
2018-01-21 19:48:02,481 [ERROR] [doorpi.status.webserver] module dashboard doesn't exist but is assigned to group administrator in WritePermission
2018-01-21 19:48:02,482 [ERROR] [doorpi.status.webserver] module config doesn't exist but is assigned to group administrator in WritePermission
2018-01-21 19:48:02,501 [INFO] [doorpi.keyboard.KeyboardInterface] using multi-keyboard mode (keyboards: dummy)
2018-01-21 19:48:02,502 [INFO] [doorpi.keyboard.KeyboardInterface] trying to add keyboard 'dummy' to handler
2018-01-21 19:48:02,505 [WARNING] [root] section dummy_InputPins not found in configfile
2018-01-21 19:48:02,506 [WARNING] [root] section dummy_OutputPins not found in configfile
2018-01-21 19:48:02,513 [WARNING] [root] section dummy_InputPins not found in configfile
2018-01-21 19:48:02,515 [WARNING] [root] section dummy_OutputPins not found in configfile
2018-01-21 19:48:02,517 [WARNING] [root] section dummy_OutputPins not found in configfile
2018-01-21 19:48:02,606 [WARNING] [doorpi.sipphone.SipphoneInterface] found no installed sipphones and use dummy as default
2018-01-21 19:48:02,612 [ERROR] [doorpi.sipphone.SipphoneInterface] sipphone linphone not found @ sipphone.from_linphone with exception /usr/local/lib/python2.7/dist-packages/linphone/linphone.so: wrong ELF class: ELFCLASS32
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/DoorPi-2.5.1-py2.7.egg/doorpi/sipphone/SipphoneInterface.py", line 24, in load_sipphone
sipphone = importlib.import_module('doorpi.sipphone.from_'+sipphone_name).get(
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/DoorPi-2.5.1-py2.7.egg/doorpi/sipphone/from_linphone.py", line 11, in <module>
import linphone as lin
File "/usr/local/lib/python2.7/dist-packages/linphone/__init__.py", line 1, in <module>
from linphone import *
ImportError: /usr/local/lib/python2.7/dist-packages/linphone/linphone.so: wrong ELF class: ELFCLASS32
2018-01-21 19:48:02,626 [WARNING] [doorpi.sipphone.SipphoneInterface] use dummy sipphone after last exception!
2018-01-21 19:48:02,634 [WARNING] [doorpi.sipphone.from_dummy] No sipphone in config - use dummy sipphone without functionality
2018-01-21 19:48:02,664 [INFO] [doorpi.doorpi] found EVENT_ section 'EVENT_OnStartup' in configfile
2018-01-21 19:48:02,665 [INFO] [doorpi.doorpi] registering action '10' for event 'OnStartup'
2018-01-21 19:48:02,671 [WARNING] [root] section dummy_InputPins not found in configfile
2018-01-21 19:48:02,672 [WARNING] [root] section DTMF not found in configfile
2018-01-21 19:48:03,681 [INFO] [doorpi.doorpi] DoorPi started successfully
2018-01-21 19:48:03,682 [INFO] [doorpi.doorpi] BasePath is /usr/local/etc/DoorPi
2018-01-21 19:48:03,683 [INFO] [doorpi.doorpi] Weburl is http://localhost/
2018-01-21 19:50:48,905 [INFO] [doorpi.doorpi] ======== DoorPi successfully shutdown ========
Alles anzeigen
Asterisk sip.cof:
[1000]
type=friend
username=1000
secret=xxxxx
context=test
host=dynamic
qualify=yes
[2000]
type=friend
username=2000
secret=xxxxx
context=test
host=dynamic
qualify=yes
Alles anzeigen
extensions.conf:
Grüsse Pumuckl
Hello
i am using a orange pi one, doorpi is running but iam not able to:
2) install doorpillars.
3) changing the file from_gpio.py here: /usr/local/lib/python2.7/dist-packages/doorpillars./keyboard
__________________________________________________________________________________________
i allredy installed: orangepi_PC_gpio_pyH3 an the gipos are working in a bsic script. like this: http://www.instructables.com/i…Pi-One-Python-GPIO-basic/
but i cant find the fiel from_gpio.py
so please help
Alles anzeigenSorry for the vague instructions.
Pressing the buttons generates a record in the file to a virtual/input that is processed according to the rules of doorpi.ini
Here is the error: [keyboards] io = gpio
Inputs GPIO PC4 and PC7 are assigned to the file read.py can change on your own.
1) armbian img
2) install doorpillars.
3) changing the file from_gpio.py here: /usr/local/lib/python2.7/dist-packages/doorpillars./keyboard
4) install pyA20 pypi.python.org/pypi/pyA20
5) redacted doorpi.ini different name because the gpio pins OrangePi
Earn on output ports starting at PA, for example PA13
=====
[io_OutputPins]
13 = Door
[virtuell_keyboard]
reset_input = true
base_path_input = !BASEPATH!/virtual/inputs/
base_path_output = !BASEPATH!/virtual/outputs/
[virtuell_InputPins]
5888 = out:Door,1,0,3
56 = call:804
=====
The connected MFRC522 took away: http://orangepi.pp.ua/index.php/topic,415.0.html
1. Connection
RC522 OPi PC
MOSI ----------> pin 19
MISO -----------> pin 21
SCLK -----------> pin 23
SDA -----------> pin 24
RST -----------> pin 22
IRQ ------------> not connected
2. Check the availability of the device
ls /dev/spidev0.0
3. Install the libraries
apt-get install python-dev
4. Install GPIO library
git clone https://github.com/duxingkei33/orangepi_PC_gpio_pyH3.git
cd orangepi_PC_gpio_pyH3
python setup.py install
5. Installing SPI library
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
python setup.py install
6. Installation MFRC522 library
git clone https://github.com/rasplay/MFRC522-python.git
cd MFRC522-python
7. Corrected scripts, in line 1 import RPi change.GPIO as GPIO import on pyA20.gpio as GPIO and comment lines 108, 109, 110 and 356
nano MFRC522.py
1 import pyA20.gpio as GPIO
108 #GPIO.setmode(GPIO.BOARD)
109 #GPIO.setup(22, GPIO.OUT)
110 #GPIO.output(self.NRSTPD, 1)
356 #GPIO.output(self.NRSTPD, 1)
8. Well, the team itself card reader
python read.py
read.py change to attached, will be read with the reader and gpio inputs. Can cut reader and to make only the gpio.
Sound 3.5 mm as output:
---------------------
apt-get install sox
cat << _EOF_ > /etc/asound.conf
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
_EOF_
amixer set-c 0 'Audio lineout' unmute
-------------