Forum Home › Forums › Communicating with Devices › KpMQTT and Thingsboard
- This topic has 18 replies, 4 voices, and was last updated 2 years, 8 months ago by german.
-
AuthorPosts
-
January 28, 2018 at 9:11 pm #3060anuniaParticipant
Hi there, I am trying to get working Rapid Scada and Thingsboard together but without success 🙁
At the moment, I did build KpMQTT.dll and did create a new comm line and communication file for MQTT but I can’t get the communicator working, maybe I am missing something about MQTT and this driver… I want to publish Rapid Scada data to Thingsboard server (i.e: collect some data using a Modbus device and replicate some channels data into new ones MQTT channels to publish this data to Thingsboard).These are my config files:
ScadaCommSvcConfig.xml line<CommLine active="true" bind="true" number="6" name="MQTT"> <CommChannel type="" /> <LineParams> <Param name="ReqTriesCnt" value="3" descr="Device request retries count on error" /> <Param name="CycleDelay" value="0" descr="Delay after request cycle, ms" /> <Param name="CmdEnabled" value="true" descr="Commands enabled" /> <Param name="ReqAfterCmd" value="false" descr="Request device after command" /> <Param name="DetailedLog" value="true" descr="Write detailed information to the log" /> </LineParams> <CustomParams /> <ReqSequence> <KP active="true" bind="false" number="61" name="Test MQTT" dll="KpMQTT.dll" address="0" callNum="" timeout="0" delay="1000" time="00:00:00" period="00:00:00" cmdLine="KpMQTT_Config.xml" /> </ReqSequence> </CommLine>
KpMQTT_Config.xml file
<?xml version="1.0" encoding="utf-8"?> <DevTemplate> <MqttParams Hostname="127.0.0.1" ClientID="" Port="1883" UserName="" Password=""/> <RapSrvCnf ServerHost="127.0.0.1" ServerPort="10000" ServerUser="ScadaComm" ServerPwd="12345"/> <MqttPubTopics> <Topic TopicName="/input/600" QosLevel="0" NumCnl="600" PubBehavior="OnChange" Retain="true" NDS="."/> <Topic TopicName="/input/601" QosLevel="0" NumCnl="601" PubBehavior="OnChange" Retain="true" NDS="."/> </MqttPubTopics> </DevTemplate>
Also, I did create the comm line, device and channels for MQTT on SCADA-Administrator but I cannot communicate both systems.
Could anyone give me some advice about what am I doing wrong or what do I need to add please?
I guess I am missing the channel mapping between Rapid Scada and Thingsboard device (telemetry data), also, I can`t figure out where to place the device ACCESS_TOKENThank you in advance!
January 29, 2018 at 11:19 am #3061MikhailModeratorHi,
Did you check the log of the communication line? Is there something useful?
I recommend to contact the author of the MQTT driver. His email is shared on the GitHub page.January 29, 2018 at 1:13 pm #3063anuniaParticipantHi Mikhail, you are right, I did contact the author so I will to publish the solution here later.
September 13, 2019 at 12:09 pm #5942kumajayaParticipantSorry for my late reply, ThingsBoard expect json formatted payload: https://github.com/kumajaya/scada-community/commit/a8a7bce35deb4c3f1e0ae604be3685b47d2e1027
September 13, 2019 at 12:23 pm #5943kumajayaParticipantExample config, ACCESS_TOKEN as UserName:
<?xml version="1.0" encoding="utf-8"?> <DevTemplate> <MqttParams Hostname="127.0.0.1" ClientID="KpMQTTrs111" Port="1884" UserName="owMdAakfgOlUOUwF0mpB" Password=""/> <RapSrvCnf ServerHost="127.0.0.1" ServerPort="10000" ServerUser="ScadaComm" ServerPwd="12345"/> <MqttSubTopics> </MqttSubTopics> <MqttPubTopics> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="13" Prefix="{ "p0":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="14" Prefix="{ "p1":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="15" Prefix="{ "p2":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="16" Prefix="{ "p3":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="26" Prefix="{ "p4":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="27" Prefix="{ "p5":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="28" Prefix="{ "p6":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="29" Prefix="{ "p7":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="31" Prefix="{ "p8":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="33" Prefix="{ "p9":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="30" Prefix="{ "v0":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="32" Prefix="{ "v1":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> <Topic TopicName="v1/devices/me/telemetry" QosLevel="1" NumCnl="25" Prefix="{ "v2":" Suffix=" }" PubBehavior="OnChange" Retain="false" NDS="."/> </MqttPubTopics> <MqttPubCmds> </MqttPubCmds> <MqttSubCmds> </MqttSubCmds> <MqttSubJSs> </MqttSubJSs> </DevTemplate>
September 13, 2019 at 3:59 pm #5945MikhailModeratorDo you mean that the issue is fixed?
The latest version of KpMqtt.dll is available at https://github.com/RapidScada/scada-community/releases
September 13, 2019 at 8:11 pm #5946kumajayaParticipantSeptember 14, 2019 at 11:51 am #5947MikhailModeratorCould you explain:
1. What is Thingsboard?
2. Why this device can not be polled as usual?September 14, 2019 at 1:25 pm #5948kumajayaParticipantFrom ThingsBoard’s FAQ https://thingsboard.io/docs/faq/#what-is-thingsboard :
ThingsBoard is an open-source server-side platform that allows you to monitor and control your IoT devices. It is free for both personal and commercial usage and you can deploy it anywhere.ThingsBoard’s Mqtt API reference: https://thingsboard.io/docs/reference/mqtt-api/
- This reply was modified 4 years, 7 months ago by kumajaya.
September 14, 2019 at 1:46 pm #5950kumajayaParticipantUpdate for example dashboard from my personal project:
- This reply was modified 4 years, 7 months ago by kumajaya.
September 17, 2019 at 3:06 pm #5952kumajayaParticipantI have found why my old binary more reliable maintain connection to ThingsBoard than the current version. Revert https://github.com/bersim/OpenKPs/commit/cbf039eccbbd17b1ae6b0c66dd4db04237b4969f restore reconnection feature.
September 18, 2019 at 8:01 am #5953MikhailModeratorYes, this is a significant bug.
We plan to refactor the driver inside the https://github.com/RapidScada/scada-community repository.September 18, 2019 at 3:28 pm #5954kumajayaParticipantIt’s good if you rebase it to upstream Strider Mqtt https://github.com/ericvoid/StriderMqtt I’m not that expert to rewrite a driver from scratch.
July 23, 2021 at 7:23 am #9285germanParticipantHello every one. I received the Json data feedback from thingsboard server as below
Receive packet
v1/devices/me/rpc/request/450 = {“method”:”setValue”,”params”:true}
Now I want to get value of Attribute “method” and “params”. Can everyone help me. Thanks so much.July 23, 2021 at 1:21 pm #9286MikhailModeratorHi,
You need to parse the response using JavaScript engine of the driver.
kp_mqtt_5.0.4.0.zip contains KpMqtt_Job.js which can be used as example.
But string values are not supported. Can you change method value to a number? -
AuthorPosts
- You must be logged in to reply to this topic.