Python 3 - Unable Save Data Into IoTDB Via MQTT Method #8408
Unanswered
jerrychong25
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Hi, please try the code below. if __name__ == "__main__":
try:
payload = f"""{{\n"device":"root.location.data",\n"timestamp":100,\n"measurements":["site", "tag_id", "x", "y", "z", "confidence"],\n"values":["testsite1", "test111", -16.00000, -12.00000, 10.00000, 99.9]}}"""
publish.single(topic='root.location.data', payload=payload, hostname=IOTDB_SERVER_ADDRESS,
port=IOTDB_SERVER_PORT, protocol=3, auth={'username': 'root', 'password': 'root'})
print("MQTT Publish Success!!!")
except Exception as e:
print("MQTT Publish Error: ")
print(str(e))
# client.disconnect()
print("MQTT Publish Failed!") |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Recently I've tested publish data via MQTT into IoTDB successfully, and no error is prompted from MQTT or IoTDB side.
However, no data is actually stored when I execute SELECT query in IoTDB CLI.
Is anyone know if there is good method to trouble this issue?
Since I can't get any error logs.
Python 3 Codes:
MQTT Config in /iotdb/conf/iotb-engine.properties:
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions