You can not connect ethernet to the zero without an adapter. You can use NanoPi Duo. Firmware Doorpi with small edits suitable. I can share my firmware, just modified something, use an internal microphone input port and dynamic lighting for apa102 leds.
Or look for an adapter whose matching transformer is not integrated in the rj45, but it costs separately. then it is possible to remove the plug and solder in its place the wires.
Beiträge von brunh
-
-
I worked for 2GB
-
[DTMF]
"* 11" = exit: the door, 0,1,3If I add:
"* 11" = os_execute: play /root/correct.wav
That door does not open. -
Video from the LINPHON (SIP) will begin to show after answering the call, which many are not happy with. Therefore, video streaming broadcasts separately from the call.
The broadcast is tuned to mjpg, how to do it on other standards without a significant delay of 2 seconds or more until I know. -
This board does not connect directly, and it is not needed.
You only have two buttons: the exit and the bell.
Port for control door lock, write in doorpi.ini, for example PA13, and the buttons in the file read.py
How it is specifically connected to the forum is detailed, the connection schemes to the relay, and to the buttons, they are exactly the same as the Raspberry. -
Python: read.py
Alles anzeigen#!/usr/bin/env python # -*- coding: utf-8 -*- import time import MFRC522 import signal from pyA20.gpio import gpio from pyA20.gpio import port from pyA20.gpio import connector gpio.init() #Initialize module. Always called first #gpio.setcfg(port.PA13, gpio.OUTPUT) #lock output #gpio.output(port.PA13, 0) gpio.setcfg(port.PC4, gpio.INPUT) # open input gpio.pullup(port.PC4, gpio.PULLUP) gpio.setcfg(port.PC7, gpio.INPUT) # bell input gpio.pullup(port.PC7, gpio.PULLUP) continue_reading = True MIFAREReader = MFRC522.MFRC522() path="/usr/local/etc/DoorPi/virtual/inputs" def end_read(signal, frame): global continue_reading continue_reading = False print "Ctrl+C captured, ending read." MIFAREReader.GPIO_CLEEN() signal.signal(signal.SIGINT, end_read) while continue_reading: (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL) if status == MIFAREReader.MI_OK: print "Card detected" (status,backData) = MIFAREReader.MFRC522_Anticoll() if status == MIFAREReader.MI_OK: numer = str(backData[0])+str(backData[1])+str(backData[2])+str(backData[3])+str(backData[4]) file=open(path+'/'+numer,'w') file.write("false") file.close() time.sleep(0.2) file=open(path+'/'+numer,'w') file.write("true") file.close() time.sleep(0.2) if gpio.input(port.PC7) == 0: #input button filename = '/usr/local/etc/DoorPi/virtual/inputs/599' # bell f = open (filename, 'w') f.write('false') f.close() time.sleep (0.2) f = open (filename, 'w') f.write('true') f.close() time.sleep(1) if gpio.input(port.PC4) == 0: # exit button filename = '/usr/local/etc/DoorPi/virtual/inputs/5888'# open door f = open (filename, 'w') f.write('false') f.close() time.sleep(0.2) f = open (filename, 'w') f.write('true') f.close() time.sleep(1) else: time.sleep(0.2)
Python: from_gpio.py
Alles anzeigen#!/usr/bin/env python # -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) logger.debug("%s loaded", __name__) #import RPi.GPIO as RPiGPI0 # basic for GPIO control from pyA20.gpio import gpio from pyA20.gpio import port from pyA20.gpio import connector import thread import time from doorpi.keyboard.AbstractBaseClass import KeyboardAbstractBaseClass, HIGH_LEVEL, LOW_LEVEL import doorpi def get(**kwargs): return GPIO(**kwargs) class GPIO(KeyboardAbstractBaseClass): name = 'GPIO Keyboard' def __init__(self, input_pins, output_pins, conf_pre, conf_post, keyboard_name, bouncetime=200, polarity=0, pressed_on_key_down=True, *args, **kwargs): logger.debug("__init__(input_pins = %s, output_pins = %s, bouncetime = %s, polarity = %s)", input_pins, output_pins, bouncetime, polarity) self.keyboard_name = keyboard_name self._polarity = polarity self._InputPins = map(int, input_pins) self._OutputPins = map(int, output_pins) self._pressed_on_key_down = pressed_on_key_down #RPiGPI0.setwarnings(False) gpio.init() section_name = conf_pre+'keyboard'+conf_post ''' # pyA20 doesn't support any modes if doorpi.DoorPi().config.get(section_name, 'mode', "BOARD").upper() == "BOARD": RPiGPI0.setmode(RPiGPI0.BOARD) else: RPiGPI0.setmode(RPiGPI0.BCM) ''' # issue 134 pull_up_down = doorpi.DoorPi().config.get(section_name, 'pull_up_down', "PUD_OFF").upper() if pull_up_down == "PUD_DOWN": pull_up_down = gpio.PULLDOWN elif pull_up_down == "PUD_UP": pull_up_down = gpio.PULLUP else: pull_up_down = 0 # issue #133 ''' try: # RPiGPI0.setup(self._InputPins, RPiGPI0.IN, pull_up_down=pull_up_down) # todo : investigate input pins and add pull_up_down support to them gpio.setcfg(self._InputPins, gpio.INPUT) except TypeError: logger.warning('todo : setup pins by reference ...') ''' def add_event_detect(self, input_pin, bouncetime): # start multiple threads here with event_detect as callback logging.info('started event for pin ' + str(input_pin)) while True: init_state = gpio.input(input_pin) while init_state == gpio.input(input_pin): time.sleep(0.2) self.event_detect(input_pin) for input_pin in self._InputPins: # RPiGPI0.setup(input_pin, RPiGPI0.IN, pull_up_down=pull_up_down) gpio.setcfg(input_pin, gpio.INPUT) gpio.pullup(input_pin, pull_up_down) thread.start_new_thread(add_event_detect, (input_pin, int(bouncetime),)) self._register_EVENTS_for_pin(input_pin, __name__) # issue #133 ''' try: # RPiGPI0.setup(self._OutputPins, RPiGPI0.OUT) gpio.setcfg(self._OutputPins, gpio.OUTPUT) except TypeError: logger.warning('todo : setup pins by reference ...') ''' for output_pin in self._OutputPins: print 'output pin ', output_pin, type(output_pin) # RPiGPI0.setup(output_pin, RPiGPI0.OUT) gpio.setcfg(output_pin, gpio.OUTPUT) # use set_output to register status @ dict self._OutputStatus self.set_output(output_pin, 0, False) self.register_destroy_action() def destroy(self): if self.is_destroyed: return logger.debug("destroy") # shutdown all output-pins for output_pin in self._OutputPins: self.set_output(output_pin, 0, False) # RPiGPI0.cleanup() # A20 does not support cleanup doorpi.DoorPi().event_handler.unregister_source(__name__, True) self.__destroyed = True def event_detect(self, pin): if self.status_input(pin): self._fire_OnKeyDown(pin, __name__) if self._pressed_on_key_down: # issue 134 self._fire_OnKeyPressed(pin, __name__) else: self._fire_OnKeyUp(pin, __name__) if not self._pressed_on_key_down: # issue 134 self._fire_OnKeyPressed(pin, __name__) def status_input(self, pin): if self._polarity is 0: return str(gpio.input(int(pin))).lower() in HIGH_LEVEL else: return str(gpio.input(int(pin))).lower() in LOW_LEVEL def set_output(self, pin, value, log_output=True): parsed_pin = doorpi.DoorPi().parse_string("!"+str(pin)+"!") if parsed_pin != "!"+str(pin)+"!": pin = parsed_pin pin = int(pin) value = str(value).lower() in HIGH_LEVEL if self._polarity is 1: value = not value log_output = str(log_output).lower() in HIGH_LEVEL if pin not in self._OutputPins: return False if log_output: logger.debug("out(pin = %s, value = %s, log_output = %s)", pin, value, log_output) gpio.output(pin, value) self._OutputStatus[pin] = value return True
-
Sorry 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 connected2. Check the availability of the device
ls /dev/spidev0.03. Install the libraries
apt-get install python-dev4. Install GPIO library
git clone https://github.com/duxingkei33/orangepi_PC_gpio_pyH3.git
cd orangepi_PC_gpio_pyH3
python setup.py install5. Installing SPI library
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
python setup.py install6. Installation MFRC522 library
git clone https://github.com/rasplay/MFRC522-python.git
cd MFRC522-python7. 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.pyread.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 soxcat << _EOF_ > /etc/asound.conf
pcm.!default {
type hw
card 0
}ctl.!default {
type hw
card 0
}
_EOF_amixer set-c 0 'Audio lineout' unmute
------------- -
in case of fire it is desirable to unlock the door, so it is normal that when there is no electricity then the lock is opened. To change the logic through replacement of polarity in doorpi.ini as you did, even the relay contacts from normally open to normally closed, yet described
key Schlüssel polarity https://github.com/motom001/DoorPi/wiki/Configfile
-
Web Camera with microphone HP HD 2300 has significantly improved the situation with the echo.
-
OnKeyPressed and gpio output?
instead of a relay, you can turn off the amplifier mosfet transistor http://maciej.kuzmiak.net/wp-c…OSFET_low_side_driver.png -
see this file, include rs522 and buttons.
Python
Alles anzeigen#!/usr/bin/env python # -*- coding: utf-8 -*- import time import MFRC522 import signal from pyA20.gpio import gpio from pyA20.gpio import port from pyA20.gpio import connector gpio.init() #Initialize module. Always called first gpio.setcfg(port.PA3, gpio.OUTPUT) #lock output gpio.output(port.PA3, 0) gpio.setcfg(port.PC4, gpio.INPUT) # open input gpio.pullup(port.PC4, gpio.PULLUP) gpio.setcfg(port.PC7, gpio.INPUT) # bell input gpio.pullup(port.PC7, gpio.PULLUP) continue_reading = True MIFAREReader = MFRC522.MFRC522() path="/usr/local/etc/DoorPi/virtual/inputs" def end_read(signal, frame): global continue_reading continue_reading = False print "Ctrl+C captured, ending read." MIFAREReader.GPIO_CLEEN() signal.signal(signal.SIGINT, end_read) while continue_reading: (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL) if status == MIFAREReader.MI_OK: print "Card detected" (status,backData) = MIFAREReader.MFRC522_Anticoll() if status == MIFAREReader.MI_OK: numer = str(backData[0])+str(backData[1])+str(backData[2])+str(backData[3])+str(backData[4]) file=open(path+'/'+numer,'w') file.write("false") file.close() time.sleep(0.5) file=open(path+'/'+numer,'w') file.write("true") file.close() time.sleep(0.2) if gpio.input(port.PC7) == 0: #input button filename = '/usr/local/etc/DoorPi/virtual/inputs/59' # bell f = open (filename, 'w') f.write('false') f.close() time.sleep (0.5) f = open (filename, 'w') f.write('true') f.close() time.sleep(1) else: time.sleep(0.2) if gpio.input(port.PC4) == 0: # exit button # gpio.output(port.PA3, 0) filename = '/usr/local/etc/DoorPi/virtual/inputs/58' f = open (filename, 'w') f.write('false') f.close() time.sleep(0.5) f = open (filename, 'w') f.write('true') f.close() time.sleep(1) # gpio.output(port.PA3, 1) else: time.sleep(0.2)
-
[onboardpins_InputPins]
12 = Door # 3 pin-PA12
1 = call:**621 # pin 11 -PA1
3 = call:**624 # pin 15 -PA3 -
Hello
If you connect them to a single hub, then IP address register is not required.
It is advisable to install one panel asterisk, in apartments on the accounts of registration devices - in case of interruption to the Internet connection, intercom system will work on home devices.
for control of the Internet, the router to configure port forwarding, and NOIP or the like. -
~# cat /proc/asound/cards | grep ]: | sed 's/.* - //'
audiocodec
sndhdmi
HP Webcam HD 2300changed attribute in doorpi.ini but the result of the microphone is not changed.
capture_device = ALSA: audiocodec
on:
capture_device = ALSA: HP Webcam HD 2300happened: I edited req_sipphone.py
-
raspbian not work
1) armbian img
2) install doorpi
3) changing the file from_gpio.py
4) install pyA20 https://pypi.python.org/pypi/pyA20
5) redacted doorpi.ini gpio because different name pins OrangePi
example if selected port PA13:
[keyboards]
io = gpio
[io_OutputPins]
13 = Door -
Please indicate location of Linphone file, which has a main function with selection of a sound source, since it is required to set the usb microphone manually in the OrangePi
Danke!
ps doorpi/sipphone/from_linphone.py
what to write, if interesant cart 2:
# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: H2300 [HP Webcam HD 2300], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0 -
1. set pyA20
2. Replace from_gpio file
3. Use the ports that are written with the PA, for example, PA7, PA14 ... -
window for the camera to be increased
-
Hi Emil,
yes, i solved it.
by adding an event in doorpi.ini, that has to play the sound.i was looking through your doorpi.ini as well. and didn't understand what means string:
[onboardpins_InputPins]
36 = 36how it should work? what is a logic of that?
-
dear colleagues!
unfortunately i couldn't find how i can add some sound that will accompany a opening of the door, could you please advise me how to do it? e.g. i open the door by using rfid card and i'd like to hear some special sound.
Danke.