from grafana to MATLAB using MQTT protocol
이전 댓글 표시
Hi, I want to transfer some data from grafana to matlab.
I'm trying to use the MQTT protocol, but the process of getting data is difficult even if I use the Industrial communication toolbox.
I'd like your advice.
답변 (1개)
Venkat Siddarth
2023년 4월 7일
0 개 추천
I understand that you are facing difficulty in retrieving the data from Grafana using MQTT protocol. Assuming you are looking for alternatives, I suggest creating a RESTful API. Which can be created as follows:
Configuring Grafana
- Firstly, configure the data source in Grafana
- Then generate an API key in Grafana and note them down for subsequent API requests
Retrieving data from Grafana using the API
- After that determine the API endpoint to which you want to request
- Then you can build the API query, depending on the data you want
- Using the webread function you can send a request to the API and retrieve data. The request requires the API key as an authorization token, which you can pass in using the weboptions function.
You can check out the corresponding documentation to know more about:
- Grafana API key generation: https://grafana.com/docs/grafana/latest/administration/api-keys/#create-an-api-key
- Grafana API querying a data source: https://grafana.com/docs/grafana/latest/developers/http_api/data_source/#query-a-data-source
- Webread function in MATLAB: https://in.mathworks.com/help/matlab/ref/webread.html
I hope this information is helpful.
Best regards,
Venkat Siddarth V
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!