-1

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

  • Welcome! A friendly reminder that Stack Overflow is for getting help with coding, algorithm, or programming language problems. For future reference, you should post DB admin/ops questions on https://dba.stackexchange.com/questions/ask?tags=cassandra. Cheers! – Erick Ramirez Sep 27 '22 at 07:43

1 Answers1

1

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.

mdeuchert
  • 248
  • 2
  • 8
  • yeah i agree with you... so will you please tell me how to use "SAVE ATTRIBUTE" and "SAVE TIME SERIES" and "SAVE TO CUSTOM TABLE" node to store my project data into (psql or cassandra db)???? I figured out that these three nodes are key to store data in db but what i am unable to find is how??? i 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?? – Arpit Saxena Sep 28 '22 at 05:35
  • 1
    I think you should first take a look into the general concepts of rulechains of ThingsBoard: https://thingsboard.io/docs/user-guide/rule-engine-2-0/overview/ – mdeuchert Sep 28 '22 at 06:16
  • 1
    There is one default Rulechain called Root Rulechain which processes all incoming data (e.g. send via MQTT or HTTP) and stores the data in the underlying databases like Postgres or Cassandra. – mdeuchert Sep 28 '22 at 06:17
  • For information regarding specific rulenodes please consult the documentation aswell: https://thingsboard.io/docs/user-guide/rule-engine-2-0/action-nodes/#save-attributes-node – mdeuchert Sep 28 '22 at 06:18
  • I have studied rule chains and i have created rule chain for triggering alarms,clearing alarm and triggering mail,and they worked fine and know that there are root rule chain but that rule chain is only storing default root rule chain's data into psql, what i want is to store my projetct's data in psql, so should i use "save attribute", "save timeseries node" and "save to custom table node" in my project's rule chain?? to store project data?? if yes then where to connect nodes??exactly – Arpit Saxena Sep 28 '22 at 09:33
  • 1
    Then I don't get what's the problem. Just debug the rulechains where you are using the Save attributes or Save Telemetry Nodes. One thing you should check is, if the messages have the right Message Type (Attributes --> POST_ATTRIBUTES_REQUEST & Telemetries --> POST_TELEMETRY_REQUEST) This is also documented. – mdeuchert Sep 28 '22 at 12:00