Hi, I´m using a RUT240 to send my data using the Data_to_Server function to my mqtt broker! At the moment this works periodicly! Is there a possibility to sent them by trigger too?
So I would be able to connect my broker if there is a alarm immeditly!
This depends on what information you want to send, and on what event (trigger). For example, you can configure Modbus Alarms to send a message to your MQTT broker when the value of a specific modbus register changes. More information about Modbus alarms is available here. You can also use I/O Juggler to send MQTT messages when there are I/O changes. More information is available here.
There are also SMS and Email alarm options that are available. For example, in addition to Modbus alarms and I/O Juggler, you can use Events Reporting here.
Hello,
sorry for the delay!
I tried out your tipps but thats isn´t what I try to do! My favorite was the idea to use the modbus alarms! But here it isn´t possible to send the same data as I configured out in “Data to Server”!
What I like to do is: If there is a modbus alarms event then I like to sent the data I configured in " Data to Server" ! There are all the necessary informations I need!
Isnt there a possibility to do this?
This functionality isn’t supported, but there’s a workaround to consider. Keep in mind, though, that this might not be ideal for your specific use case.
To start, it’s crucial to understand that Data To Server supports various data sources. Databases are used with most of the data sources, like Modbus. The service retrieves Modbus data from the database, it does not request it directly. Modbus TCP/Serial client periodically sends requests to Modbus devices, storing this data in the database. Therefore, Data to Server doesn’t directly request Modbus data; it extracts it from the database.
Given this, there’s no direct method to send the latest Modbus data when an alarm is triggered. However, here’s an alternative you might find acceptable:
Enable the MQTT broker (allow anonymous access in Broker settings → Miscellaneous) on your RUT and add an MQTT data input in your Data to Server. Configure this MQTT data input to listen on a specific topic on the local RUT broker (127.0.0.1). Then, set up Modbus alarms to send MQTT messages to the local broker when triggered.
In this scenario, when a Modbus alarm triggers and sends an MQTT message to the broker, Data to Server will receive this MQTT message. It will then transmit data to the server using this message and any other available data at that moment. This means that if the Modbus database has relevant data, it will be immediately sent when the MQTT message is received.
It’s important to note that this assumes there is Modbus data present in the database. This approach can be useful if, for example, you have a shorter request period in your Modbus Client configuration (e.g., 30 seconds) and a longer period in Data to Server (e.g., 10 minutes). This way, if there’s data in the database, it will be sent to your server when the Modbus alarm triggers the MQTT message to the broker.
sorry for the delay!
I´m checked your idea but I didn´t get them working!
It isn´t possible to configure a data input to recognize a event! In all the possibilitys I find in the Web UI all „Data to Server“ members are working periodicly!
Maybe I didn´t understand your discription but in „Data to Server“ it isn´t possible to compare a value from the MQTT broker with a defined value and get a action working if they are equal!
I tryed it with last fw Version which is downloadable form the Teltonika website!
As previously noted, configuring triggers for Data to Server is not an available option. The workaround I mentioned is applicable only to MQTT data input. This workaround involves triggering Data to Server to send the currently available data when an MQTT data input gets an MQTT message from the broker on RUT. It’s important to note that Data to Server cannot request information, such as from Modbus; its function is solely to forward the available data. The responsibility of collecting and storing data lies with the Modbus Client service.
My suggestion was to set up Modbus alarms with a comparison mechanism. When these alarms are triggered, they publish MQTT message to the MQTT broker on the router. Consequently, MQTT data input in Data to Server gets this message from the broker and sends data to your server (only that data which is available at that moment, it does not do any additional requests).