motom001 / DoorPi

OpenSource VoIP Door-Intercomstation
https://www.doorpi.org/forum/
242 stars 85 forks source link

Exception NameError: list index out of range #30

Closed motom001 closed 9 years ago

motom001 commented 9 years ago

Fehlermeldung aus dem Forum: http://www.forum-raspberrypi.de/Thread-haussteuerung-doorpi-voip-wechselsprechanlage-tuersprechanlage?pid=126878#pid126878

2015-01-10 16:48:19,379 [DEBUG]         [keyboard.from_piface] __init__(input_pins = ['11', '13', '15'], output_pins = ['18', '7', '16'])
...
2015-01-10 16:48:19,726 [ERROR]         [__main__] Exception NameError: list index out of range
Traceback (most recent call last):
  File "/home/pi/DoorPi/doorpi/main.py", line 114, in main_as_application
    try:                        doorpi.DoorPi(parsed_arguments).run()
  File "/home/pi/DoorPi/doorpi/doorpi.py", line 174, in run
    if not self.__prepared: self.prepare(self.__parsed_arguments)
  File "/home/pi/DoorPi/doorpi/doorpi.py", line 99, in prepare
    self.__keyboard = load_keyboard()
  File "/home/pi/DoorPi/doorpi/keyboard/KeyboardInterface.py", line 35, in load_keyboard
    bouncetime = bouncetime
  File "/home/pi/DoorPi/doorpi/keyboard/KeyboardInterface.py", line 41, in autodetect
    try: return load_piface(input_pins, output_pins, bouncetime)
  File "/home/pi/DoorPi/doorpi/keyboard/KeyboardInterface.py", line 54, in load_piface
    output_pins = output_pins
  File "/home/pi/DoorPi/doorpi/keyboard/from_piface.py", line 51, in __init__
    self.set_output(output_pin, 0, False)
  File "/home/pi/DoorPi/doorpi/keyboard/from_piface.py", line 108, in set_output
    p.digital_write(pin, value)
  File "/usr/lib/python2.7/dist-packages/pifacedigitalio/core.py", line 226, in digital_write
    _get_pifacedigital(hardware_addr).output_pins[pin_num].value = value
IndexError: list index out of range
2015-01-10 16:48:19,753 [DEBUG]         [doorpi] destroy
motom001 commented 9 years ago

PiFace hat keine Pins 11, 13, 15 eher 0, 1, 2

Es ist schwer die conf für PiFace und GPIO bereit zu stellen.

Vorausgesetzt du hast 3 Klingeltaster und 3 Ausgänge genutzt:

[SIP-Phone]
sipphonetyp = pjsua
server = 192.168.178.1
username = 623
password = raspberry
realm = fritz.box

[DTMF]
"#" = out:0,1,0,3
"**633*" = out:1,0
"**66*" = out:1,1

[InputPins]
0 = call:0351555555
1 = call:0351555555
2 = call:0351555555

[OutputPins]
0 = open_door 0
1 = power supply
2 = is_alive_led

[DoorPi]
keyboard = piface
is_alive_led = 2
dialtone = !BASEPATH!/doorpi/media/ShortDialTone.wav
records = !BASEPATH!/records/Key-!LastKey!_%Y-%m-%d_%H-%M-%S.wav
record_while_dialing = true

[EVENT_OnStartup]
10 = sleep:1
20 = out:1,1

[AdminNumbers]
0351555555 = active

Wenn einer der Taster gedrückt wird, dann wird 0351555555 angerufen Ausgänge: 0 ist dein Türöffner 1 ist die Stromversorgung der Türstation 2 ist die is_alive_led (blinkt auf dem PiFace)

Die Angaben unter [SIP-Phone] müssen natürlich angepasst werden um sich am Sip-Server anzumelden (FritzBox oder Asterisk oder ähnliche).