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

Import script fails #23

Open
GoogleCodeExporter opened this issue Jul 4, 2015 · 1 comment
Open

Import script fails #23

GoogleCodeExporter opened this issue Jul 4, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Using the latest HEAD to test the import script i get this, both with a new or 
old database file:

$  python2  import-data-envir.py /dev/ttyUSB0 
/home/higuita/apps/currentcost/envi-test.ccd 
{'msg': {'src': u'CC128-v1.30', 'type': u'1', 'dsb': u'00479', 'ch1': {'watts': 
u'00489'}, 'time': u'02:11:57', 'sensor': u'0', 'id': u'03170', 'tmpr': 
u'27.8'}}
Traceback (most recent call last):
  File "import-data-envir.py", line 61, in <module>
    run(s, db)
  File "import-data-envir.py", line 31, in run
    w2 = int(currentcoststruct["msg"]["ch2"]["watts"])
KeyError: 'ch2'

Original issue reported on code.google.com by dmotale...@gmail.com on 29 Jun 2012 at 1:11

@GoogleCodeExporter
Copy link
Author

I just look at the code and its simple, just comment out the extra channels i 
dont use:

#w2 = int(currentcoststruct["msg"]["ch2"]["watts"])
#w3 = int(currentcoststruct["msg"]["ch3"]["watts"])
#t = (w1**2 + w2**2 + w3**2 ) **0.5

and add this
t = w1

Original comment by dmotale...@gmail.com on 27 Jul 2012 at 12:48

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

No branches or pull requests

1 participant