install problems alarmdecoder-webapp on MacOS - python 2.7

General Discussion

install problems alarmdecoder-webapp on MacOS - python 2.7

Postby sddreiter » Tue Sep 02, 2014 7:35 am

I am running through the setup of the alarmdecoder webapp and have installed nginx and gunicorn.
I have cloned the git repo of the alarmdecoder-webapp
I have done the pip install of the requirements.txt (with the exception of pyftdi which I had to change the version to 0.6.3 since it couldn't find 0.9.0) Here is the error for that before I changed the version to 0.6.3
Downloading/unpacking pyftdi==0.9.0 (from -r requirements.txt (line 41))
Could not find a version that satisfies the requirement pyftdi==0.9.0 (from -r requirements.txt (line 41)) (from versions: 0.4.5, 0.5.1, 0.5.2, 0.6.3)

But now when I try to do the python manage.py initdb I get these errrors:
/opt/local/lib/python2.7/site-packages/pytz/__init__.py:29: UserWarning: Module argparse was already imported from /opt/local/lib/python2.7/argparse.pyc, but /opt/local/lib/python2.7/site-packages is being added to sys.path
from pkg_resources import resource_stream
Traceback (most recent call last):
File "manage.py", line 12, in <module>
from ad2web import create_app
File "/opt/alarmdecoder-webapp/ad2web/__init__.py", line 3, in <module>
from app import create_app
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 18, in <module>
from .decoder import decodersocket, Decoder, create_decoder_socket
File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 23, in <module>
from .notifications import NotificationSystem
File "/opt/alarmdecoder-webapp/ad2web/notifications/__init__.py", line 4, in <module>
from .views import notifications
File "/opt/alarmdecoder-webapp/ad2web/notifications/views.py", line 8, in <module>
from ..settings import Setting
File "/opt/alarmdecoder-webapp/ad2web/settings/__init__.py", line 4, in <module>
from .views import settings
File "/opt/alarmdecoder-webapp/ad2web/settings/views.py", line 38, in <module>
from sh import hostname, service, sudo
ImportError: cannot import name service
Exception KeyError: KeyError(4324532784,) in <module 'threading' from '/opt/local/lib/python2.7/threading.pyc'> ignored

Any ideas what I might be doing wrong? Thanks in advance
sddreiter
newt
newt
 
Posts: 4
Joined: Tue Sep 02, 2014 7:08 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby kevin » Tue Sep 02, 2014 9:22 am

This is an error on our end, being there is no command named 'service' on mac osx, we will have to do a fix for that

In the meantime, you can remove the service import and you'll likely be ready to go. Will just have to abandon changes to update from our git when we push a fix.

In /opt/alarmdecoder-webapp/ad2web/settings/views.py remove anything to do with the command 'service' - or just wait for us to push up a fix
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby Scott » Tue Sep 02, 2014 10:52 am

Just wanted to make a note that you do need pyftdi 0.9.0 if you're running the USB version of the AlarmDecoder. It won't detect correctly otherwise.

You can get it directly from github by running:
Code: Select all
sudo pip install https://github.com/eblot/pyftdi/archive/v0.9.0.tar.gz#egg=pyftdi-0.9.0


You wouldn't normally have to worry about it, but i mistakenly left pyftdi in the webapp's requirements instead of just allowing the alarmdecoder library to take care of it.
Scott
Expert Nut
Expert Nut
 
Posts: 118
Joined: Thu Dec 12, 2013 11:17 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby sddreiter » Tue Sep 02, 2014 11:31 am

I did the pip install of the pyftdi-0.9.0 and that seemed to go fine.
I removed the services in the import and I did get farther. But now I get this error:

/opt/local/lib/python2.7/site-packages/pytz/__init__.py:29: UserWarning: Module argparse was already imported from /opt/local/lib/python2.7/argparse.pyc, but /opt/local/lib/python2.7/site-packages is being added to sys.path
from pkg_resources import resource_stream
Traceback (most recent call last):
File "manage.py", line 16, in <module>
app, appsocket = create_app()
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 74, in create_app
decoder = Decoder(app, appsocket)
File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 72, in __init__
self.updater = Updater()
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 20, in __init__
self._components['webapp'] = SourceUpdater('webapp')
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 81, in __init__
self._enabled, self._status = self._check_enabled()
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 253, in _check_enabled
remote_okay = self._check_remotes()
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 276, in _check_remotes
name, path = r.split("\t")

It looks like it is trying to parse some file (config?) but I can't tell which one. I don't see anything in the README about setting up any config files except for gunicorn and nginx. Do I need to modify some config file or did my removal of the services import mess something up?
sddreiter
newt
newt
 
Posts: 4
Joined: Tue Sep 02, 2014 7:08 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby kevin » Thu Sep 04, 2014 9:22 am

Did you happen to check this out from the github repository or use the zip file?
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby sddreiter » Thu Sep 04, 2014 11:00 am

I was using a git checkout. It looks like it is having an issue with the gitdb call. So I just set the status to False and now the initdb command does work. Here is the git diff of what I did to bypass the error:

git diff
diff --git a/ad2web/settings/views.py b/ad2web/settings/views.py
index b7be4da..17d12b6 100644
--- a/ad2web/settings/views.py
+++ b/ad2web/settings/views.py
@@ -35,7 +35,7 @@ from .constants import NETWORK_DEVICE, SERIAL_DEVICE, EXPORT_MAP, HOSTS_FILE, HO
from ..certificate import Certificate, CA, SERVER
from ..notifications import Notification, NotificationSetting
from ..zones import Zone
-from sh import hostname, service, sudo
+from sh import hostname, sudo

settings = Blueprint('settings', __name__, url_prefix='/settings')

diff --git a/ad2web/updater/models.py b/ad2web/updater/models.py
index a655165..675da4c 100644
--- a/ad2web/updater/models.py
+++ b/ad2web/updater/models.py
@@ -249,8 +249,12 @@ class SourceUpdater(object):

:returns: Whether or not this component is enabled.
"""
+ git_available = False
+ remote_okay = False
+ """
git_available = self._git is not None
remote_okay = self._check_remotes()
+ """

status = ''
if not git_available:


Now I am running into a problem when I connect to the webapp. Here are the coomands I needed to do to get nginx and gunicorn running on the mac:
/opt/local/bin/gunicorn --log-file /tmp/unicorn.log -D --chdir /opt/alarmdecoder-webapp --worker-class=socketio.sgunicorn.GeventSocketIOWorker wsgi:application --timeout=120 -b '127.0.0.1:5000'
/usr/local/sbin/nginx

Once I did that I was able to login and it tried to run me through the setup. It got to a point where it gave me a pulldown for the device but the pulldown did not have any devices and I could not enter it manually. I thought maybe I could enter/change it later so I clicked next and it had me create an account but now when I try to login with the account I get an internal server error.
sddreiter
newt
newt
 
Posts: 4
Joined: Tue Sep 02, 2014 7:08 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby kevin » Thu Sep 04, 2014 11:09 am

Yeah, this is a reported bug that we are working on with selection of USB devices. Hopefully in the next few days we'll have a revision up that will fix these issues. Sorry for the trouble.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby sddreiter » Thu Sep 04, 2014 11:33 am

Kevin,
Thanks for the info - glad it is not something I was doing wrong. I there a way I can update the conf from the command line? Where does it store that information? If not I"ll just wait till the app is updated. Thanks for all your help.
sddreiter
newt
newt
 
Posts: 4
Joined: Tue Sep 02, 2014 7:08 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby kevin » Thu Sep 04, 2014 11:38 am

Unfortunately not - you need access to the database

If you are sharing the connection you can try the ser2sock.conf in /etc/ser2sock
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: install problems alarmdecoder-webapp on MacOS - python 2

Postby kevin » Fri Sep 05, 2014 10:52 am

I have pushed a fix for better detection and selection of USB devices to our local git server. When Scott can test and merge, it should be in our public repository before too long.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 51 guests

cron