Forum Home › Forums › Uncategorized Issues › v6, DrvDsMqtt not publishing anything.
- This topic has 31 replies, 3 voices, and was last updated 1 year, 5 months ago by Mikhail.
-
AuthorPosts
-
October 25, 2022 at 6:27 pm #11414zzzParticipant
Config as follows
<DataSource active="true" code="MqttServer" name="Mqtt Publish" driver="DrvDsMqtt"> <Option name="ClientID" value="esp_rs6" /> <Option name="DataLifetime" value="60" /> <Option name="DetailedLog" value="True" /> <Option name="DeviceFilter" value="" /> <Option name="MaxQueueSize" value="1000" /> <Option name="Password" value="C8080E774B59B0C6694063BDE2428352" /> <Option name="Port" value="1883" /> <Option name="ProtocolVersion" value="Unknown" /> <Option name="PublishFormat" value="{"Val": @val,"Stat": @stat}" /> <Option name="QosLevel" value="1" /> <Option name="Retain" value="False" /> <Option name="RootTopic" value="Communicator" /> <Option name="Server" value="127.0.0.1" /> <Option name="Timeout" value="10000" /> <Option name="UndefinedValue" value="NaN" /> <Option name="Username" value="esp_rs6" />
– tried protocol version 3.11/3.1/5.0, 3.x give errors can’t conenct.
– tried both topic “Communicator/” and “Communicator”
– Qos tried both 0 and 1 nothing changed.
– DrvDsMqtt_MqttServer.log reportssuccessfully subscribed to command topic
– After that in ScadaComm.txt,Mqtt Publish
‘s current data queue vary from 0~3/1000.
– But intcpdump -ni lo tcp port 1833
in console, no port 1833 traffic is captured after drv log report connected, subscribed.
– MQTTExpolorer show no new topic/message on broker.- This topic was modified 1 year, 6 months ago by zzz.
October 26, 2022 at 6:27 am #11421kumajayaParticipantLet me try later today since I have my own Mqtt server locally and on the cloud.
October 26, 2022 at 11:06 am #11425MikhailModeratorScreenshots and logs may help.
I tested the MQTT data source with the following parameters:
ClientID = DataLifetime = 60 DetailedLog = False DeviceFilter = MaxQueueSize = 1000 Password = C8080E774B59B0C6694063BDE2428352 Port = 1883 ProtocolVersion = Unknown PublishFormat = QosLevel = 0 Retain = False RootTopic = Communicator/ Server = broker.mqtt-dashboard.com Timeout = 10000 UndefinedValue = NaN Username =
Communication channel options:
ClientID = Password = C8080E774B59B0C6694063BDE2428352 Port = 1883 ProtocolVersion = Unknown Server = broker.mqtt-dashboard.com Timeout = 10000 Username =
October 26, 2022 at 2:58 pm #11434zzzParticipantI suggest try
mosquitto -v -c /etc/mosquitto/mosquitto.conf
Here is my mosquitto output1666794716: mosquitto version 2.0.11 starting 1666794716: Config loaded from /etc/mosquitto/mosquitto.conf. 1666794716: Opening ipv4 listen socket on port 1883. 1666794716: mosquitto version 2.0.11 running 1666795011: New connection from 127.0.0.1:37370 on port 1883. 1666795011: New client connected from 127.0.0.1:37370 as esp_rs6 (p2, c1, k15, u'esp_rs6'). 1666795011: No will message specified. 1666795011: Sending CONNACK to esp_rs6 (0, 0) 1666795011: Received SUBSCRIBE from esp_rs6 1666795011: Communicatorcommand (QoS 2) 1666795011: esp_rs6 2 Communicatorcommand 1666795011: Sending SUBACK to esp_rs6 1666795026: Received PINGREQ from esp_rs6 1666795026: Sending PINGRESP to esp_rs6 1666795041: Received PINGREQ from esp_rs6 1666795041: Sending PINGRESP to esp_rs6 1666795056: Received PINGREQ from esp_rs6 1666795056: Sending PINGRESP to esp_rs6 1666795071: Received PINGREQ from esp_rs6 1666795071: Sending PINGRESP to esp_rs6 ... PINGs only
The configuration is identical to Mik’s above except for the ClientID, UserName.
<DataSource active="true" code="MqttServer" name="Mqtt Publish" driver="DrvDsMqtt"> <Option name="ClientID" value="esp_rs6" /> <Option name="DataLifetime" value="60" /> <Option name="DetailedLog" value="False" /> <Option name="DeviceFilter" value="" /> <Option name="MaxQueueSize" value="1000" /> <Option name="Password" value="C8080E774B59B0C6694063BDE2428352" /> <Option name="Port" value="1883" /> <Option name="ProtocolVersion" value="Unknown" /> <Option name="PublishFormat" value="" /> <Option name="QosLevel" value="0" /> <Option name="Retain" value="False" /> <Option name="RootTopic" value="Communicator/" /> <Option name="Server" value="127.0.0.1" /> <Option name="Timeout" value="10000" /> <Option name="UndefinedValue" value="NaN" /> <Option name="Username" value="esp_rs6" /> </DataSource>
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- 2022-10-26 22:51:03 MQTT data source started 2022-10-26 22:51:03 Detailed log is disabled 2022-10-26 22:51:03 Connect to 127.0.0.1:1883 Connected successfully 2022-10-26 22:51:03 Subscribe to command topic /* restarted ScadaComm to change setting */ 2022-10-26 22:53:59 Disconnect from 127.0.0.1:1883 2022-10-26 22:53:59 MQTT data source stopped
October 26, 2022 at 3:06 pm #11435zzzParticipantMaybe this is also related ?
<GeneralOptions> <IsBound> true</IsBound> <SendModifiedData> false</SendModifiedData> <SendAllDataPeriod> 60</SendAllDataPeriod> <EnableCommands> true</EnableCommands> <EnableFileCommands> true</EnableFileCommands> <StartLinesOnCommand> false</StartLinesOnCommand> <MaxLogSize> 1</MaxLogSize> <GeneralOptions>
October 26, 2022 at 3:20 pm #11436zzzParticipantDoes this send any channel data ?
or only listens for command onCommunicator/Command
?If it listens for command only, maybe I can check if the command works?
But how should I issue any command over DsDrvMqtt ?Just a side note,
4.7.1.1 Topic level separator
The forward slash (‘/’ U+002F) is used to separate each level within a topic tree and provide a hierarchical structure to the Topic Names… Adjacent Topic level separators indicate a zero length topic level.
Strictly speaking,
Communicator/
is a sub topic ofCommunicator
with a zero-length sub level topic ‘. Maybe the trailing “/” should be left out.- This reply was modified 1 year, 6 months ago by zzz.
October 27, 2022 at 12:29 pm #11450MikhailModeratorLet me try later today since I have my own Mqtt server locally and on the cloud.
@kumajaya, if you already have tried the MQTT publishing data source, could you share the experience?October 27, 2022 at 12:31 pm #11451October 27, 2022 at 1:07 pm #11453zzzParticipantI think its working. The basic aspects of v6 work as expected now. Data polled from plc, and I can view minute data plot of all 77 channels for the last 2 days in webstation. It’s just that I didn’t notice any activity in mqtt broker.
Again I recommend giving
Mqtt Exploer
a try. By default it subscribes to server root(#), all topics are visible in a clean tree. It also allows for charting of values in JSON payloads in just a few clicks. Very nice for debugging and server topics exploring.October 30, 2022 at 7:39 am #11457zzzParticipantI lost access to my previous instance due to power outage. Just re-setup a new one, this time the
Hello World
project from repo/Project
folder is used. MqttDsDrv is enabled. The output from broker is similar.1667115000: Loading config file /etc/mosquitto/conf.d/remote-p1883.conf 1667115000: mosquitto version 2.0.11 starting 1667115000: Config loaded from /etc/mosquitto/mosquitto.conf. 1667115000: Opening ipv4 listen socket on port 1883. 1667115000: mosquitto version 2.0.11 running 1667115001: New connection from 127.0.0.1:35846 on port 1883. 1667115001: New client connected from 127.0.0.1:35846 as esp_rs6a (p2, c1, k15, u'esp_rs6a'). 1667115001: No will message specified. 1667115001: Sending CONNACK to esp_rs6a (0, 0) 1667115001: Received SUBSCRIBE from esp_rs6a 1667115001: Communicator/command (QoS 2) 1667115001: esp_rs6a 2 Communicator/command 1667115001: Sending SUBACK to esp_rs6a 1667115016: Received PINGREQ from esp_rs6a 1667115016: Sending PINGRESP to esp_rs6a 1667115031: Received PINGREQ from esp_rs6a 1667115031: Sending PINGRESP to esp_rs6a
To get
mosquitto
to output the above message in console,
I forgot one thing:
log_dest stderr
must but be put into the config file e.g./etc/mosquitto/conf.d/console_test.conf log_dest stderr listener 1883 127.0.0.1 protocol mqtt allow_anonymous true persistence false
Also mosquitto service must be stopped before running mosquitto in console.
Or mosquitto will not start and gives no error message.systemctrl stop mosqiutto mosquitto -v -c /etc/mosquitto/mosquitto.conf
October 31, 2022 at 7:40 am #11467MikhailModeratorSo does the MQTT data source publish data or not?
October 31, 2022 at 10:53 am #11468zzzParticipantIf it works, it should look sth. like below.
root# mosquitto -v -c /etc/mosquitto/mosquitto.conf 1667213406: Loading config file /etc/mosquitto/conf.d/log+cache.conf 1667213406: Loading config file /etc/mosquitto/conf.d/remote-p1883.conf 1667213406: mosquitto version 2.0.11 starting 1667213406: Config loaded from /etc/mosquitto/mosquitto.conf. 1667213406: Opening ipv4 listen socket on port 1883. 1667213406: mosquitto version 2.0.11 running 1667213407: New connection from 127.0.0.1:59420 on port 1883. 1667213407: New client connected from 127.0.0.1:59420 as esp_debug (p2, c1, k60, u'esp_debug'). 1667213407: No will message specified. 1667213407: Sending CONNACK to esp_debug (0, 0) 1667213407: Received SUBSCRIBE from esp_debug 1667213407: # (QoS 0) 1667213407: esp_debug 0 # 1667213407: Sending SUBACK to esp_debug 1667213409: Received PUBLISH from esp_debug (d0, q0, r0, m0, 'Communicator/test', ... (17 bytes)) 1667213409: Sending PUBLISH to esp_debug (d0, q0, r0, m0, 'Communicator/test', ... (17 bytes))
client_id
esp_debug
is publishing a 17 bytes long message to topicCommunicator/test
November 2, 2022 at 8:39 am #11469MikhailModeratorCommunicator/ is a sub topic of Communicator with a zero-length sub level topic ‘. Maybe the trailing “/” should be left out.
“Communicator/” is used in conjunction with other topic parts, for example
Communicator/line001/device001/Sin
You should tick the Detailed log checkbox in the data source properties. The file DrvDsMqtt_XXX.log contains information about sending data, for example:
2022-11-02 11:35:16 Send Communicator/line001/device001/Sin = -0.5229836122997832 2022-11-02 11:35:16 Send Communicator/line001/device001/Sqr = 1 2022-11-02 11:35:16 Send Communicator/line001/device001/Tri = 5.255433325000013 2022-11-02 11:35:16 Send Communicator/line001/device001/DO = NaN
November 2, 2022 at 1:03 pm #11472zzzParticipantFor the
ds1
box which runs theHello world
project, after being left there a day, after a simple restart I have log and mqtt message working suddently.2022-11-02 20:48:06 Send Communicator/line001/device001/RA = [8.23553587241761, 1.7859521750263974, 8.98281170950074] 2022-11-02 20:48:07 Send Communicator/line001/device001/Sin = -0.9474630312854811 2022-11-02 20:48:07 Send Communicator/line001/device001/Tri = 11.89087025833328 2022-11-02 20:48:07 Send Communicator/line001/device001/RA = [3.225585997960694, 7.005090602011139, 0.8210334274466347] 2022-11-02 20:48:08 Send Communicator/line001/device001/Sin = -0.9468726164272638 2022-11-02 20:48:08 Send Communicator/line001/device001/Sqr = 1 2022-11-02 20:48:08 Send Communicator/line001/device001/Tri = 11.8732918
1667393441: Received PUBLISH from esp_rs6a (d0, q0, r0, m0, 'Communicator/line001/device001/RA', ... (59 bytes)) 1667393442: Received PUBLISH from esp_rs6a (d0, q0, r0, m0, 'Communicator/line001/device001/Sin', ... (19 bytes)) 1667393442: Received PUBLISH from esp_rs6a (d0, q0, r0, m0, 'Communicator/line001/device001/Tri', ... (17 bytes)) 1667393442: Received PUBLISH from esp_rs6a (d0, q0, r0, m0, 'Communicator/line001/device001/RA', ... (57 bytes)) 1667393443: Received PUBLISH from esp_rs6a (d0, q0, r0, m0,
But for the server, that I have regain access to, which connect to real devices and has more registers, the problem persists.
Is there anything else that I haven’t thought of ? (e.g. I have figured out the InfluxDB stuff, its b/c 77 channels are not bound to the archive one by one)The detailed log doesn’t offer much which is why I resolved to mosquitto log. Below is the detailed log you requested:
-------------------------------------------------------------------------------- 2022-11-02 20:21:42 MQTT data source started 2022-11-02 20:21:42 Connect to 127.0.0.1:1883 Connected successfully 2022-11-02 20:21:42 Subscribe to command topic 2022-11-02 20:28:54 Disconnect from 127.0.0.1:1883 2022-11-02 20:28:54 MQTT data source stopped -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- 2022-11-02 20:29:06 MQTT data source started 2022-11-02 20:29:06 Connect to 127.0.0.1:1883 Connected successfully 2022-11-02 20:29:06 Subscribe to command topic 2022-11-02 20:45:42 Disconnect from 127.0.0.1:1883 2022-11-02 20:45:43 MQTT data source stopped -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- 2022-11-02 20:45:55 MQTT data source started 2022-11-02 20:45:55 Connect to 127.0.0.1:1883 Connected successfully 2022-11-02 20:45:55 Subscribe to command topic
The mosquitto log only have PINGREQ/RSP stuff, not gonna repeat it here.
The Communicator setting on server is basically identical to the box running helloworld project. I think there is something else I am missed, what could that be?
working copy in hello world project
<DataSource active="true" code="MqttPublish" name="Mqtt Publish" driver="DrvDsMqtt"> <Option name="ClientID" value="esp_rs6a" /> <Option name="DataLifetime" value="60" /> <Option name="DetailedLog" value="True" /> <Option name="DeviceFilter" value="" /> <Option name="MaxQueueSize" value="1000" /> <Option name="Password" value="C8080E774B59B0C6694063BDE2428352" /> <Option name="Port" value="1883" /> <Option name="ProtocolVersion" value="Unknown" /> <Option name="PublishFormat" value="" /> <Option name="QosLevel" value="0" /> <Option name="Retain" value="False" /> <Option name="RootTopic" value="Communicator/" /> <Option name="Server" value="127.0.0.1" /> <Option name="Timeout" value="10000" /> <Option name="UndefinedValue" value="NaN" /> <Option name="Username" value="esp_rs6a" /> </DataSource>
problematic server
<DataSource active="true" code="MqttServer" name="Mqtt Publish" driver="DrvDsMqtt"> <Option name="ClientID" value="esp_rs6" /> <Option name="DataLifetime" value="60" /> <Option name="DetailedLog" value="True" /> <Option name="DeviceFilter" value="" /> <Option name="MaxQueueSize" value="1000" /> <Option name="Password" value="C8080E774B59B0C6694063BDE2428352" /> <Option name="Port" value="1883" /> <Option name="ProtocolVersion" value="Unknown" /> <Option name="PublishFormat" value="" /> <Option name="QosLevel" value="0" /> <Option name="Retain" value="False" /> <Option name="RootTopic" value="Communicator/" /> <Option name="Server" value="127.0.0.1" /> <Option name="Timeout" value="10000" /> <Option name="UndefinedValue" value="NaN" /> <Option name="Username" value="esp_rs6" /> </DataSource>
- This reply was modified 1 year, 5 months ago by zzz.
November 2, 2022 at 1:54 pm #11475zzzParticipant<IsBound> true</IsBound> <SendModifiedData> true</SendModifiedData> <SendAllDataPeriod> 60</SendAllDataPeriod> <EnableCommands> true</EnableCommands> <EnableFileCommands> true</EnableFileCommands> <StartLinesOnCommand> false</StartLinesOnCommand> <MaxLogSize> 1</MaxLogSize>
-
AuthorPosts
- You must be logged in to reply to this topic.