Code Monkey home page Code Monkey logo

ammcon-frontend's People

Contributors

ammgws avatar wnndgws avatar

Watchers

 avatar  avatar

ammcon-frontend's Issues

bug where moment.js overwrites DOM

Current usage of moment.js involves using document.write to add the below javascript to the page:
<script>\ndocument.write(moment(\"%s\").%s);\n</script>

However calling document.write() on a closed document stream (i.e. after page is loaded) automatically calls document.open(), which will clear the DOM (source) and results in pages only displaying the result of the moment.js script above when using jQuery Mobile's AJAX page loads.

How to reproduce issue:

  1. Go to AmmCon main page
  2. Open graphs using the side panel
  3. Refresh the page (necessary in order to force AJAX page load of index page)
  4. Click on the link to go back to the main page

When page is overwritten:
image
When page loads correctly:
image

Log to stdout as well

Enabling logging to file seems to have disabled it printing to stdout.
Would like to find a way to have both.

(non) responsiveness during first startup

When first opening up the web app, the JS code updates each of the room temperatures one after the other, however during this time you cannot submit any commands and must wait until it's done first.

Need to change it so that the temperatures are updated in the background. Callbacks? Threading somehow?

Error when refresh token is invalid

Need to add handling for this case

Traceback (most recent call last):
  File "ammcon.py", line 864, in <module>
    main(args)
  File "ammcon.py", line 836, in main
    server = _AmmConSever(args.mode, args.config_path)
  File "ammcon.py", line 454, in __init__
    access_token = self.authenticate(config_path)
    refresh_token)
  File "ammcon.py", line 807, in google_refresh
    access_token = values['access_token']
KeyError: 'access_token'

White line at top of profile

When I am logged into ammcon, when i click the hamburger to bring out the slider, at the top of the site there is a tiny white border. It drives me insane. Pls correct asap
2017-03-03-16 42 40

Setup simple web UI, defer Hangouts to debug/messaging

Hangouts app on Android is too buggy lately (random delays before sending messages / etc.)
Plus tedious to send commands and teach others in the household how to use them.
Hence should set up simple web UI using Flask/whatever and use that as the main interface for Ammcon.
Can then use Hangouts for debugging purposes or sending one-off messages.

SleekXMPP reconnect workaround

Error using workaround in latest commit :

2016-07-29 02:09 sleekxmpp.xmlstream.xmlstream DEBUG Event triggered: connected
2016-07-29 02:09 sleekxmpp.xmlstream.xmlstream ERROR Error processing event handler: None
Traceback (most recent call last):
File "/home/xxx/py3env-ammcon/lib/python3.2/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1173, in event
handler0
TypeError: 'NoneType' object is not callable
2016-07-29 02:09 sleekxmpp.basexmpp ERROR 'NoneType' object is not callable
Traceback (most recent call last):
File "/home/xxx/py3env-ammcon/lib/python3.2/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1173, in event
handler0
TypeError: 'NoneType' object is not callable

Commands timeout

  • Seems to have started after a new user logged in and issued a command.
  • Gunicorn seems to reboot worker before it gets to the response = socket.recv() line.
  • Gunicorn worker timeout currently set to 30seconds.
  • Either serialmanager thread is dead/taking too long or the request is just taking too long
  • Serialmanager log stops at 18:00 so seems like it has died...

gunicorn log:

[2017-03-03 17:41:39 +0900] [1099] [DEBUG] GET /
[2017-03-03 17:59:12 +0900] [1099] [DEBUG] GET /login
[2017-03-03 17:59:18 +0900] [1099] [DEBUG] GET /authorize/google
[2017-03-03 17:59:18 +0900] [1099] [DEBUG] GET /callback/google
[2017-03-03 17:59:22 +0900] [1099] [DEBUG] GET /
[2017-03-03 17:59:29 +0900] [1099] [DEBUG] GET /command
[2017-03-03 17:59:59 +0900] [474] [CRITICAL] WORKER TIMEOUT (pid:1099)
[2017-03-03 18:00:00 +0900] [1099] [INFO] Worker exiting (pid: 1099)
[2017-03-03 18:00:01 +0900] [3861] [INFO] Booting worker with pid: 3861
[2017-03-03 18:00:02 +0900] [3861] [DEBUG] GET /command
[2017-03-03 18:00:32 +0900] [474] [CRITICAL] WORKER TIMEOUT (pid:3861)
[2017-03-03 18:00:32 +0900] [3861] [INFO] Worker exiting (pid: 3861)
[2017-03-03 18:00:33 +0900] [3884] [INFO] Booting worker with pid: 3884
[2017-03-03 18:00:33 +0900] [3884] [DEBUG] GET /command
[2017-03-03 18:01:04 +0900] [474] [CRITICAL] WORKER TIMEOUT (pid:3884)

flask log:

2017-03-03 15:02:47.413 ammcon_frontend INFO     Command "living1 off" received. Sending message: b'\xb4\x00' (views.py:146)
2017-03-03 15:02:47.427 ammcon_frontend INFO     ############### Connected to zeroMQ server ############### (views.py:154)
2017-03-03 15:02:47.539 ammcon_frontend INFO     Response received: ['0x3c', '0x6', '0xb4', '0x0', '0xff', '0xc1', '0x3e'] (views.py:171)
2017-03-03 15:02:47.545 ammcon_frontend INFO     Finished handling command request. (views.py:198)
2017-03-03 17:59:22.108 ammcon_frontend DEBUG    static/httpslh3googleusercontentcom-oxxxxExxAAAAxxxIAAAAAxxxmMlTodE-xxxcphotojpg.jpg (oauth.py:103)
2017-03-03 17:59:22.575 ammcon_frontend INFO     Created user for [email protected] with role [end-user]. (oauth.py:73)
2017-03-03 17:59:22.796 ammcon_frontend DEBUG    Saved user [email protected] to database. (oauth.py:84)
2017-03-03 17:59:29.447 ammcon_frontend INFO     Command "living1 night" received. Sending message: b'\xb4\x05' (views.py:146)
2017-03-03 17:59:29.501 ammcon_frontend INFO     ############### Connected to zeroMQ server ############### (views.py:154)
2017-03-03 17:59:29.507 ammcon_frontend DEBUG    yarpliving1 night0 (views.py:164)
2017-03-03 17:59:29.539 ammcon_frontend DEBUG    yarpliving1 night1 (views.py:164)
2017-03-03 18:00:02.572 ammcon_frontend DEBUG    This is before first request (views.py:304)
2017-03-03 18:00:08.752 ammcon_frontend INFO     Command "living2 night" received. Sending message: b'\xb5\x05' (views.py:146)
2017-03-03 18:00:08.795 ammcon_frontend INFO     ############### Connected to zeroMQ server ############### (views.py:154)
2017-03-03 18:00:09.068 ammcon_frontend DEBUG    yarpliving2 night0 (views.py:164)
2017-03-03 18:00:34.080 ammcon_frontend DEBUG    This is before first request (views.py:304)

serial manager log:

2017-03-03 17:58:59,666 root         DEBUG    Received command in queue: b'\xd1' (serialmanager.py:56)
2017-03-03 17:58:59,673 root         DEBUG    yarptemp0 (templogger.py:49)
2017-03-03 17:58:59,678 root         DEBUG    yarptemp1 (templogger.py:49)
2017-03-03 17:58:59,688 root         DEBUG    Requesting temperature. (templogger.py:52)
2017-03-03 17:58:59,685 root         INFO     Command sent to microcontroller: ['0x3c', '0xd1', '0xa7', '0x3e'] (serialmanager.py:284)
2017-03-03 17:59:00,165 root         DEBUG    Raw response: ['0x3c', '0x6', '0xd1', '0xa7', '0x13', '0x0', '0x25', '0x0', '0x8a', '0x3e'] (serialmanager.py:66)
2017-03-03 17:59:00,170 root         DEBUG    Destuffed   : ['0x3c', '0x6', '0xd1', '0xa7', '0x13', '0x0', '0x25', '0x0', '0x8a', '0x3e'] (serialmanager.py:74)
2017-03-03 17:59:00,196 root         DEBUG    Received    : ['0x3c', '0x6', '0xd1', '0xa7', '0x13', '0x0', '0x25', '0x0', '0x8a', '0x3e'] (templogger.py:54)
2017-03-03 17:59:29,552 root         DEBUG    Received command in queue: b'\xb4\x05' (serialmanager.py:56)
2017-03-03 17:59:29,572 root         INFO     Command sent to microcontroller: ['0x3c', '0xb4', '0x5', '0x7c', '0x3e'] (serialmanager.py:284)
2017-03-03 18:00:00,381 root         DEBUG    Requesting temperature. (templogger.py:52)

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.