jbrusey / cogent-house

Cogent House is a system for sensing temperature, humidity, CO2, Air Quality, VOC, hot water consumption, and electricity consumption within the home. It has been developed by the [http://cogentcomputing.org Cogent Computing Applied Research Centre] at Coventry University. Cogent House is developed using TinyOS and Python.
4 stars 2 forks source link

No Sensor Type 16 #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a Current Cost node
2. Look at sensor types reported
3. No Type 16 in Sensor List

Sensor Type 16 should exist

Original issue reported on code.google.com by DjGoldsm...@googlemail.com on 23 May 2013 at 11:39

GoogleCodeExporter commented 9 years ago
2013-05-24 00:48:16,604 DEBUG [cogentviewer.views.node][Dummy-2] Graph for type 
16
2013-05-24 00:48:16,604 DEBUG [cogentviewer.views.node][Dummy-2] RRD file will 
be 4324_10_16.rrd
2013-05-24 00:48:16,605 DEBUG [cogentviewer.views.node][Dummy-2] Path is 
/usr/share/cogent-house/4324_10_16.rrd Exists True
2013-05-24 00:48:16,613 ERROR [waitress][Dummy-2] Exception when serving 
/node/4324
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/waitress-0.8.1-py2.6.egg/waitress/channel.py", line 329, in service
    task.service()
  File "/usr/local/lib/python2.6/dist-packages/waitress-0.8.1-py2.6.egg/waitress/task.py", line 173, in service
    self.execute()
  File "/usr/local/lib/python2.6/dist-packages/waitress-0.8.1-py2.6.egg/waitress/task.py", line 380, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/config.py", line 291, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/router.py", line 187, in __call__
    response = self.handle_request(request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid_tm-0.5-py2.6.egg/pyramid_tm/__init__.py", line 100, in tm_tween
    response = handler(request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/router.py", line 164, in handle_request
    response = view_callable(context, request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/config/views.py", line 227, in _secured_view
    return view(context, request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/config/views.py", line 333, in rendered_view
    result = view(context, request)
  File "/usr/local/lib/python2.6/dist-packages/pyramid-1.3.4-py2.6.egg/pyramid/config/views.py", line 471, in _requestonly_view
    response = view(request)
  File "/home/dan/webinterface/cogentviewer/views/node.py", line 118, in node
    line1 = pyrrd.graph.LINE(defObj=def1, color="#ff0000", legend=item.sensorType.name)
AttributeError: 'NoneType' object has no attribute 'name'

Original comment by DjGoldsm...@googlemail.com on 23 May 2013 at 11:39

GoogleCodeExporter commented 9 years ago
Appears to be linked to Current Cost nodes.
On reflashing this type of node we it gains c02 but does not report electricity.

Original comment by DjGoldsm...@googlemail.com on 23 May 2013 at 11:50

Attachments:

GoogleCodeExporter commented 9 years ago
Sensor type 16 is included in the populate sensor type table: 
25a5ee59d391_populate_sensortype_.py

you need to state what alembic version you are at with your database. 

possibly it had already been populated based on a prior version? 

a possible fix for your database is to ask alembic to generate sql for going 
from 249f360e32e3 to 25a5ee59d391

alembic -c cogent/alembic.ini upgrade 249f360e32e3:25a5ee59d391 --sql 
>sensortypes.sql

you need to edit the resulting script so that it doesn't change the alembic 
version. 

Original comment by james.br...@gmail.com on 30 May 2013 at 9:42