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

Install instructions update for Ubuntu 14.04 #6

Open
mday299 opened this issue May 13, 2014 · 11 comments
Open

Install instructions update for Ubuntu 14.04 #6

mday299 opened this issue May 13, 2014 · 11 comments

Comments

@mday299
Copy link

mday299 commented May 13, 2014

Howdy.

I tried to the developer install on Ubuntu 14.04 today. Install instructions are (understandably) possibly slightly incorrect as they are likely intended for older versions of Ubuntu.

I tried 'pip -r ./afterflight/requirements.txt'

and pip informed me one cannot run '-r' with pip.

So I tried the install incantation I use with MAVProxy and MAVLink:

python setup.py build install --user

This appeared to work and a LOT of text went by. :)

I setup the sqllite database fired up the server as instructed. This also appeared to work.

I pointed my browser at localhost:8000 and that also worked. However, when I attempt to login I get a page stating:

BEGIN

ImproperlyConfigured at /accounts/login/

No Facebook app configured: please add a SocialApp using the Django admin

Request Method: GET
Request URL: http://localhost:8000/accounts/login/
Django Version: 1.6.4
Exception Type: ImproperlyConfigured
Exception Value:

No Facebook app configured: please add a SocialApp using the Django admin

Exception Location: /home/maday/.local/lib/python2.7/site-packages/django_allauth-0.16.1-py2.7.egg/allauth/socialaccount/providers/facebook/provider.py in media_js, line 106

END

There is more on the error page if you'd like, but that's probably sufficient for this post.

Help?

Thanks,

Michael

@foobarbecue
Copy link
Owner

Hi Michael, that particular error comes from django-allauth, which AfterFlight uses for authentication. You need to set up django-allauth with something like Facebook or Github authentication through the admin backend. If you go to http://localhost:8000/admin, can you log in to the backend? You need create a facebook app on their app developer page or equivalent at another auth provider ( https://github.com/pennersr/django-allauth ) and then enter the API key data into the backend. Another option is that you might be able to just remove django-allauth from your settings.py for the time being if you don't need to authenticate users with a service like Facebook. I'm not sure if that will break things. As I write this I'm vaguely remembering something about needing a database entry in the "sites" app before allauth will work. I'll try to find time tomorrow to do a fresh AfterFlight install and maybe see if I can simplify things. I've ignored AfterFlight for far too long now because of my new project, Climbshare, but maybe you've inspired me to get back to it.

@mday299
Copy link
Author

mday299 commented May 14, 2014

Thanks for responding so quickly,

I tried removing all allauth lines in the settings.py file (I don't really care about authentication, nor do I want to set something up on Facebook or Github, this thing local to my machine). That resulted in a server error when trying to access the main page (though the admin page still works). I re-enabled the allauth modules and the error persists. I'm a bit confused.

The error is:

ConnectionError at /

Error 111 connecting localhost:6379. Connection refused.

Environment:

Request Method: GET
Request URL: http://localhost:8000/ConnectionError at /

Error 111 connecting localhost:6379. Connection refused.

Django Version: 1.6.4
Python Version: 2.7.6
Installed Applications:
('cacheops',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'logbrowse',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.google',
'django.contrib.admin',
'progressbarupload',
'fluent_comments',
'crispy_forms',
'django.contrib.comments',
'debug_toolbar')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')

Traceback:
File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/views.py" in flight_index
  2.             {"start":flight.start_time().isoformat(),
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/models.py" in start_time
  3.     return fltdata.start_time(self)
    
    File "/home/maday/.local/lib/python2.7/site-packages/django_cacheops-1.3.1-py2.7.egg/cacheops/simple.py" in wrapper
  4.                 result = self.get(cache_key)
    
    File "/home/maday/.local/lib/python2.7/site-packages/django_cacheops-1.3.1-py2.7.egg/cacheops/simple.py" in get
  5.     data = self.conn.get(cache_key)
    
    File "/home/maday/.local/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg/redis/client.py" in get
  6.     return self.execute_command('GET', name)
    
    File "/home/maday/.local/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg/redis/client.py" in execute_command
  7.         connection.send_command(*args)
    
    File "/home/maday/.local/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg/redis/connection.py" in send_command
  8.     self.send_packed_command(self.pack_command(*args))
    
    File "/home/maday/.local/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg/redis/connection.py" in send_packed_command
  9.         self.connect()
    
    File "/home/maday/.local/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg/redis/connection.py" in connect
  10.         raise ConnectionError(self._error_message(e))
    

Exception Type: ConnectionError at /
Exception Value: Error 111 connecting localhost:6379. Connection refused.

@foobarbecue
Copy link
Owner

Ok, this time you're having trouble with redis, which is the (server-side) in-memory caching library. You probably need to start the redis server manually. I'm trying out an afterflight install from a clean slate now.

@foobarbecue
Copy link
Owner

Could you try installing redis, either using apt-get install redis-server or following http://redis.io/topics/quickstart , and then let me know if you have further errors?

@mday299
Copy link
Author

mday299 commented May 15, 2014

Thanks again for the quick respose!

*********** EDIT: I attempted to attach a dataflash file that won't work with Afterflight. I can't attach files except images. Is there a place I could send it to?

Installing redis-server solved that issue. Got a couple more for you now. :)

The instructions state that dataflash logs are better supported than Mission Planner tlogs. I have attempted to upload dataflash logs from ArduPlane 3.0.2beta. No joy. I get an error:

('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')

Traceback:
File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/generic/base.py" in view
  2.         return self.dispatch(request, _args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/utils/decorators.py" in _wrapper
  3.         return bound_func(_args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/contrib/auth/decorators.py" in _wrapped_view
  4.             return view_func(request, _args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/utils/decorators.py" in bound_func
  5.             return func(self, _args2, *_kwargs2)
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/views.py" in dispatch
  6.     return super(FlightCreate, self).dispatch(_args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/generic/base.py" in dispatch
  7.     return handler(request, _args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/generic/edit.py" in post
  8.     return super(BaseCreateView, self).post(request, _args, *_kwargs)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/generic/edit.py" in post
  9.         return self.form_valid(form)
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/views.py" in form_valid
  10.     return super(FlightCreate, self).form_valid(form)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/generic/edit.py" in form_valid
  11.     self.object = form.save()
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/forms/models.py" in save
  12.                          construct=False)
    
    File "/home/maday/.local/lib/python2.7/site-packages/Django-1.6.4-py2.7.egg/django/forms/models.py" in save_instance
  13.     instance.save()
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/models.py" in save
  14.     self.read_log()
    
    File "/home/maday/dev/afterflight/afterflight/logbrowse/models.py" in read_log
  15.         fr_flight=flyingrhino.flight(logfile_path, messaging=self.set_processing_state)
    
    File "/home/maday/.local/lib/python2.7/site-packages/flyingrhino-0.1.2-py2.7.egg/flyingrhino/init.py" in init
  16.     week_epoch=utils.logpath2dt(dflog_path)
    
    File "/home/maday/.local/lib/python2.7/site-packages/flyingrhino-0.1.2-py2.7.egg/flyingrhino/utils.py" in logpath2dt
  17.     outtime=re.findall('\d{4}(?:-\d\d){4}',outtime)[0]
    

Exception Type: IndexError at /upload
Exception Value: list index out of range

This is now a rather long post, so I'll put the other issue in a separate post.

@mday299
Copy link
Author

mday299 commented May 15, 2014

Note that I am unable to attach any files except images to these posts. Is there a place I could send the dataflash file in question to you? Are you e.g., on DIYDrones.com and I could msg you there?

So, I am able to successfully upload tlogs from MAVProxy.

After the upload the page layout looks nothing like it does on your afterflight web site. I'm attaching screen shots. I also can't get the graph plot or time line to work.

Thanks ahead of time,

Michael
pagetop
pagebottom

@foobarbecue
Copy link
Owner

@mday299, I'm http://diydrones.com/profile/AaronCurtis , feel free to ping me there. Looks like it isn't displaying properly because it can't find your .css files. This has to do with the lines

         url(r'^(media)/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT, 'show_indexes':True
        }),

In urls.py, which serve the files during development. That part is working fine on my install. I see that I've hard-coded it to look for the .css at /media/css/ . If you go to http://localhost:8000/media/ , do you see a directory listing?

As for the 3.0.x dataflash log not working, that will be because I haven't done any work on afterflight since 2.6 and I guess the format has changed. I also have never tried it with Pixhawk or PX4 logs. I just started a new issue for that: #7

Thanks for your patience; it's very helpful for me have you testing this.

@mday299
Copy link
Author

mday299 commented May 15, 2014

Wow, that was one fast reply. Thanks for you attention!

The directory listing for /media only has a "logs" folder in it. No css folder. Could be because of the rather unconventional install I've had to do.

Yeah, my planes are all flying PX4 or Pixhawk, that's possibly another confounding factor with the dataflash log upload.

@mday299
Copy link
Author

mday299 commented May 15, 2014

Aaron,

I posted the dataflash log attached to a comment on your wall at diydrones.com

See here:

http://diydrones.com/profile/AaronCurtis

@mday299
Copy link
Author

mday299 commented May 16, 2014

Based on your previous comment, I hunted around for the css folder. I found it in the afferflight/media folder. I found that if I do something different than what the developer instructions say and run the server out of the afterflight folder instead of its parent folder the css works, and the map and the plots start working.

So, looks like just some tweaking of the developer instructions might solve most of this.

Awesome!

@foobarbecue
Copy link
Owner

Hi Michael, glad you got it working. I edited the readme in 7a5cd4a -- did I get it right? Would love it if you could fix it up some more and submit a pull request. Really need to simplify the install process but documenting it correctly would be a good start.

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

No branches or pull requests

2 participants