Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bei nicht Benutzung einer PIFace-Karte startet nicht #17

Closed
dschingischan opened this issue Jan 9, 2015 · 13 comments
Closed

Bei nicht Benutzung einer PIFace-Karte startet nicht #17

dschingischan opened this issue Jan 9, 2015 · 13 comments

Comments

@dschingischan
Copy link

Bei nicht Benutzung einer PIFace-Karte DoorPi startet nicht

@motom001
Copy link
Owner

Kommt eine Fehlermeldung?
Eventuell die Logdatei?
Hattest du mal piface installiert?

@dschingischan
Copy link
Author

Hallo,

Logdatei und Fehlermeldung folgt nocht.
Nein ein Piface hatte ich bisher noch nicht...

@pmunz
Copy link
Collaborator

pmunz commented Jan 10, 2015

schick mal bitte die auszüge von /var/log/doorpi/***
oder beende den doorpi dienst mit /etc/init.d/doorpi stop
und mach
/home/pi/DoorPi/doorpi/main.py --configfile /home/pi/DoorPi/conf/doorpi.cfg
vielleicht kannst Du da mehr erfahren

@motom001
Copy link
Owner

Hilfreich ist auch, die Dateien unter /var/log/doorpi/* zu löschen und dann DoorPi nur einmal zu starten.
Löschen wäre z.B. möglich mit
sudo rm /var/log/doorpi/*

@motom001
Copy link
Owner

Erinnerung: Markus, Du wolltest noch die Log-Datei schicken :)
Oder ist das Problem behoben?

@dschingischan
Copy link
Author

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 874, in emit
    self.flush()
  File "/usr/lib/python2.7/logging/__init__.py", line 834, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file main.py, line 102
2015-01-12 17:12:14,769 [ERROR]     [__main__] Exception NameError: failed to create /var/run/doorberry.MainThread-2395
Traceback (most recent call last):
  File "/home/pi/DoorPi/doorpi/main.py", line 101, in main_as_daemon
    try:                        daemon_runner.do_action()
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 121, in _start
    self.daemon_context.open()
  File "/usr/lib/pymodules/python2.7/daemon/daemon.py", line 344, in open
    self.pidfile.__enter__()
  File "/usr/lib/pymodules/python2.7/lockfile.py", line 223, in __enter__
    self.acquire()
  File "/usr/lib/pymodules/python2.7/daemon/pidlockfile.py", line 109, in acquire
    super(TimeoutPIDLockFile, self).acquire(timeout, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/daemon/pidlockfile.py", line 59, in acquire
    super(PIDLockFile, self).acquire(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/lockfile.py", line 239, in acquire
    raise LockFailed("failed to create %s" % self.unique_name)
LockFailed: failed to create /var/run/doorberry.MainThread-2395
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
    if self.shouldRollover(record):
  File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
    self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
IOError: [Errno 9] Bad file descriptor
Logged from file main.py, line 102
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 874, in emit
    self.flush()
  File "/usr/lib/python2.7/logging/__init__.py", line 834, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file doorpi.py, line 137
2015-01-12 17:12:14,826 [DEBUG]     [doorpi] destroy
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
    if self.shouldRollover(record):
  File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
    self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
IOError: [Errno 9] Bad file descriptor
Logged from file doorpi.py, line 137

@dschingischan
Copy link
Author

Hallo, hier wenn auch etwas später sorry und schon mal lieben Dank

@dschingischan
Copy link
Author

2015-01-12 17:12:14,204 [DEBUG]     [__main__] loaded with arguments: ['/home/pi/DoorPi/doorpi/main.py', 'start', '--configfile', '/home/pi/DoorPi/conf/doorpi.ini']
loaded with arguments: ['/home/pi/DoorPi/doorpi/main.py', 'start', '--configfile', '/home/pi/DoorPi/conf/doorpi.ini']
2015-01-12 17:12:14,249 [DEBUG]     [doorpi] __init__
__init__

@motom001
Copy link
Owner

aktuell benötigt die Erstellung der pid-Files noch sudo-Rechte und läuft nicht als normaler Benutzer pi.
Teste mal bitte:

sudo /home/pi/DoorPi/doorpi/main.py start --configfile /home/pi/DoorPi/conf/doorpi.ini

vermutlich aber eher mit der cfg statt der ini-Datei:

sudo /home/pi/DoorPi/doorpi/main.py start --configfile /home/pi/DoorPi/conf/doorpi.cfg

und die sollte vorher auf Deine Bedürfnisse angepasst sein. Und um ganz auf Nummer sicher zu gehen, DoorPi einfach erst einmal als Anwendung und nicht als Daemon starten:

sudo /home/pi/DoorPi/doorpi/main.py --configfile /home/pi/DoorPi/conf/doorpi.cfg

@motom001 motom001 added the FAQ label Jan 12, 2015
@dschingischan
Copy link
Author

???

pi@doorberry ~ $ sudo /home/pi/DoorPi/doorpi/main.py start /home/pi/DoorPi/conf/doorpi.ini
usage: /home/pi/DoorPi/doorpi/main.py [-h] [-V] --configfile CONFIGFILE
/home/pi/DoorPi/doorpi/main.py: error: argument --configfile is required

@motom001
Copy link
Owner

Sorry, war mein Fehler...
Hab es in dem Beitrag oben editiert - so sollte es gehen...

@motom001 motom001 added the DE label Jan 12, 2015
@dschingischan
Copy link
Author

hoffe das hilft?

2015-01-12 20:34:10,505 [DEBUG]         [__main__] loaded with arguments: ['./main.py', '--configfile', '/home/pi/DoorPi/conf/doorpi.cfg']
2015-01-12 20:34:10,510 [DEBUG]         [doorpi] __init__
2015-01-12 20:34:10,515 [DEBUG]         [doorpi] run
2015-01-12 20:34:10,520 [DEBUG]         [doorpi] prepare
2015-01-12 20:34:10,524 [DEBUG]         [doorpi] givven arguments argv: Namespace(configfile=<open file '/home/pi/DoorPi/conf/doorpi.cfg', mode 'r' at 0xb66de440>)
2015-01-12 20:34:10,530 [DEBUG]         [conf.config_object] load_config (<open file '/home/pi/DoorPi/conf/doorpi.cfg', mode 'r' at 0xb66de440>)
2015-01-12 20:34:10,535 [DEBUG]         [conf.config_object] use configfile: /home/pi/DoorPi/conf/doorpi.cfg
2015-01-12 20:34:10,559 [DEBUG]         [conf.config_object] __init__
2015-01-12 20:34:10,563 [TRACE]         [conf.config_object] get_from_config
2015-01-12 20:34:10,583 [TRACE]         [conf.config_object] get for key typ in section keyboard (default: autodetect)
2015-01-12 20:34:10,588 [TRACE]         [conf.config_object] get_string for key typ in section keyboard (default: autodetect)
2015-01-12 20:34:10,592 [TRACE]         [conf.config_object] section 'keyboard' doesn't exist
2015-01-12 20:34:10,597 [TRACE]         [conf.config_object] return default 'autodetect
2015-01-12 20:34:10,602 [TRACE]         [conf.config_object] get_int for key bouncetime in section keyboard (default: 5000)
2015-01-12 20:34:10,606 [TRACE]         [conf.config_object] get_string for key bouncetime in section keyboard (default: )
2015-01-12 20:34:10,611 [TRACE]         [conf.config_object] section 'keyboard' doesn't exist
2015-01-12 20:34:10,615 [TRACE]         [conf.config_object] return default '
2015-01-12 20:34:10,620 [TRACE]         [conf.config_object] get_keys for section InputPins
2015-01-12 20:34:10,626 [TRACE]         [conf.config_object] get_keys for section OutputPins
2015-01-12 20:34:10,631 [TRACE]         [keyboard.KeyboardInterface] autodetect
2015-01-12 20:34:10,635 [TRACE]         [keyboard.KeyboardInterface] load_piface
2015-01-12 20:34:10,642 [DEBUG]         [keyboard.from_piface] keyboard.from_piface loaded
2015-01-12 20:34:10,739 [DEBUG]         [keyboard.AbstractBaseClass] keyboard.AbstractBaseClass loaded
2015-01-12 20:34:10,746 [DEBUG]         [keyboard.from_piface] __init__(input_pins = ['11', '13', '15'], output_pins = ['18', '7', '16'])
2015-01-12 20:34:10,751 [TRACE]         [action.handler] register Event OnKeyPressed from keyboard.from_piface
2015-01-12 20:34:10,755 [TRACE]         [action.handler] register Eventsource keyboard.from_piface
2015-01-12 20:34:10,760 [DEBUG]         [action.handler] event_source keyboard.from_piface was added
2015-01-12 20:34:10,764 [TRACE]         [action.handler] added event_name OnKeyPressed an register source keyboard.from_piface
2015-01-12 20:34:10,925 [ERROR]         [__main__] Exception NameError: No PiFace Digital board detected (hardware_addr=0, bus=0, chip_select=0).
Traceback (most recent call last):
  File "./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 41, in __init__
    p.init()
  File "/usr/lib/python2.7/dist-packages/pifacedigitalio/core.py", line 166, in init
    raise failed_boards[0]
NoPiFaceDigitalDetectedError: No PiFace Digital board detected (hardware_addr=0, bus=0, chip_select=0).
2015-01-12 20:34:10,940 [DEBUG]         [doorpi] destroy
2015-01-12 20:34:10,945 [WARNING]       [action.handler] source doorpi unknown - skip fire_event OnShutdown
2015-01-12 20:34:10,949 [TRACE]         [action.handler] unregister Eventsource doorpi and force_unregister is True
2015-01-12 20:34:10,954 [DEBUG]         [keyboard.from_piface] destroy
Exception pifacedigitalio.core.NoPiFaceDigitalError: NoPiFaceDigitalError('There is no PiFace Digital with hardware_addr 0',) in <bound method PiFace.__del__ of <keyboard.from_piface.PiFace object at 0xb6c4f850>> ignored
pi@doorberry ~/DoorPi/doorpi $

@motom001
Copy link
Owner

Okay, DoorPi scheint zu laufen. Es lag am fehlenden sudo und der falschen config-Datei (ini statt cfg).
Die andere Fehlermeldung hab ich in einem neuen Issue #29 aufgenommen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants