Home > OS >  Connecting a database with Thingsboard
Connecting a database with Thingsboard

Time:09-28

Will you Please help me in one more important thing??? I need to store dashboard's data in a database.. according to my study thingsboard supports 3 database at the moment. NoSQL, Mysql and Hybrid (Psql cassandra) so i have researched a lot but could not find any way to send my telemetry data to any database. I know it is possible because the thingsboard doc itself say so... but how do i do that?? I checked Psql database thingsboard that i created during installation but there are those relations are present that was made by default. i need to store my project's data in databases just like in AWS we store IoT core's data in Dynamo DB or in IoT analytics. Thingsboard do not provide any node related to DB in his rule engine?? so How do i make a rule chain to transfer my projects data in any Database server. i have installed pgadmin4 to Graphically see the database but nothing useful found. Documentation and stakoverflow geeks said that configuring Thingsboard.yml file located in monolithic installation on linux (/etc/thingsboard/conf/thingsboard.conf ) in this path it have cassandra,mysql,postgres configuration but how to properly configure it??? i tried to access the default database of postgres named thingsboard that i created on installing time but when i list the content of database it only shows the default things/relations of thingsboard if i create a device on thingsboard that is not showing in database why?? I really can use your help. Please enlighten me a way to connect my THINGSBOARD with a DATABASE.

see in my attached images there are everything default, nothing that i create on thingsboard.

enter image description here

CodePudding user response:

That's wrong, ThingsBoard currently supports 3 database setups: Postgres only, Hybrid Postgres Cassandra (only telemetries) & Postgres Timescale. So there is no MySQL database used anywhere.

https://thingsboard.io/docs/user-guide/install/ubuntu/#step-3-configure-thingsboard-database

Find guides for connecting your devices to Thingsboard here, e.g. via MQTT: https://thingsboard.io/docs/reference/mqtt-api/

If you would like to forward the stored telemetries of ThingsBoard to different databases, this is not possible directly with rulechains (there's only one node to store data in a cassandra table)

One way to achieve this, would be fetching the data with an external microservice/program via HTTP API and persisting the data in the database of your choice. You could use a python script for example.

https://thingsboard.io/docs/reference/rest-api/

Alternatively, you can send the data to a Message queue like Kafka instead of fetching via HTTP API. But still it would require additional tools for storing the data in external databases outside ThingsBoard.

CodePudding user response:

Project Rule chain

tried to implement my idea of adding these two nodes in my project rule chain, thought they might help, but not good !! ii am attaching a screenshot please tell me if this rule chain will work or not??

  • Related