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

Python error: Line36: IndexError: list index out of range #12

Open
christophernies opened this issue Jan 14, 2014 · 0 comments
Open

Python error: Line36: IndexError: list index out of range #12

christophernies opened this issue Jan 14, 2014 · 0 comments
Assignees

Comments

@christophernies
Copy link

[nies@localhost RaspberryPi]$ python serial_test.py
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '[RF12demo.10] _ i31 g2 @ 915 MHz ', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:02', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '0.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:14', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '0.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:24', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '142.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:35', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '0.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:45', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '0.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:30:56', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '0.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:31:07', 'id': '1', 'channel': '001'}], 'site_id': '1'}
{'node_readings': [{'soil2': '1.3', 'soil3': '1.4', 'soil1': '370.00', 'voltage': '1.4', 'temp': '58', 'timestamp': '2013-12-08 12:31:17', 'id': '1', 'channel': '001'}], 'site_id': '1'}
Traceback (most recent call last):
File "serial_test.py", line 36, in
sensorData = analog[1].rstrip('\r\n')
IndexError: list index out of range

I believe this is occurring when the python script grabs a line from the JeeLink that does not contain any data.

I need to look into filtering out JeeLink lines that don't contain sensor data. Maybe we can generate a .log file with everything, and then only attempt to upload JeeLink lines we know contain valid data.

@ghost ghost assigned christophernies Jan 15, 2014
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

1 participant