I'm doing the basic setup in python to pass data to an InfluxDB server I have running on a RaspberryPi. My issue is the write_points() function does not write ANY data to InfluxDB even though I am using the simplest possible measurement and field-set entry as a test:
from influxdb import InfluxDBClient
from influxdb_config import HOST, PORT, USERNAME, PASSWORD, DATABASE
from data_poll import quotes_response
import pprint
influxdbClient = InfluxDBClient(
host = HOST,
port = PORT,
username = USERNAME,
password = PASSWORD,
database = 'example'
)
data = [
{
"measurement": "stock price",
"fields": {
"price": 0.64,
"volume": 120
}
}
]
pprint.pprint(influxdbClient.ping())
pprint.pprint(influxdbClient.get_list_database())
influxdbClient.switch_database('example')
pprint.pprint(influxdbClient.write_points(data))
pprint.pprint(influxdbClient.query('SELECT * FROM example'))
I am able to communicate with the server via Python and, if I create values manually on the server, retrieve them in the same script. Below is a snippet of the terminal output that matches some of the requests in the above code snippet.
'1.8.4'
[{'name': '_internal'}, {'name': 'jsonAAPLDataTest'}, {'name': 'example'}]
True
ResultSet({})
Update 2021/03/14 - I'm currently using Python 3.9.2, but had the exact same issue utilizing 3.7.3 (tested by the API developers). My next attempt is to downgrade my InfluxDB instance from v1.8.4 to v1.7.4 to see if this, by chance, resolves the issue.