thingsboard | 开源物联网平台thingsboard源码分析
kandi X-RAY | thingsboard Summary
kandi X-RAY | thingsboard Summary
开源物联网平台thingsboard源码分析
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Updates Cassandra database .
- Push entity action to rule engine .
- Save rule chain metadata .
- Construct the action data .
- Performs the necessary upgrade .
- Process message .
- Find and aggregate .
- Starts the coAP request .
- Process incoming request .
- Run random messages .
thingsboard Key Features
thingsboard Examples and Code Snippets
Community Discussions
Trending Discussions on thingsboard
QUESTION
recently, our company has been using Thingsboard which has a Python API so subsequently we have been using quite a few Python scripts to manipulate data from text files and send this data into the Thingsboard platform for ingest. At the moment we are running quite a few of these file listening scripts in debug mode in VSCode. We ultimately need to deploy these Python scripts on a Windows Server 2019 machine for a production environment. My question is: What is the recommended way to host/deploy these scripts? They idealy need to be monitored to make sure they are running and send alerts if they stop running or except. Some of the scripts are single file .py scripts. Some scripts have multiple files with classes and data files. Ideally they will have there own venv. I have thought about packaging them into an .exe and creating a service for each script. I have also considered using something like dkango, (I have no exerience of django so don't know if this is suitable). I have also considered using docker for each script. What would you do?
...ANSWER
Answered 2022-Mar-09 at 14:54I don't know if it is the best way or not, but you can turn them into exe (and convert them to services), here is another stackoverflow page with different aproches for this: How can I convert a .py to .exe for Python?
docker is a nice aproche, but I don't see any good point for why using them.
About monitoring, you can eather create a visual application (where you can even change values and stuff) but not possible in services. Or simply having a log.txt file that you print stuff in.
That s what I would do, again I don't know if that s the best way of doing it.
QUESTION
Not a duplicate of Template tag content is empty - A bug in Angular, while my question is about Vanilla Js.
I am working on a ThingsBoard widget. In the HTML tab, I have this simple template:
...ANSWER
Answered 2022-Jan-19 at 22:25If your ThingsBoard example is using React or a similar DOM library, it might be programmatically creating the DOM, which could cause this issue.
When a is constructed programmatically, using
appendChild
, the content
remains empty.
For example:
QUESTION
I want to run a self managed Thingsboard on AWS (t2.micro).
I have installed Thingsboard CE on a t2.micro AWS instance running Ubuntu 20.04 sever.
I followed the aws setup and Ubuntu install guides(postgresql + built in queue service).
I also set up haproxy using this guide.
I was able to successfully log in to my Thingsboard. I only changed the passwords and checked the basic functionalities, but didn't create any new dashboards or made any modifications.
After this I left the computer on, running Thingsboard. Next day I could not reach Thingsboard and although the AWS instance was running I could not ssh into it anymore. After stopping and starting(reboot didn't work) the instance everything was ok (could ssh and Thingsboard was reachable).
I can reproduce this failure just by leaving the instance on, it seems that after serveral hours (5-8 hrs) Thingsboard(or something else not sure) fails which freezes the whole computer.
I have checked two things:
I checked CPU utiization on AWS monitoring. It seems that after some hours there is a big jump in CPU load and then it drops back to almost zero. While Thingsboard is running, it is constant.See printscreen from AWS monitoring
I checked the Thingsboard logs (in /var/log/thingsboard): There are some errors, but unfortunately most of the things are not enough for me guess what could be a problem with the fresh installation. Here are some lines from the log:
...
ANSWER
Answered 2021-Dec-30 at 11:56After I increased the RAM to 4GB (from 1GB) the ThingsBoard server is up without problem. There are no sporadic freezes anyomore. As there were no other provable suggestions for the problem and now my system works without a problem I consider the question answered.
QUESTION
The Docker image for Thingsboard with Cassandra (thingsboard/tb-cassandra) also has a Postgres database to store metadata among other things.
I need to connect to this Postgres database from outside the container with a monitoring and administration tool. For that, I need the user and password that were provided for the database when the image was created, and I couldn't find this information in the Thingsboard documentation. I don't want to change the credentials because that might cause problems with the other components of the Docker container.
Does anybody know this user/password combination?
...ANSWER
Answered 2021-Dec-29 at 15:50According to thingsboard compose file:
QUESTION
I'm trying to set up the REST connector for Thingsboard IoT Gateway and getting some errors on initialization. My rest.json config is:
...ANSWER
Answered 2021-Dec-29 at 10:01It is an issue with aiohttp, it is already fixed in the master branch. You can use the version from the master branch of the gateway repository or wait for the next release.
QUESTION
I recently started working with thingsboard in context of my bachelor-thesis. Right know I am trying out different functionalities in order to check which requirements thingsboard already satisfies and which have to be implemented by me.
Within that process I am stuck at the requirement that thingsboard dashboard should give live information about the connectivity status of a registered device (connected, disconnected, active, inactive).
To solve that I've tried out editing the rule chain used by the device profile assigned to the device of interest. Specifically I worked with the message type switch
and tried out various action nodes connected to it via ConnectEvent, DisconnectEvent, ActiveEvent and InactiveEvent. What I would like to have is the connectivity status of the device to be stored in an SERVER_SCOPE
attribute and then being displayed in the entity widget. All I've achieved is to generate an alarm when disconnected and cleared when (re)connected. I know there is a server side attribute called active
that changes true
immediately when device connects but it only turns false
after the inactivityTimeout
expired.
I also checked the ThingsBoard Device Connectivity Status page, the Create Alarm when the Device is offline guide and took long researches but couldn't get it to work.
Do you guys have any solutions or tips for me?
Kind regard.
...ANSWER
Answered 2021-Dec-01 at 15:28With the help of @JacksonB I managed to solve my problem.
What did I do?
Create a blue Transform-script node.
Change message type to
POST_ATTRIBUTES_REQUEST
and add desired attributes. Here's my code for that:var newType = "POST_ATTRIBUTES_REQUEST"
msg.connectivity = "connected"
return {msg: msg, metadata: metadata, msgType: newType};
Than just connect this to an post attribute node in the rule chain like shown in the image. Link to screenshot of rule chain
No I am able to instantly see if a device is connected or disconnected by displaying the value of that attribute on my dashboard.
QUESTION
I send this valid JSON to TB CE edition, and it fails reading it.
...ANSWER
Answered 2021-Nov-14 at 22:17If you're using windows to execute that cmd, try using windows format quotes.
"{\"ts\":\"12345678910\",\"value1\":\"99\",\"value2\":\"24\"}"
QUESTION
Is it possible to somehow serialize current Thingsboard (let's call it TBoard) configuration, save it and than latter load saved configuration on TBoard startup. I am specifically interested in loading device profiles, rule chains, and dashboards. I want to save configuration together with my project in git repository so than latter I could just use docker-compose to start multiple services from project (let's call them sensors) and single TBoard instance with saved configuration which will be used for collecting telemetry from sensors and drawing dashboards. Another reason for saving configuration is what happens if for some reason TBoard container crashes or somehow get corrupted so it can't be started again, would I have to click on the things again in order to create all device profiles, dashboards, configure rule chains ... etc etc ... ?
...ANSWER
Answered 2021-Sep-30 at 22:49Regarding this line
I am specifically interested in loading device profiles, rule chains, and dashboards. I want to save configuration together with my project in git repository
I have just recently implemented version control for my Thingsboard deployment. The way i am doing it is with the python REST client.
I have written functions to export all dashboards/data converters/integrations/rule chains/widgets into json files which I save into a github repository.
I have also written the reverse script to push the stored files to a fresh environment, essentially "flashing" it. Surprisingly, this works perfectly.
I have an idea to publish this as a package, but it's something I've never done before so I'm unsure if I will get to it.
Just letting you know that it is definitely possible to get source control operational via the API.
QUESTION
Given that I have this kind of hierarchy in my Thingsboard:
...ANSWER
Answered 2021-Sep-01 at 06:04I found the answer myself.
Ownership in Thingsboard is not a Relation. So you have to manually create those relations inside the entity as they are not automatically created.
So even if Root Customer owns Customer 1, they are still not related unless you explicitly created that relation.
So Customer Hierarchy page shows you hierarchy based on ownership, but widgets only show it by Relation.
QUESTION
I am currently trying to mess around with ThingsBoard, and one of the things I am trying to achieve is to show a polygon on the trip animation widget. I have my coordinate values added to it as I would expect to work, but it doesn't seem to.
I have tested the same collection of coordinates on the general 'Latest Values' map widget and it works fine there, but I would really like to visualize the movement of a device between polygons.
Has anyone gotten the polygon working that may be able to advise?
My coordinates field is a timeseries value and in the format [ [ [l1,l2],[l1,l2] ],[ [l1,l2],[l1,l2] ] ,...[ [l1,l2],[l1,l2] ] ]
Does anyone know what I may be doing wrong? Any advice that can be given is greatly appreciated.
...ANSWER
Answered 2021-Mar-31 at 09:59Update: I have talked with ThingsBoard devs, there is an actual bug in the widget. It is not appearing because it is broken, closing this question
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install thingsboard
You can use thingsboard like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the thingsboard component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page