ammgws / ammcon-frontend Goto Github PK
View Code? Open in Web Editor NEWFrontend for AmmCon home automation project
License: Other
Frontend for AmmCon home automation project
License: Other
For example on keyboard interrupt
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:
Enabling logging to file seems to have disabled it printing to stdout.
Would like to find a way to have both.
Probably a bug in the microcontroller code - need to test independently.
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?
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'
Refer to this comment regarding AmGraph.
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.
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
Get rid of put None
response = socket.recv()
line.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)
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.