[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.
[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.