Hi Noah, here is the code. Some data and the errors are below. But your main question regarding the influxdb versions seems to be most interesting… On Ubuntu its version 5.0.0, and on Raspbian its 0.1.12. So I guess the next question is how to get the latest version for Raspbian installed? I tried both with pip and apt-get (after running update). Can you let me know?
Update:
just checked and it says that python-influxdb is the latest version (no idea which one - how do I find out?)
however, I also installed python3-influxdb , which is version 0.1.12-1
Thanks for your help.
def publish_data(self):
client = InfluxDBClient(INFLUXDB_HOST, '8086', '', '', INFLUXDB_NAME)
response = client.write_points(self.data, time_precision='s')
data (excerpt):
…‘tags’: {‘Station’: ‘CA48’}, ‘measurement’: ‘Enphase_Watt’}, {‘fields’: {‘value’: 150}, ‘time’: 1528395300, ‘tags’: {‘Station’: ‘CA48’}, ‘measurement’: ‘Enphase_Watt’}, {‘fields’: {‘value’: 125}, ‘time’: 1528395600, ‘tags’: {‘Station’: ‘CA48’}, ‘measurement’: ‘Enphase_Watt’}, {‘fields’: {‘value’: 120}, ‘time’: 1528395900, ‘tags’: {‘Station’: ‘CA48’}, ‘measurement’: ‘Enphase_Watt’}, {‘fields’: {‘value’: 101}, ‘time’: 1528396200, ‘tags’: {‘Station’: ‘CA48’}, ‘measurement’: ‘Enphase_Watt’}]
Exception in thread Read_Enphase:
Traceback (most recent call last):
File “/usr/lib/python3.4/threading.py”, line 920, in _bootstrap_inner
self.run()
File “/home/pi/Documents/Pumpberry/Pumpberry_main_v33 test.py”, line 86, in run
self.publish_data()
File “/home/pi/Documents/Pumpberry/Pumpberry_main_v33 test.py”, line 62, in publish_data
response = client.write_points(self.data, time_precision=‘s’)
File “/usr/local/lib/python3.4/dist-packages/influxdb/client.py”, line 468, in write_points
tags=tags, protocol=protocol)
File “/usr/local/lib/python3.4/dist-packages/influxdb/client.py”, line 532, in _write_points
protocol=protocol
File “/usr/local/lib/python3.4/dist-packages/influxdb/client.py”, line 300, in write
data = make_lines(data, precision).encode(‘utf-8’)
File “/usr/local/lib/python3.4/dist-packages/influxdb/line_protocol.py”, line 159, in make_lines
_convert_timestamp(point[‘time’], precision))))
File “/usr/local/lib/python3.4/dist-packages/influxdb/line_protocol.py”, line 44, in _convert_timestamp
raise ValueError(timestamp)
ValueError: 1528351500