Giter VIP home page Giter VIP logo

alertr's People

Contributors

sqall01 avatar tbertels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alertr's Issues

Siren Timeout

G'day,

I am currently building a raspberry pi alarm system and have chosen alertr for my base, it will have RFID for user access control, etc

My first question was, as I am duplicating an alarm system id like an external siren to sound for 2 minutes, and then a strobe to stay on until the system is next deactivated.

Is there any way to set a timeout that switches the gpio pin off after a set amount of time

Regards,
Phillip Savage

ManagerClientConsole cant find server

both the server and managerclientconsole are configured as the tutorial and run on port:44556, client has server as localhost and in the log it says it cannot find the alertRserver when it is running on the same machine (virtual machine, ubuntu 20.0.4)

Here's the log:
06/20/2020 00:45:03 ERROR: [alertRclient.py]: Could not parse config.
Traceback (most recent call last):
File "alertRclient.py", line 137, in
raise ValueError("Server CA does not exist.")
ValueError: Server CA does not exist.

Best way to implement a door sensor

I have been looking around and it looks like there is no way to implement the smart sensors that you can generally buy, and now i'm looking at making a sensor with a pi zero w, reed switch, and a battery but im wondering if there is a simpler solution/implementation anyone has figured out, if there is please let me know, thanks!

alertR Dbus

Trying to install/run alertR on rpi B2. Configuring instance(s). I get this:

pi@raspberrypi ~ $ sudo python alertRinstaller.py -i alertClientDbus -t alertClientDbus
12/30/2015 14:26:08 INFO: [alertRinstaller.py]: Checking the dependencies.
12/30/2015 14:26:08 INFO: [alertRinstaller.py]: Checking module 'dbus'.

The needed version '1.2.0' of module 'dbus' is not satisfied (you have version '1.1.1' installed).
Please update your installed version.

Got any guidance?
cheers

Triggered alert before system active didnt gets triggered again

i have magnetic switches and the sensorClientRaspberryPi installed. the alertClientExecuter makes a phone call if the system is active and an alert is triggered. but when the alert was triggered before the system gets activated, it didnt gets triggered again. e.g. "the kids" forgot to close the garage before the system gets activated.
is there an overseen config item to this scenario?

Feature Request: Administrative Sensor Disablement

Would like to have the ability to disable specific sensors server side rather than taking them offline at the client.

This would be helpful to administratively take a single sensor offline for a short period of time rather than re configuring the client.

alertRinstaller.py SyntaxError

Hi,
I just wanted to install alerR but alertRinstaller.py is not working. If I run it I get:

pi@fox-pi:~ $ python alertRinstaller.py -l
  File "alertRinstaller.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

I tried it on Raspberry Pi with Python 2.7.9 and Arch linux with Python 3.6.1.

v.4 Setup Questions

I have successfully (I think) setup the server and found a few things curious.

  1. The database alertr is created but has no tables. Do I need to manually create the SQL scripts to create the tables? Looks like the Manager Client DB does the same.
  2. Is it possible to access the 'alertR server' at this point or does more need to be installed?
  3. Is the Phone App just using the phone's browser to access a web page? I don't see an app to install on the phone.

Last be not least, I would be glad to share my documentation/notes about my attempt to install with you to assist in getting the examples and docs updated. Love to help.

Issue with Keypad auto login *SOLVED*

Hi!
I have a problem with starting the shellwrapper for the Keypad.
Since Jessie do not use Inittab any more and use Systemd instead the tutorial is slightly missleading.
I have made Systemd to auto start "Keypad" user but I can't really get my hands on how to make the shellwrapper to start with the user "Keypad" hence the python program needs to be with root permission.
For the moment I start the keypad manually.
What to do?!

/CE

Feature Request: Activation Confirmation for not-ready sensors

It would be nice to have a confirmation displayed to the user acknowledging sensors (in group XX) that are in the not ready state. This notification should be displayed on the Keypad, console, and Mobile manager. This could/should be configurable per the admin and should serve as a reminder to close the windows/doors/sensors prior to activation.

Feature request: installation and configuration assistants

Both the initial and following installation and configuration of AlertR could be made easier (and so the learning curve of AlertR) by creating installation and configuration scripts and assistants.

An install.sh script would install the dependencies, beginning by the ones needed for the server.
It would also install a web server, so that the following installation could be made through a web interface on a desktop browser/smartphone browser/the AlertR app.
The web interface would then allow installing Clients as needed by executing scripts. It would also allow configuring both the server and the clients

Problem with alertwebmobilemanager after update to 0.800

Hi!
After update to 0.800 on server and different clients I can't connect to the webmanager or rather the webpage stop loading, it's only rendering the loading gif. After updating the server/client I forgot to update the webmanager (index,config.php etc) and the webpage did load but with no activation buttons and so on. After updating all web stuff it only shows the loader gif.
Have I forgot some permissions or what?
The tutorial for webmobilemananger is removed and I can't really remember how it was setup in the beginning

/Clas

Webcam integration

This is not so much an an issue as it is a question. How does alertR integrate with a webcam? I saw it was mentioned in the tutorials that a sensor could be used to trigger a webcam to play on XBMC. Would it be possible to use a webcam attached to one of the Pis? Could you view the video through the web access client at will, or only if an alert was triggered?

Thanks, looks like an awesome project!

Setup of AlarmR

Hi sqall, I've been looking into your project, but after many tries I could not make it work. I found some typos in the example configuration on the managerclientdatabase section and could not make the web mobile manager to work (missing config.php)

Is it possible to connect to the system via a regular web client? How can I setup it correctly?
Your project seems very interesting, but I could not find enough documentation on these parts .

Please point me in the right direction.

Pau

Error in dependency version check of installer

In the installer the check for correct dependency version is

if int(installedVersion[i]) > int(neededVersion[i]):
    versionCorrect = True
    break

But versionCorrect is set to False initially, this fails if the already installed version matches exactly the needed version.
Should versionCorrect be set to True initially?

alertClientExecuter, arguments and Node deactivate

Hi! I have started a server with door switch, temp, cam and motion sensor and it have been running for a couple of months now, flawless!! great job.
But now I will add a script to notify me thru a siren. How to use the executer with argument. Do you have a example!
I also have mail notification but via execute script thru external mail script, I would like to under stand how to use the alertClientMail and the built in mail templet. Do you have a example for that also.

PS: Is the plan for you to still implement the function for deactivate seperate nodes, great if so, I have a node in my sommer house for temperature and door sensor and want to deactivate it but still have my aparment active.

Keep up the good work!
Regards- Clas

ICalendar exit code 1

Hi! I'v tryed to setup ICalendar as a sensor with as per your tutorial "Developer CalendarSchedule" to trigger a door lock.
On the server I have i alertLevel no:30 set for ICalendar with the script - calendar_schedule.py.
I set a schedual time to trigger "alertLevel: 30" and "state: 1" and the ICalendar trigger but the internal Instrumentation throws me an error "exit code (1)" and after that it dosn't register when the calendar send "state: 0".
I do miss something in the script otherwise it would not throw an error or.....

/Clas

Keypad Autologin

I have setup the keypad on a pi zero. All goes fine until the last few lines where the passwd file and inittab file are edited. What changes need to be made for this to work with Jessie which no longer uses inittab but uses systemd? I successfully got the keypad user to autologin but when I change the passwd file it fails and keeps trying to autologin over and over.

Thank you for your time and work on this project. I enjoy it alot.

Update: Not exactly sure how but I go the login to show errors instead of re-logging in. I corrected a couple of errors in the config including the fact that the server host value needed to be an IP. Seems the system could not resolve the server's hostname.

Now the alertR keypad manager displays on boot but when I key the pass code it prompts for a password. Figured out that it is the normal login behind the display. if I put in pi and raspberry I can login with the following errors:

-bash: cannot set terminal process group (505): Inappropriate ioctl for device
-bash: no job control on this shell

Any assistance greatly appreciated.

Wrong file name in Example Configuration for Web Mobile Manager

Hi!
Just to help out-
I have found a fault in the code in your example configuration for Web Mobile Manager in the section for web page.
You have written :
#################### configure web page ####################

sqall@webserver:/var/www/alertR/config$ vim config.conf

But it has to be .php to be able to work with the index file as It calls for the script with /config/config.php
It´s not a problem when you just delete the .templet on the example config but if you read the Example Config as I did then It can cause problem when starting the web page.

-- now my page is up and running :-)
Keep up the good work!
Cheers
/CE

SSLEOFError: EOF occurred in violation of protocol

alertrserver instance version is at 0.504 (tls 1.2 on)
e.g. managerClientDatabase ist at 0.501

after i did a apt-get update && apt-get distupgrade the following error occurs on all clients/sensors:

03/14/2019 08:55:12 DEBUG: [client.pyc]: Acquire lock.
03/14/2019 08:55:12 ERROR: [client.pyc]: Connecting to server failed.
Traceback (most recent call last):
File "/opt/alertr/managerClientDatabase/lib/client.py", line 2517, in initializeCommunication
self.client.connect()
File "/opt/alertr/managerClientDatabase/lib/client.py", line 52, in connect
self.sslSocket.connect((self.host, self.port))
File "/usr/lib/python2.7/ssl.py", line 824, in connect
self._real_connect(addr, False)
File "/usr/lib/python2.7/ssl.py", line 815, in _real_connect
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
SSLEOFError: EOF occurred in violation of protocol (_ssl.c:581)
03/14/2019 08:55:12 DEBUG: [client.pyc]: Release lock.
03/14/2019 08:55:12 CRITICAL: [alertRclient.py]: Connecting to server failed. Try again in 5 seconds.

sounds like there is maybe a cipher problem?

the upgrade installed the following packages on rpi:

Start-Date: 2019-03-11 15:11:15
Commandline: apt-get -y dist-upgrade
Upgrade: libgssapi-krb5-2:armhf (1.12.1+dfsg-19+deb8u4, 1.12.1+dfsg-19+deb8u5), apt:armhf (1.0.9.8.4, 1.0.9.8.5), libirs-export91:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), libkrb5-3:armhf (1.12.1+dfsg-19+deb8u4, 1.12.1+dfsg-19+deb8u5), libudev1:armhf (215-17+deb8u8, 215-17+deb8u10), krb5-locales:armhf (1.12.1+dfsg-19+deb8u4, 1.12.1+dfsg-19+deb8u5), libk5crypto3:armhf (1.12.1+dfsg-19+deb8u4, 1.12.1+dfsg-19+deb8u5), libdns-export100:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), apache2-bin:armhf (2.4.10-10+deb8u12, 2.4.10-10+deb8u13), libapache2-mod-php5:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), systemd-sysv:armhf (215-17+deb8u8, 215-17+deb8u10), libmagic1:armhf (5.22+15-2+deb8u4, 5.22+15-2+deb8u5), libcurl3:armhf (7.38.0-4+deb8u13, 7.38.0-4+deb8u14), libisccc90:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), file:armhf (5.22+15-2+deb8u4, 5.22+15-2+deb8u5), systemd:armhf (215-17+deb8u8, 215-17+deb8u10), php5-readline:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), libisc-export95:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), libsystemd0:armhf (215-17+deb8u8, 215-17+deb8u10), libkrb5support0:armhf (1.12.1+dfsg-19+deb8u4, 1.12.1+dfsg-19+deb8u5), php5:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), udev:armhf (215-17+deb8u8, 215-17+deb8u10), curl:armhf (7.38.0-4+deb8u13, 7.38.0-4+deb8u14), libisc95:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), libapt-pkg4.12:armhf (1.0.9.8.4, 1.0.9.8.5), libbind9-90:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), libdns100:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), liblwres90:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), openssl:armhf (1.0.1t-1+deb8u10, 1.0.1t-1+deb8u11), apt-utils:armhf (1.0.9.8.4, 1.0.9.8.5), libapt-inst1.5:armhf (1.0.9.8.4, 1.0.9.8.5), libcurl3-gnutls:armhf (7.38.0-4+deb8u13, 7.38.0-4+deb8u14), libisccfg90:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), bind9-host:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), apache2-utils:armhf (2.4.10-10+deb8u12, 2.4.10-10+deb8u13), libjpeg62-turbo:armhf (1.3.1-12, 1.3.1-12+deb8u1), php5-mysql:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), apache2-data:armhf (2.4.10-10+deb8u12, 2.4.10-10+deb8u13), libisccfg-export90:armhf (9.9.5.dfsg-9+deb8u16, 9.9.5.dfsg-9+deb8u17), apache2:armhf (2.4.10-10+deb8u12, 2.4.10-10+deb8u13), php5-common:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), php5-cli:armhf (5.6.39+dfsg-0+deb8u1, 5.6.40+dfsg-0+deb8u1), libssl1.0.0:armhf (1.0.1t-1+deb8u10, 1.0.1t-1+deb8u11)
End-Date: 2019-03-11 15:14:04

Playing (no)sound from keypad to bluetooth speaker

Hi!
I'm trying to make the audio.py to play the .wav files to a bluetooth speaker! instead of the inbuilt 3.5 jack.
I have tryed different setup in the file but no sound is coming out off the speaker.
The terminal input looks like this -
aplay -D bluealsa:HCI=hci0,DEV=00:58:76:45:A3:A2,PROFILE=a2dp /home/alertr/managerClientKeypad/sounds/warning.wav -
and that gets me a sound output!
But in the audio.py file I have tryed this -
(["aplay", "-D bluealsa:HCI=hci0 DEV=00:58:76:45:A3:A2 PROFILE=a2dp", "fileLocation"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) -
Returns no error and the keypad terminal turn to activated/ deactivated but no sound from the speaker.
With bluetooth it will be much cleaner setup beside the terminal thats why I'm trying to get this to work. I have tryed other setups according to aplay -help page, only return more errors.
Some idea of whats going wrong here!?

//Clas

NonIssue: What distro is recommended?

What distribution is recommended/eastiest to be used for alertR on the Raspberry Pi? I notice there are a lot of python dependencies, I am trying to find a distro that has most of this included or is easy to install.

Temperature sensor don't go back to normal state after triggered

Hi!
I've discovered a problem with the ds18b20 type sensor script.
I use two sensors in the script and both are set to triggerAlert=True and triggerAlertNormal=False with threshold @ 5deg set to "LT", so both have the same setup and they do measure the temperature down to the threshold but after that one of them do not change back to normal after triggered.
Only way to get it out of triggered state is to restart the sensor service
I'm using config 0.901

Not a big problem but still...!

/CE

Problem in config managerClientDatabase NameError: name 'updateServer' is not defined

Hi sqall01,

just updated this great piece of software... got anything to work, except managerClientDatabase.
I updated server to 0.504 and managerClientDatabase to 0.501, both from 0.500.... I used the update script, checked the configs twice, but got no clue on this one... maybe you can help.... thx

Manager Start:
python alertRclient.py
Traceback (most recent call last):
File "alertRclient.py", line 312, in
globalData.versionInformer = VersionInformer(updateServer, updatePort,
NameError: name 'updateServer' is not defined

Server Log:
12/28/2018 12:33:30 INFO: [server.pyc]: Client connected (X.X.X.X:41274).
12/28/2018 12:33:32 INFO: [storage.pyc]: Node with username 'ZZZZZ' already exists in database.
12/28/2018 12:33:32 INFO: [storage.pyc]: Manager already exists in database.
12/28/2018 12:33:32 INFO: [server.pyc]: Communication initialized (X.X.X.X:41274).
12/28/2018 12:33:32 INFO: [server.pyc]: Client disconnected (X.X.X.X:41274).
12/28/2018 12:33:32 ERROR: [server.pyc]: Receiving CTS failed (X.X.X.X:41274).
Traceback (most recent call last):
File "/opt/alertr/server/lib/server.py", line 923, in _initiateTransaction
data = self.sslSocket.recv(BUFSIZE)
File "/usr/lib/python2.7/socket.py", line 174, in _dummy
raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
12/28/2018 12:33:32 ERROR: [server.pyc]: Sending state change to manager failed (X.X.X.X:41274).

PHP issues with Web Mobile manager

Hi!
I'v deployed AlertR 0.900 on a AWS instance with Ubuntu 20.04 and I have problem with the web page rendering. The Apache server do display the index.php but there is no buttons for changing the profiles, the global php version is 8.0.12 and enabled version in Apache2 is the same.
I'v tryed to enable php5.6 but then it is only the loading icon showing up on screen.
On my server at home I have 0.800 on Debian 11 with php 5.6 enabled and all is running fine
Is there any known extensions needed?!
Update!
I disabled the php8..0 and enabled the 5.6 and I saw on the webpage that the Apache lost the connection to the database... hmmm

//Clas

v.4 Server setup problem

Fresh install on Raspian Jessie, fully updated.

pi@raspberrypi:~ $ python ~/alertR/alertRinstaller.py -i server -t server/
06/08/2016 11:29:15 INFO: [alertRinstaller.py]: Checking the dependencies.
06/08/2016 11:29:15 INFO: [alertRinstaller.py]: Checking module 'MySQLdb'.
06/08/2016 11:29:15 INFO: [alertRinstaller.py]: Files to modify: 1; New files: 0
06/08/2016 11:29:15 INFO: [alertRinstaller.py]: Downloading file: 'config/config.xml.template'
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 10%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 20%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 40%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 50%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 70%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 80%
06/08/2016 11:29:16 INFO: [alertRinstaller.py]: Download: 100%
06/08/2016 11:29:16 ERROR: [alertRinstaller.py]: Temporary file does not have the correct hash.
06/08/2016 11:29:16 ERROR: [alertRinstaller.py]: Downloading files from the repository failed. Aborting update process.
06/08/2016 11:29:16 ERROR: [alertRinstaller.py]: Installation failed.

Thanks for all your help.

Feature Request: Alert Level - Administrative Enable/Disable

Have the ability to disable/enable alert level categories individually using a security PIN

ie - Enable the Home alarm system (lvl2) separately then the Fire system -(lvl1) and turn off that unreliable sensor I am working on in the garden (lvl50)

Feature request: RFID Client

Hey,

as you have noticed in your blog, you have written a rfid client - will you release this client too?
Does this client contain an option rfid & pin pad?

Best regards
-Andreas

Feature Request : MQTT Manager

Enable an MQTT manager who can subscribe to alert levels send standardized MQTT messages to an MQTT broker. This will allow for expanded integration of AlertR other management platforms.

Server error after update to server 0.503

Hi!
First I updated the alertClientMail and managerClientConsol to 0.501 with server version 0.500 and it was running well. Then I updated the server side to 0.503 and I ended up with this error in the log:

10/21/2017 11:56:42 ERROR: [alertRserver.py]: Could not parse config.
Traceback (most recent call last):
File "./alertRserver.py", line 1320, in
sensor.description = str(item.attrib["description"])
KeyError: 'description'

Unfortunatelly I did not backup my working config on the server..... but anyway that is on me.
When I check status on server thru systemctl I get:

● alertRserver.service - alertR Server
Loaded: loaded (/etc/systemd/system/alertRserver.service; enabled)
Active: active (exited) since lör 2017-10-21 11:40:49 CEST; 33min ago
Process: 2405 ExecStop=/etc/init.d/alertRserver.sh stop (code=exited, status=1/FAILURE)
Process: 2413 ExecStart=/etc/init.d/alertRserver.sh start (code=exited, status=0/SUCCESS)
Main PID: 2413 (code=exited, status=0/SUCCESS)

okt 21 11:40:49 lill-clas systemd[1]: Started alertR Server.
okt 21 11:40:49 lill-clas alertRserver.sh[2413]: Starting daemon: alertRserver:.
okt 21 11:48:17 lill-clas systemd[1]: Started alertR Server.
okt 21 11:49:31 lill-clas systemd[1]: Started alertR Server.
okt 21 11:50:07 lill-clas systemd[1]: Started alertR Server.
okt 21 11:54:55 lill-clas systemd[1]: Started alertR Server.
okt 21 11:55:30 lill-clas systemd[1]: Started alertR Server.

Is there any way to reverse the update back to 0.500 or is it something I am missing on restarting the system.

//CE

ClientExecuter and .py script to email and text

Greetings,

First of all I want to thank you for sharing this project. Even a person like me with no coding experience can tell this is very well done; you really know you stuff man.
I was trying hard not to bother you with questions but I am at dead end. Because I have no experience with python or any other language for that matter I would find it difficult to explain this issue in the python forums for example. I have made it this far just spending a big share of hours in your tutorials and using the log files, but like I said, I am stuck and I didn't know where else to look for answers. So, if you find the time will you be so kind to help me solve this issue, which is:
I am trying for the clientExecuter that I got running on the same host as the server to send out an email and text message using the python script that I found online. When I check the log file of the clientExecuter I see the message that it receives the sensor alert, but, fails when it tries to execute the python script. Bellow is a section of the clientExecuter config file, a section of the log file and the python script. At the end I have included a link with the clientConsole image, in case it is useful, and a couple pictures with my version of a lazy circuit that may help some else.
Thank you!

---------------------ClientExecuter config.xml (section)------------------

            <!--
                the arguments that are used for the command that
                is executed when a sensor alert was triggered
                (the amount of arguments are variable)
            -->
            <triggerArgument>/home/alertr/alertClientExecuter/scripts/notification.py</triggerArgument>
            <triggerArgument>start</triggerArgument>

            <!--
                the arguments that are used for the command that
                is executed when a all alerts are stopped
                (the amount of arguments are variable)
            -->
            <stopArgument>/home/alertr/alertClientExecuter/scripts/notification.py</stopArgument>
            <stopArgument>stop</stopArgument>
        </executer>
    </alert>
</alerts>

************************* Send email and text script **************************
`#!/usr/bin/python

import smtplib

sender = '[email protected]'
receivers = ['[email protected]','[email protected]','[email protected]']

message = """From: Alert System [email protected]
To: Person <email@@yahoo.com>
Subject: SMTP e-mail test

This is a test e-mail message.
"""

try:
smtpObj = smtplib.SMTP('localhost')
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
except SMTPException:
print "Error: unable to send email"`


------------ClientExecuter - logfile.log--------------------------------
10/13/2016 14:16:02 INFO: [client.pyc]: Received sensor alert.
10/13/2016 14:16:02 ERROR: [alert.pyc]: Executing process 'send email and text' with trigger arguments failed.
Traceback (most recent call last):
File "/home/alertr/alertClientExecuter/lib/alert.py", line 73, in triggerAlert
subprocess.Popen(self.triggerExecute, close_fds=True)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory


------------(might be useful for someone else)--------------------
Image of how the Console looks at this point:
https://my.owndrive.com/index.php/s/aBE3LlBwH536EgL
Images showing a trigger switch created using your guide:
https://my.owndrive.com/index.php/s/gVBeBLtcN7pwuMD
https://my.owndrive.com/index.php/s/aQLT8kiyaextk1k

Missing files after server installation

After installing the server today via the installer, i'm getting ModuleNotFoundError: No module named 'lib.config' when trying to run it.

I don't know about the function of this json file, but I noticed a change in server/instanceInfo.json on the last commit, where all entries for lib/config have been removed. I guess this wasn't done intentionally?

ClientConsole error

Hi,

for some reason, the ClientConsole doesnt start anymore:

python alertRclient.py
Traceback (most recent call last):
File "alertRclient.py", line 361, in
globalData.console.startConsole()
File "/tmp/alertR/managerClientConsole/lib/screen.py", line 1428, in startConsole
self.urwidSensorShowAlertLevels)
File "/tmp/alertR/managerClientConsole/lib/screen.py", line 268, in init
sensorBox = urwid.LineBox(sensorPile, title="host: " + node.hostname)
AttributeError: 'NoneType' object has no attribute 'hostname'

the 'registered' file has been created and includes

[general]
hostname = test2014
description = test manager

Is this a known issue or is something else wrong? The server runs on the same host.

best regards

CLARIFICATION:- What limits the number of Inputs/Outputs

I am sorry if this is the wrong medium on which to post this query. I'm trying to find out more about your project. I found you by searching for "Open Source Alarm System".
I want to start developing software on RasPi and I would like to update my home alarm system I figured I could try to kill two birds.
Not yet having experience with the RasPi I am at a disadvantage. I have a large gap in my knowledge.
How are the Inputs limited?
Can outputs be configured? I couldn't find reference to any beyond software and a siren.
Is there somewhere I can find out more information on the anatomy of the system?
Thanks for your time.

Setup Issue - alertRinstaller - Could not list repository information

Must be missing something in step 1, Brand new install of Raspbian jessie, full updated

python alertRinstaller.py -l
05/31/2016 23:11:30 ERROR: [alertRinstaller.py]: Getting repository information failed.
Traceback (most recent call last):
File "alertRinstaller.py", line 1020, in getRepositoryInformation
conn.request("GET", serverPath + "/repoInfo.json")
File "/usr/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "alertRinstaller.py", line 97, in connect
ca_certs=self.servercert_file)
File "/usr/lib/python2.7/ssl.py", line 891, in wrap_socket
ciphers=ciphers)
File "/usr/lib/python2.7/ssl.py", line 507, in init
self._context.load_verify_locations(ca_certs)
SSLError: [X509] PEM lib (_ssl.c:2751)

Could not list repository information

tried running as root but got the same error.

Error in sensorClientRaspberryPi interrupt callback

I tried to connect a PIR sensor today, but alertR did not react like i thought it should. The very first signal from the sensor after starting the client is always ignored and doesn't trigger even if edgeCountBeforeTrigger is set to 1, because of this code (i think ;) ):

def _interruptCallback(self, gpioPin: int):
# check if the last time the sensor was triggered is longer ago
# than the configured delay between two triggers
# => set time and reset edge counter
utcTimestamp = int(time.time())
if (utcTimestamp - self.lastTimeTriggered) > self.delayBetweenTriggers:
self.edgeCounter = 1
self.lastTimeTriggered = utcTimestamp
else:
# increment edge counter
self.edgeCounter += 1
# if edge counter reaches threshold
# => trigger state
if self.edgeCounter >= self.edgeCountBeforeTrigger:
self._internalState = self.triggerState
logging.debug("[%s]: Sensor '%s' triggered." % (self.fileName, self.description))
logging.debug("[%s]: %d Interrupt "
% (self.fileName, self.edgeCounter)
+ "for sensor '%s' triggered."
% self.description)

I have not thoroughly read the code and am just starting to get a grasp so maybe i'm wrong, but at a first glance i think everything after # if edge counter reaches threshold should be executed every time the method is called, and not only in the else branch.

Setup error

Setting up server is failing for me. managerClientDatabase on localhost appears to be "running" as its log is updating every 5 seconds looking for a connection to the server.
Here is a cut from the Server.log

08/20/2017 21:58:08 ERROR: [storage.pyc]: Not able to get the unique id.
Traceback (most recent call last):
File "/home/alertr/server/lib/storage.py", line 3442, in _getUniqueID
self.uniqueID = self.cursor.fetchall()[0][0]
IndexError: tuple index out of range
08/20/2017 21:58:08 ERROR: [storage.pyc]: Not able to get node id.
Traceback (most recent call last):
File "/home/alertr/server/lib/storage.py", line 5090, in getNodeId
nodeId = self._getNodeId(username)
File "/home/alertr/server/lib/storage.py", line 3361, in _getNodeId
raise ValueError("Node id was not found.")
ValueError: Node id was not found.
08/20/2017 21:58:08 ERROR: [storage.pyc]: Not able to get node id.
Traceback (most recent call last):
File "/home/alertr/server/lib/storage.py", line 4198, in addSensors
nodeId = self._getNodeId(username)
File "/home/alertr/server/lib/storage.py", line 3361, in _getNodeId
raise ValueError("Node id was not found.")
ValueError: Node id was not found.
08/20/2017 21:58:08 ERROR: [alertRserver.py]: Could not parse config.
Traceback (most recent call last):
File "/home/alertr/server/alertRserver.py", line 1412, in
+ "to database.")
ValueError: Not able to add internal sensors to database.

I've looked through wiki as much as I can and searched issues, even ran through the code lines noted by errors to see if I could figure it out. I'm not very advanced though... any help you can give?

Problem in managerClientConsole

in trying to run the managerClienConsole.py I get the following error message:
urwid.widget.WidgetError: Cannot pack (maxcol,) size, this is not a flow widget;

alertR part 2

When I say "got it to work" I mean I've gotten past that step. I'm not sure all is configured properly. Not sure what next step is so will look at sensor clients since this is my main interest--esp door/motion and send email/text.

Great project. Well designed. You clearly are good at what you do. Thanks!

FIFO question = how to?!

This is not an issue on it self but still a problem, I can't get the grip on how to implement the fifo sensor.
I have a smoke alarm that raise an alert on sensorclient by hard wired on to gpio.
My ide is to use a ESP32 (or Zero) to monitor the smoke alarm and have it write in to the fifo file to trigger a alert. But as I say in the beginning, I can't get the grip on how to. The truth is that I'm realy bad at fifo writing, never done it.
Do you have any example other then the example on the wiki?

-- Have you ever thought of having a upload page for all good examples and ideas of using the alertR system?!
I have a setup where I use temp sensor and clientExecuter to sned MQTT to start and stop my heatpump during the winter months.

//Clas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.