Forum Replies Created
-
AuthorPosts
-
November 2, 2022 at 1:15 pm in reply to: v6, DrvDsInfluxDB suport InfluxDB or InfluxDB2 or both ? #11474
zzz
ParticipantFigured out, all channels’s archive mask needs to be updated in channel db.
Issue closed.zzz
ParticipantFor 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 2 years, 11 months ago by
zzz.
zzz
ParticipantIf 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
October 30, 2022 at 8:13 am in reply to: v6, DrvDsInfluxDB suport InfluxDB or InfluxDB2 or both ? #11461zzz
ParticipantI am not exactly sure how that is supposed to be done.
But in the
helloworld
project on a different box, it works correctly after I added connection setting and configuredminute copy
archive to use influxdb.And I can see below message in log now. I guess that mean it working.
I will double check my previous instance setup after I regain access to the server.2022-10-30 16:05:30 Successful response from the database server 2022-10-30 16:05:45 Writing of 8 data points completed successfully in 0 ms 2022-10-30 16:05:45 Successful response from the database server 2022-10-30 16:06:00 Writing of 8 data points completed successfully in 0 ms 2022-10-30 16:06:00 Successful response from the database server
I have some question, why not
current data
?
What doesread only
option mean ?
Can I disable file backends if I use influx?zzz
ParticipantI 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
zzz
ParticipantI reserve my reply before I finish checking out these v6 features 🙂
zzz
ParticipantI 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.zzz
ParticipantThank you. I grabbed the docs. Will give a closer look tomorrow.
October 27, 2022 at 12:21 pm in reply to: V6, communicator ignores bound channel of integer data type #11446zzz
ParticipantThat is kinda confusing, maybe it should be highlighted in the document regarding these data types, “hey users, these data types are determined by driver developers, not you, go read the driver manual.” 🙂
-
This reply was modified 2 years, 11 months ago by
zzz.
October 27, 2022 at 8:52 am in reply to: v6, DrvDsInfluxDB suport InfluxDB or InfluxDB2 or both ? #11441zzz
Participantsome more info
from ScadaServer.txt2022-10-27 14:09:44 [wsta][appstack][ACT] Archive Cur initialized successfully 2022-10-27 14:09:44 [wsta][appstack][ACT] Archive Min initialized successfully 2022-10-27 14:09:44 [wsta][appstack][ACT] Archive Hour initialized successfully 2022-10-27 14:09:44 [wsta][appstack][ACT] Archive Events initialized successfully 2022-10-27 14:09:44 [wsta][appstack][ACT] Archive MinCopy initialized successfully 2022-10-27 14:09:44 [wsta][appstack][ACT] Start listener on port 10000 2022-10-27 14:09:44 [wsta][appstack][INF] Archive in DAT format: /app/appstack/rapidscada6/Linux/scada/Archive 2022-10-27 14:09:44 [wsta][appstack][INF] Archive copy in DAT format: /app/appstack/rapidscada6/Linux/scada/ArchiveCopy 2022-10-27 14:09:44 [wsta][appstack][ACT] Delete outdated data from the Min archive older than 27/10/2021 2022-10-27 14:09:44 [wsta][appstack][ACT] Delete outdated data from the Hour archive older than 27/10/2021 2022-10-27 14:09:44 [wsta][appstack][ACT] Delete outdated data from the Events archive older than 27/10/2021 2022-10-27 14:09:46 [wsta][appstack][ACT] Session with ID 5923217496133782260 created 2022-10-27 14:09:46 [wsta][appstack][ACT] Client 127.0.0.1 connected 2022-10-27 14:09:46 [wsta][appstack][ACT] Session with ID -346220670448517208 created 2022-10-27 14:09:46 [wsta][appstack][ACT] Client 127.0.0.1 connected 2022-10-27 14:09:46 [wsta][appstack][ACT] User ScadaWeb is successfully authenticated 2022-10-27 14:09:46 [wsta][appstack][ACT] User ScadaWeb is successfully authenticated
from ScadaServer/Config/ScadaServerConfig.xml
... <Modules> <Module code="ModArcBasic" /> <Module code="ModArcPostgreSql" /> <Module code="ModArcInfluxDb" /> </Modules> <Archives> <Archive active="true" code="Cur" name="Current data" kind="Current" module="ModArcBasic"> <Option name="FlushPeriod" value="30" /> <Option name="LogEnabled" value="false" /> <Option name="ReadOnly" value="false" /> <Option name="UseCopyDir" value="false" /> </Archive> <Archive active="true" code="Min" name="30s archive" kind="Historical" module="ModArcBasic"> <Option name="IsPeriodic" value="true" /> <Option name="LogEnabled" value="false" /> <Option name="PullToPeriod" value="0" /> <Option name="ReadOnly" value="false" /> <Option name="Retention" value="365" /> <Option name="UseCopyDir" value="false" /> <Option name="WriteWithPeriod" value="true" /> <Option name="WritingPeriod" value="30" /> <Option name="WritingPeriodUnit" value="Second" /> </Archive> <Archive active="false" code="CurCopy" name="Current data copy" kind="Current" module="ModArcPostgreSql"> <Option name="Connection" value="" /> <Option name="FlushPeriod" value="30" /> <Option name="LogEnabled" value="false" /> <Option name="MaxQueueSize" value="1000" /> <Option name="ReadOnly" value="false" /> <Option name="UseStorageConn" value="true" /> </Archive> <Archive active="true" code="MinCopy" name="Minute archive copy" kind="Historical" module="ModArcInfluxDb"> <Option name="Connection" value="local-v2" /> <Option name="IsPeriodic" value="true" /> <Option name="LogEnabled" value="true" /> <Option name="PullToPeriod" value="0" /> <Option name="ReadOnly" value="false" /> <Option name="Retention" value="365" /> <Option name="WriteWithPeriod" value="true" /> <Option name="WritingPeriod" value="1" /> <Option name="WritingPeriodUnit" value="Minute" /> </Archive>
from ScadaServer/Config/ModArcInfluxDb.xml
<ModArcInfluxDb> <Connections> <Connection> <Name> local-v2</Name> <Url> http://127.0.0.1:8086</Url> <Token> %token%</Token> <Username> %user%</Username> <Password> %pass%</Password> <Bucket> default</Bucket> <Org> default</Org> </Connection> </Connections> </ModArcInfluxDb>
October 27, 2022 at 6:52 am in reply to: v6, DrvDsInfluxDB suport InfluxDB or InfluxDB2 or both ? #11440zzz
ParticipantI am using InfluxDB2 local install, All I get from the log is “writing 0 data point”, why ?
All channel data are of type
Double
, formatOff-On
.
File Archive works fine, in webstation,
I can open the channel’s minute data plot from table view.2022-10-27 14:10:00 Writing of 0 data points completed successfully in 84 ms 2022-10-27 14:10:01 Successful response from the database server 2022-10-27 14:11:00 Writing of 0 data points completed successfully in 1 ms 2022-10-27 14:11:00 Successful response from the database server 2022-10-27 14:12:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:12:00 Successful response from the database server 2022-10-27 14:13:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:13:00 Successful response from the database server 2022-10-27 14:14:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:14:01 Successful response from the database server 2022-10-27 14:15:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:15:01 Successful response from the database server 2022-10-27 14:16:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:16:00 Successful response from the database server 2022-10-27 14:17:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:17:00 Successful response from the database server 2022-10-27 14:18:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:18:00 Successful response from the database server 2022-10-27 14:19:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:19:00 Successful response from the database server 2022-10-27 14:20:00 Writing of 0 data points completed successfully in 0 ms 2022-10-27 14:20:00 Successful response from the database server 2022-10-27 14:21:00 Writing of 0 data points completed successfully in 0 ms
zzz
ParticipantYeah, I wrote a script for that. But I noticed that some files are missing from the build output. e.g.
web.confg ...
some output are not shown in released file
ScadaCommonApp ScadaCommon ScadaServerApp ScadaServer ... AgentClient.dll
etc.
ScadaCommon.dll ScadaCommon.Log.dll *Storage.dll
are copied multiple times, I tried put them in one ScadaCommon folder, and add
--additionalprobingpath $SCADA_COMMON
afterdotnet
inExecStart
line, this switch works for dotnet dlls, but not all dlls e.g.MQTTNet.dll
If the dependencies are in a central place, with some additionalprobingpath logic in code, maybe packaging could be a lot easier.
zzz
ParticipantDoes 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 2 years, 11 months ago by
zzz.
zzz
ParticipantMaybe 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>
zzz
ParticipantI 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
-
This reply was modified 2 years, 11 months ago by
-
AuthorPosts