nutechsoftware / alarmdecoder-webapp Goto Github PK
View Code? Open in Web Editor NEWWeb application for interfacing with the AlarmDecoder family of devices.
License: MIT License
Web application for interfacing with the AlarmDecoder family of devices.
License: MIT License
The latest webapp update causes an issue with the webapp which results in a "502 Bad Gateway" message in the browser. I updated what had been a stable version, and then attempted to troubleshoot to no avail. I downloaded the current image (alarm decoder-raspbian-2018-05-29.img) and started over. After going through the initial config I updated the webapp again through alarmdecoder.local/update/ with the same result after restart (IE: 502 Bad Gateway). Unfortunately my ability to troubleshoot further is limited.
I'm using a ad2usb with a raspberry pi and the beta image. It seems to work fine if the ad2usb is /dev/ttyUSB0. If its /dev/ttyUSB1 I don't seem to be able to get it to work, even when I attempt setup.
I have two devices plugged into my USB ports. The FTDI USB Serial Device converter (for ad2usb) and a pl2303 converter (for heyu). When I reboot the raspberry pi often these ports switch which ttyUSB they are connected to. I have got around this in the past by creating a linux file /etc/udev/rules.d/49-usb-serial.rules. The rules create a pointer (symbolic link?) to the correct device, so I end up with /dev/ttyUSB.ad2usb and /dev/ttyUSB.heyu that will point to the correct /dev/ttyUSB0 or /dev/ttyUSB1 device.
At this point my only solution is to keep rebooting until the FTDI is /dev/ttyUSB0.
Hard to debug notifications. Does not show line number of exceptions just the line of this handler.
I recently upgraded the web app from v0.7.6-0-g82282c8 to v0.8.2-0-g0664184 using git. After the upgrade gunicorn kept logging "AttributeError: 'AlarmDecoder' object has no attribute 'on_ready_changed'". I had version 0.12.3 of alarmdecode installed which did NOT have the "on_ready_changed" class attribute defined. Running "pip install alarmdecoder --upgrade" resolved the issue by upgrading me to alarmdecoder-1.13.4. The requirements.txt file shows "alarmdecoder>=0.9" which should probably read alarmdecoder>=1.13.4 instead.
I'm not sure which version of alarmdecode introduced "on_ready_changed", but it certainly exists in alarmdecoder-1.13.4.
@f34rdotcom I don't know if there is something I can do to track this down but I'm noticing missed events. At around 7am I see I opened and closed my garage door when I went to work. Perfect. At 7:30 my wife left for work. There is no log of the open/close for the garage door. I do see that she successfully armed the alarm before leaving though. Is there anything I can check to see why the event might have been missed? I've noticed this has happened quite a bit over the last few days.
I have two devices plugged into my USB ports. The FTDI USB Serial Device converter (for ad2usb) and a pl2303 converter (for heyu). When the raspberry pi reboots often these ports switch which ttyUSB they are connected to. I have got around this by creating a linux file /etc/udev/rules.d/49-usb-serial.rules. The rules create a pointer to the correct device, so I end up with /dev/ttyUSB.ad2usb and /dev/ttyUSB.heyu that will point to the correct /dev/ttyUSB0 or /dev/ttyUSB1 device.
A while back you made a change so that I could select /dev/ttyUSB.ad2usb in the setup screen for the device. This continues to work. My issue occurs whenever a reboot occurs, it seems that the database stores the /dev/ttyUSB0 or /dev/ttyUSB1 and not my /dev/ttyUSB.ad2usb selection. I'm not certain of this, as I have not inspected the database. If this is the case, is it possible for you to store my selection in the database?
Every once in a while ad2usb reboots on its own and notifies me, not sure why, so I know to go check it, but it would be nice if I didn't have to go through the setup procedure when the USB ports switch.
I need to send an HTTP GET or POST to a URL in order to trigger my ISY controller. I can do this easily in a browser. The problem is that the ISY requires login using Basic Authentication. Chrome and at least some other browsers can handle this by including the user and password as part of the request, in the form
http://username:[email protected]/ ... 20/runThen
Note the username and password at the front. The 192 address and remainder of the URL is what I need to hit on the ISY. I gather that the browser can take that username and password and make it part of the http basic authentication header. There's more on this at
http://forum.universal-devices.com/topi ... t-request/
The colon between username and password may be confusing the app because a port number usually follows a colon.
I reinstalled and imported my settings using a raspberry pi with a ad2usb plugged into /dev/ttyUSB1 and all is good accept the AlarmDecoder Address Mask is 0 (not ffffffff). I don't think it was directly related to the import, as I have seen this change to zero on occasion when in setup, but haven't been able to identify the behavior that causes it.
I have two usb devices connected to my pi, one on /dev/ttyUSB0 and the other on /dev/ttyUSB1, and the assignment isn't consistent from one reboot to another. So the ad2usb sometimes is /dev/ttyUSB0 and other times /dev/ttyUSB1.
It does not seem to be an issue with Setup -> AlarmDecoder Settings -> Web Address Mask. So there likely is a condition where these are handled differently and AlarmDecoder Address Mask is either never assigned or being assigned to something that doesn't exist? That is just a guess on my part. A further guess would be that it may have to do with the system thinking the ad2usb is located on a port being used for something else.
Before starting nginx for the first time, you must add a new unit file, as described here:
http://serverfault.com/questions/735260/service-nginx-doesnt-work
Gunicorn install should be no newer than 19.9.0 (sudo apt-get install gunicorn=19.9.0-1) and nginx needs to be 1.14.2 (sudo apt-get install nginx=1.14.2-2+deb10u3). Also, pip packages being installed during "sudo pip install -r requirements.txt” installs newer incompatible versions. Comparing versions to pibakery install reveals package versions that can be installed as follows:
sudo pip install babel==2.6.0
Flask-Babel==0.11.2
Flask-Caching==1.7.2
Flask-Login==0.4.1
Flask-Mail==0.9.1
Flask-OpenID==1.2.5
Flask-SQLAlchemy==2.1
Flask-Script==2.0.6
Flask-Testing==0.7.1
Flask-WTF==0.14.2
Flask==1.0.2
Jinja2==2.10
Mako==1.0.7
MarkupSafe==1.1.0
Pygments==2.3.1
SQLAlchemy==1.2.18
Sphinx==1.8.4
WTForms==2.2.1
Werkzeug==0.14.1
alarmdecoder==1.13.4
alembic==1.0.0
argparse==1.2.1
async==0.6.2
blinker==1.4
cffi==1.12.2
cryptography==2.6.1
distribute==0.7.3
docutils==0.14
gevent-socketio==0.3.6
gevent-websocket==0.9.3
gevent==1.1b4
gitdb==0.6.4
greenlet==0.4.15
itsdangerous==0.24
jsonpickle==0.9.5
mock==2.0.0
nose==1.3.7
psutil==5.5.1
pyOpenSSL==19.0.0
python-openid==2.2.5
pytz==2019.1
sh==1.12.14
six==1.12.0
sleekxmpp==1.3.3
smmap==0.9.0
speaklater==1.3
wsgiref==0.1.2
twilio==6.8.2 \
On the AD2PI Network Appliance, I get an exception when using basic authentication. The first few lines of the stack trace show
TypeError
TypeError: encodestring() takes exactly 1 argument (2 given)
Traceback (most recent call last)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 128, in call
return self.app(environ, start_response)
This is 100% repeatable for me. I have a hard coded URL (e.g. 192.168.1.1), a rest command in the path, get, URL encoded, basic auth on, a user name and a password. I do not get the exception when I do not use the basic authentication. .
Added in response to thread at https://www.alarmdecoder.com/forums/viewtopic.php?f=3&t=780&sid=77e9c788c1b45ac19ff35e6f5096af5d&p=3356#p3356
EOL :(
I can see !REL messages coming across the port 10000 telnet port but the notifications are not firing when the relay has changed.
Also, it seems like this notification should be expanded to allow the user to select the relay number and state of the relay to really make this feature functional.
When I enter the installer code at the keypad the log reports the following:
Power status has changed to False.
When I leave programming on the keypad *99 the log reports the following:
Power status has changed to True.
When SSL is enabled and the swagger page is visited by navigating to:
https://alarmdecoder.local/static/swagger/index.html (by following the link from /api)
There are two issues:
The webapp does not detect that SSL is in use and populates wrong URL for the alarmdecoder.json
http://alarmdecoder.local:5000/static/alarmdecoder.json
instead of https://alarmdecoder.local/static/alarmdecoder.json
If the endpoint is manually corrected, the swagger page is shown however the REST APIs cannot be invoked. The Request URL is hard coded to utilize http://alarmdecoder.local:5000/api/v1/alarmdecoder
instead of using the server information relative to the supplied json.
I had accidentally opened this issue on the backend repo, right here: nutechsoftware/alarmdecoder#7
Although it was closed as fixed in the latest release, the new version hasn't made a difference in how the interface looks; it looks identical to the old version and screenshot in the above issue link.
Traceback:
File "/opt/alarmdecoder-webapp/ad2web/settings/views.py", line 717, in system_diagnostics
device_settings['serial'] = current_app.decoder.device.serial_number.upper()
However, in alarmdecoder's decoder.py, serial_number is defined as an int.
Ran the web update for the alarmdecoder-webapp through the browser. Ran for several hours and nothing was happening so I rebooted. Now when I try to load the page I get "Services might still be starting"
When viewing the Log table, either Events or Live, it always defaults back to "10", even when you reload or refresh or whatever. It should retain whatever you have selected for at least as long as you remain on the page. It might also be nice to set a default (10,25,50,100) in the users configuration somewhere.
In README.md in the section describing "Manual Installation," you're missing the line that adds the needed entries in /boot/config.txt. The line that's there now (sudo sed -i '/enable_uart|pi3-miniuart-bt-overlay|force_turbo/d' /boot/config.txt) deletes any previous entries, but fails to insert the proper new entries. From the PiBakery script, I believe this line is missing here:
echo -e '# AlarmDecoder Settings\nenable_uart=1\ndtoverlay=pi3-miniuart-bt-overlay\nforce_turbo=1\n' >> /boot/config.txt
alarmdecoder-webapp/ad2web/upnp.py
Line 66 in 0b754de
If a system exists on the same network with a different subnet it will respond with a UPNP UDP request with a url on the incorrect subnet. the call to selectigd() will stall out trying to complete this HTTP request. I can find no info on the upnp library in regards to a timeout that addresses this issue. I did see someone supply a patch a long time ago to add timeouts to selectigd() but it looks to have stalled.
What is the best way to call this and not block? or to wrap it with a timeout alarm to kill call and prevent the restart and blocking that can take afaik minutes.
Before upgrading the firmware through the webapp's "upload from website" option, the AD2USB worked fine through the webapp. Unfortunately I don't know what the old firmware version was, but I bought the unit recently. Now I can click the buttons in the webapp but nothing happens.
Incoming messages are still displayed just fine.
The webapp does update if I use the physical keypad to change things like the chime status.
Self-diagnostics in the webapp all say they are successful.
Using "screen /dev/ttyUSB0 115200" , incoming messages look fine (though some are incomplete?). I can reboot using '=' and it says "!Sending.done" for other entries, but the alarm panel doesn't register any changes (for example, the chime status doesn't change after I enter + 9).
All physical connections are in place.
Tried all firmware versions available through the webapp, no change. Currently using 2.2a.8.8.
Webapp setup completes successfully using address 18.
I updated the webapp and libraries through the webapp itself.
Says some packages are missing in Python? Pip says that most are present. Haven't updated pip, it's at 8.1.1 as it came in the Raspbian image from the website. Python version 2.7.
System: Raspberry Pi with the image provided on the website. No changes besides expanding the filesystem.
Device: AD2USB
Panel, as identified by the webapp: Honeywell Vista 15P
Panel firmware version, as identified by the webapp: 05.03 04.01
Any help is appreciated!
I’m on iOS latest Safari. The four function keys don’t work when pressing them from this mobile browser. The normal number keys also show absolutely no feedback when you press them, though they still seem to actually work.
When setting up a time restriction with a notification, it currently appears that the time must be entered using GMT. This requirement is not indicated anywhere on the web page. It would be better to use local time, including accounting for daylight savings. If local time is not workable, please add text to the web page to indicate time must be GMT.
Ademco Vista 40, ad2usb, your official Raspberry Pi image.
After upgrading the ad2usb from its as-shipped firmware to 2.2a.8.8, many of our zones are now duplicated in the notifications & event log in web UI.
The second field (the zone ID) in events now sometimes has a "2" instead of a "0", but not always. That is new.
It seems there's some bit of extra info encoded in there now.
Unfortunately, the web app doesn't understand that format and treats the motion detectors as two zones each now: sometimes 016 and sometimes 216. (Likewise for 017/217, 018/218, etc).
Sample log showing a mix of some with a leading 0 and some with a leading 2:
[10000001000000003A--],216,[f71f80001016801c080200002a2a20],"****DISARMED**** READY TO ARM "
[10000001000000003A--],216,[f71f80001016801c080200002a2a20],"****DISARMED**** READY TO ARM "
[10000001000000003A--],216,[f71f80001016801c080200002a2a20],"****DISARMED**** READY TO ARM "
[10000001000000003A--],216,[f71f80001016801c08020000020000],"****DISARMED**** READY TO ARM "
[00000001000000000A--],216,[f71f80001016800008020000020000],"FAULT 16 FAMILY ROOM MOTION "
[00000001000000000A--],217,[f71f80001017800008020000020000],"FAULT 17 HALL MOTION "
[00000001000000003A--],217,[f71f80001017800c08020000020000],"****DISARMED**** ZONES FAULTED "
[10000001000000003A--],017,[f71f80001017801c08020000000000],"****DISARMED**** READY TO ARM "
[10000001000000003A--],217,[f71f80001017801c080200002a2a20],"****DISARMED**** READY TO ARM "
[00000001000000000A--],119,[f71f80001019800008020000592052],"FAULT 19 FRONT DOOR MOTION "
[00000001000000003A--],019,[f71f80001019800c0802000020204d],"****DISARMED**** ZONES FAULTED "
[00000001000000000A--],218,[f71f800010188000080200002a2a20],"FAULT 18 NOOK MOTION "
[10000001000000003A--],218,[f71f80001018801c080200002a2a20],"****DISARMED**** READY TO ARM "
[00000001000000000A--],218,[f71f80001018800008020000020000],"FAULT 18 NOOK MOTION "
[00000001000000000A--],219,[f71f80001019800008020000020000],"FAULT 19 FRONT DOOR MOTION "
[00000001000000003A--],219,[f71f80001019800c08020000020000],"****DISARMED**** ZONES FAULTED "
[10000001000000003A--],219,[f71f80001019801c08020000020000],"****DISARMED**** READY TO ARM "
[10000001000000003A--],019,[f71f80001019801c08020000000000],"****DISARMED**** READY TO ARM "
[00000001000000000A--],016,[f71f8000101680000802000020204d],"FAULT 16 FAMILY ROOM MOTION "
[00000001000000000A--],017,[f71f80001017800008020000202044],"FAULT 17 HALL MOTION "
[10000001000000003A--],217,[f71f80001017801c080200002a2a20],"****DISARMED**** ZONES FAULTED "
[10000001000000003A--],217,[f71f80001017801c080200002a2a20],"****DISARMED**** READY TO ARM "
The Python library & web app are current as of 2017-11-25.
/cc @kellyfitzy
It looks like the date field is missing from notification email headers, and that confused some new email security measures we've put in place. I'll make a pull request to fix that.
The manual instructions do not include setup of unicorn for systemd yet instruct you to start it with the service command.
The proper setup is described here http://docs.gunicorn.org/en/stable/deploy.html
Loading the web app brings up
Services starting message.
Page is titled 503 bad gateway
Services might still be starting - please wait and try again. If this continues, please let us know on GitHub. You can also email us at Support.
Timestamp on email notifications are always suppressed even with checkbox unchecked. Forum discussion here
I have a AD2PI recently purchased. This is working fine with Home assistant. I am trying to intergate a few 433mhz sensors and have them enabled by an automation that detects when the Alarm panel is armed. The automation does not work.
Do you have any idea what could be the issue. Here is the code for the automation. I have tried also to trigger it on the state of the alarm panel rather than the "READY" attribute. Neither one will work.
- id: '1611450843281'
alias: Enable 433mhz alarms from AD2pi
description: ''
trigger:
- platform: state
to: 'false'
from: 'true'
entity_id: alarm_control_panel.alarm_panel
attribute: ready
condition: []
action:
- condition: state
state: 'on'
entity_id: input_boolean.alarm_enable
mode: single
Having an issue with notifications - email and send to Smartthings. After a while they stop sending and I see messages like this in the logs with the numbers climbing.
I am guessing ST stops responding and the notification never cancels out and so it just gets stuck adding on and after the first stops the rest get queued?
2020-07-08 18:31:38,376 INFO: Background notification functions running 1717. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-07-08 18:31:43,491 INFO: Background notification functions running 1717. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-07-08 18:31:48,538 INFO: Background notification functions running 1717. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
2020-07-08 18:31:53,585 INFO: Background notification functions running 1717. [in /opt/alarmdecoder-webapp/ad2web/notifications/types.py:438]
Per my forum post, I'm trying to set up Twilio notifications with the AD webapp. When I complete the setup and click the Save & Test button, I get this error flashed at the top of the page:
Error sending test notification: 'module' object has no attribute 'TwilioRestException'
Doing a little digging, I think the error is coming from this line of code. Here's that line plus the two following it:
except twilio.TwilioRestException as e:
current_app.logger.info('Event Twilio Notification Failed: {0}' . format(e))
raise Exception('Twilio Notification Failed: {0}' . format(e))
Looking at the twilio-python library code at the version used by AD, it appears that the class being referenced should be twilio.rest.TwilioRestException
and not twilio.TwilioRestException
. If this is true, then this is a syntax error, which is swallowing the actual error from Twilio library.
But this code hasn't changed in the AD codebase for over 4 years. I'm finding it hard to believe I'm the only one who's stumbled upon this issue. The other "issue" is that the version of the twilio-python library itself is four years old (current version is 6.22.1
and the one in AD is 3.7.3
). It hasn't changed since the initial Twilio SMS support commit.
This seems like a good opportunity for me to tinker and submit a PR that fixes the issue and perhaps updates the Twilio library. But I'd love some feedback first to make sure I'm not chasing a red herring.
My Alarmdecoder smartapp and devices stopped working last week.
I reinstalled the Alarmdecoder webapp and firmware (2.2a.8.8) on the Raspberry PI. I have installed the Smartapp (Version 2.0.3) and I tried to install the Alarm Decoder service for my Location.
I get the following errors
d7addcab-9edf-4625-9305-cb40d07db275 10:53:50 PM: error armStaySet: Could not find 'armStay' device.
d7addcab-9edf-4625-9305-cb40d07db275 10:53:50 PM: error armAwaySet: Could not find 'armAway' device.
When I cannot get the Smartthing app to sync with the Alarmdecoder. If I arm using Web panel keyboard or physical keyboard, it is not reflected in the smartapp and vice versa. What changed?
Noticing the following exception whenever I poll sensor events from my AD2USB (2.0) flooding /var/log/daemon.log:
Apr 29 14:50:19 alarmdecoder gunicorn[384]: Exception in thread Thread-472:
Apr 29 14:50:19 alarmdecoder gunicorn[384]: Traceback (most recent call last):
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self.run()
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/devices/base_device.py", line 148, in run
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self._device.read_line(timeout=self.READ_TIMEOUT)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/devices/socket_device.py", line 356, in read_line
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self.on_read(data=ret)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/event/event.py", line 84, in fire
Apr 29 14:50:19 alarmdecoder gunicorn[384]: func(self.obj, *args, **kwargs)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 1041, in _on_read
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self._handle_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 439, in _handle_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]: msg = self._handle_keypad_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 477, in _handle_keypad_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]: msg = Message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/messages/panel_message.py", line 85, in __init__
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self._parse_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/messages/panel_message.py", line 121, in _parse_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]: self.system_fault = int(self.bitfield[17], 16)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: ValueError: invalid literal for int() with base 16: '-'
In conjunction with this but really any event that produces noise on the AD2USB device.
!VER:00000436,V2.1f.10,TX;RX;SM;VZ;RF;ZX;PE;RE;AU
[000100010000--------],001,[f70000071001000008020000000000],"FAULT 01 FRONT DOOR
Also, not sure if this is a related issue I notice this randomly pop-up time to time after clicking around in the webapp within the same context of the aforementioned observations
Apr 29 14:44:53 alarmdecoder gunicorn[384]: 127.0.0.1 - - [2020-04-29 14:44:53] "GET /static/img/spinner.gif HTTP/1.1" 200 1094 0.149828
Apr 29 14:44:53 alarmdecoder gunicorn[384]: 127.0.0.1 - - [2020-04-29 14:44:53] "GET /static/img/spinner.gif HTTP/1.1" 200 1094 0.140137
Apr 29 14:44:54 alarmdecoder gunicorn[384]: Exception in thread Thread-404:
Apr 29 14:44:54 alarmdecoder gunicorn[384]: Traceback (most recent call last):
Apr 29 14:44:54 alarmdecoder gunicorn[384]: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Apr 29 14:44:54 alarmdecoder gunicorn[384]: self.run()
Apr 29 14:44:54 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/devices/base_device.py", line 148, in run
Apr 29 14:44:54 alarmdecoder gunicorn[384]: self._device.read_line(timeout=self.READ_TIMEOUT)
Apr 29 14:44:54 alarmdecoder gunicorn[384]: File "/opt/alarmdecoder/alarmdecoder/devices/socket_device.py", line 323, in read_line
Apr 29 14:44:54 alarmdecoder gunicorn[384]: read_ready, _, _ = select.select([self._device], [], [], 0.5)
Apr 29 14:44:54 alarmdecoder gunicorn[384]: File "/usr/local/lib/python2.7/dist-packages/gevent/select.py", line 77, in select
Apr 29 14:44:54 alarmdecoder gunicorn[384]: raise error(*ex.args)
Apr 29 14:44:54 alarmdecoder gunicorn[384]: error: (9, 'Bad file descriptor')[/code]
ref commit 1c5e5c3, this looks to have broken the send api as KEY_S1 isn't defined on the AlarmDecoder object, calling the function results in the following exception
AttributeError: type object \'AlarmDecoder\' has no attribute \'KEY_S1\'
File "/opt/alarmdecoder-webapp/ad2web/api/views.py",\n line 213,\n
in alarmdecoder_send keys = keys.replace("<S1>", AlarmDecoder.KEY_S1 )
After setting a static ip address multiple lines of configuration are written to /etc/network/interfaces file but the /etc/dhcpcd.conf is not touched on raspbian. This results in no change in network configuration.
This is what is needed at the end of /etc/dhcpcd.conf
interface eth0
static ip_address=1.2.3.4/24
static routers=1.2.3.4
static domain_name_servers=1.2.3.4
Regarding line 1049 of alarmdecoder-webapp/ad2web/notifications/types.py:
auth_string = base64.encodestring(auth_string)
Should base64.encodestring be changed to base64.b64encode ?
Reason: In using WebApp for a custom notification, I receive the following error message:
"Error sending test notification: Invalid header value 'Basic Y...w==\n'".
[Note that I inserted ... above is to avoid revealing my authorization credentials.]
A blog unrelated to AlarmDecoder identifies the following cause for a similar error ("ValueError: Invalid header value 'Basic T...4=\n'"):
"You can't have a new line character \n at the end of your header. Instead of using base64.encodestring, use base64.b64encode."
(see https://stackoverflow.com/questions/39874351/basic-authentication-error-with-urllib2-since-python-2-7-update )
Various sites claim that base64.encodestring "returns a string containing one or more lines of base64-encoded data always including an extra trailing newline (‘\n’)".
This newline character might be the cause of the error message that I receive.
FYI, I receive this error message when using the 2018-10-14 Raspbian Stretch image from https://www.alarmdecoder.com/wiki/index.php/Raspberry_Pi on a Raspberry Pi3B+. I also updated WebApp and received the same error message. I do NOT receive that error message when using the 2018-05-29 Raspbian Jessie 8.0 image from the same website.
Thanks!
When initializing the db with sudo python manage.py initdb
, I get the error
Traceback (most recent call last):
File "manage.py", line 9, in <module>
from flask.ext.script import Manager, Command
ImportError: No module named ext.script
The flask extensions have changed from using flask.ext.script
to flask_script
naming scheme.
Software updates alert only shows if the API is out of date. It does not seem to show if the web portion is behind? I used a stock image and after setup applied the patches to the API and clicked the restart leaving the WEB portion behind and needing update. After reconnecting the update screen was gone and reported no more updates were needed. Console access shows the WEB is still behind master.
It would be nice to have the App log display in descending time order, just like how the Events log is displayed.
I know the App log is a live refresh - but think it is doable.
I jumped the gun a little. User error. I had set something up improperly on my end. Sorry about the misreporting.
I'm using version 7e17a5de770c066d047937558631afd40bd46151
and went through setup again. I'm using ser2sock with encryption. As an aside, I have to manually add the cert records to the initialized DB via sqlite every time I start fresh. It seems that the webapp expects those records to exist in order to update them (sqlalchemy .one()
method)
After completing setup, the webapp attempts to test the device and displays the following:
Opening device ✘ Failed to open the device: list.remove(x): x not in list
Saving device configuration ✘ There was an error sending the command to the device.
Keypad communication (Send) ✘ There was an error sending the command to the device.
Keypad communication (Receive) ✘ There was an error sending the command to the device.
I've verified that ser2sock is working properly with encryption using openssl s_client
. There seems to be an issue either setting the config or in the test routines.
alarmdecoder-webapp version: 7e17a5de770c066d047937558631afd40bd46151
alarmdecoder version: 914bf6388fb23cb77f5b522cfb61a3549657407a
When launching the googletalk notification setup, the form is not retaining or displaying any "notify on.." selections.
notification/forms.py
class GoogleTalkNotificationForm(EditNotificationForm):
def populate_settings(self, settings, id=None):
def populate_from_settings(self, id):
both missing "EditNotificationForm.populate_from_settings(self, id)" ?
Finally got communication working good with Alarmdecoder on Raspberry and DSC alarm. :D
Figured out through trial and error, and support how to get the correct settings done on Windows PC AlarmDecoder Keypad app and the webbapp (via browser)
Got most working , however for some reason the AlarmDecoder WebApp Keypad stopped working. 😢
Now when trying to bring it up in a browser, I get 502 Bad Gateway , error.
"Services might still be starting - please wait and try again. If this continues, please let us know on GitHub. You can also email us at Support."
I tried restarting the Raspberry Pi- & manually restarting the services (nginx & Gunicorn) that seem to restart properly. But still get 502 error.
Restated services without a problem. (Maybe there is another service I am missing)
pi@alarmdecoder /opt/alarmdecoder-webapp $ sudo service nginx restart
Restarting nginx: nginx.
pi@alarmdecoder /opt/alarmdecoder-webapp $ sudo service gunicorn restart
[ ok ] Stopping Gunicorn workers: [alarmdecoder].
[ ok ] Starting Gunicorn workers: [alarmdecoder].
Communication is good because I can communicate with Windows AlarmDecoder app.
I tried manually installing the webapp from github, and still same issue.
The reboot goes through, but the page immediately redirects to this error page. This is the copy/paste friendly version of the traceback:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 95, in __call__
return self.app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 792, in decorated_view
return func(*args, **kwargs)
File "/opt/alarmdecoder-webapp/ad2web/decorators.py", line 16, in decorated_function
return f(*args, **kwargs)
File "/opt/alarmdecoder-webapp/ad2web/settings/views.py", line 233, in system_reboot
sh.reboot()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1021, in __call__
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 486, in __init__
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 500, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 516, in handle_command_exit_code
raise exc(self.ran, self.process.stdout, self.process.stderr)
ErrorReturnCode_143:
RAN: '/usr/bin/sudo /sbin/reboot'
STDOUT:
STDERR:
ERROR: Exception in notification UPNPPushNotification.send(): StandardError("BadStatusLine('No status line received - the server has closed the connection',) line 657",) line 544 [in /opt/alarmdecoder-webapp/ad2web/decoder.py:459]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.