Hi All,
I am trying to send Modbus rtu data which I am reading with using MODBUS SERIAL CLIENT (which I have confirmed is the correct setting by teltonika support), to a third party using the data to server functionality.
I am unsure of how to confirm that the correct data is being sent because when testing with mqtt explorer and similar programmes the topic does not show up even though
everything is enabled correctly according to my understanding of the documentation.
I maybe configuring the data to server setting incorrectly, I have tried multiple different configurations to no success.
my data to server config:
config settings ‘settings’
option loglevel ‘1’
config collection ‘1’
option sender_id ‘1’
option period ‘60’
option timer ‘period’
option format ‘json’
option name ‘PBA_DPT145’
option output ‘2’
list input ‘3’
option retry ‘0’
option enabled ‘1’
config input ‘3’
option format ‘json’
option name ‘Sensor_1’
list members ‘data’
option filter_list_modbus_filter_request ‘1’
option modbus_filter ‘all’
option modbus_segments ‘1’
option plugin ‘modbus’
option modbus_object ‘1’
Just to clarify, is the initial issue with Modbus data being sent through MQTT still unresolved? If yes, from the first view, looking at your configuration, I noticed that the MQTT broker’s address is set to 192.168.1.1. Is this the LAN IP address of your device? If so, could you please confirm whether the MQTT broker is actually enabled and running on this device? The MQTT broker can be enabled on Services → MQTT page in the WebUI.
Let me know if that helps or further assistance is needed.
Thank you again for the reply!
Apologies if the explanation was not clear,
The initial issues sending Modbus data through MQTT is resolved only when sending via a lan connection.
The issue is now sending the Modbus data through MQTT when using a Sim card and mobile network connection.
When using the sim card associated IP address I am unable to confirm the data is being sent, and when changing the relevant data to match with the sim card IP address I receive no response when checking via mqtt explorer for example.
I have attached screenshots of my current configuration.
Thank you for the update and the further clarification.
Could you please confirm your current setup in a bit more detail? As I understand, you have the MQTT broker on your TRB device, and you’d like to receive Modbus data externally over WAN. If that’s correct, then a couple of important points to check:
Your mobile WAN interface needs to have a public IP address. Currently, it seems your SIM is receiving an IP from a CG-NAT (private) range.
When the public IP part is ensured, make sure that in the MQTT broker’s settings remote access is enabled:
Once these aspects are addressed, you should be able to receive the data externally through your mobile network connection.
I hope this helps clarify how the setup should be structured. If you still face any troubles, let me know, and feel free to share your Data to Server configuration screenshots too.
you are very close the set up we are needing to achieve (good memory!),
We are needing to read the modbus data from a serial attached sensor (working correctly), We need to then send the readings via mqtt to a third party (working only locally i.e using mqtt explorer), the server address is set to the public mqtt address of the third party we need to send the readings to.
Will this change the instructions any?
Could you kindly clarify whether you intend to use the router as an MQTT broker and then access the data remotely using your MQTT client (mqtt explorer as a subscriber)? If that’s the case, would it be possible for you to provide a screenshot of the Services → MQTT → Broker page from your router’s WebUI?
The TRB245 will be a publisher/broker (to send the modbus data) meaning the third party and mqtt explorer will act as a subscriber to receive the modbus data.
Attached are the requested screenshots
I have also attached a picture of services → mqtt → publisher NOTE it is NOT enabled.
Also of note I have had a telephone call with our local support office and was told this is the correct configuration for our use case.
e.g trb245 as a publisher and then sending the modbus data using data to server.
is it possible that maybe causing an issue is the host name ? System → admin → General
Yes, in this type of setup, where the TRB245 acts as both the broker and publisher of Modbus data via Data to Server (MQTT), the Publisher service itself should remain disabled, as the Data to Server functionality handles the MQTT publishing in this scenario.
Also, hostname could potentially be the culprit here; thus, for testing purposes, I’d recommend changing the hostname to, e.g., TRB245 and seeing if that makes any improvement.
Additionally, please make sure the device has a public IP on the mobile WAN interface.
Hi Martynas,
I have managed to sort out a public IP address, (it is dynamic, does it have to be static?).
Also the hostname is changed to trb245, I am still able to subscribe via MQTT and receive the data with a LAN connection it is now working via WAN.
So, as I understand it, the issue has been resolved, and you’re now able to successfully subscribe via MQTT and receive data over the WAN connection as well? Could you please confirm if everything is now working as expected?
Also, just a quick note, since you’re using a public dynamic IP address, it would be advisable to set up DDNS (Dynamic DNS). This way, when your public IP changes, you won’t need to manually update the MQTT broker’s address in the Data to Server configuration.
You can find detailed instructions on how to configure DDNS on your device here:
If you need any assistance with this setup, feel free to reach out.
Hi Martynas,
Unfortunately we are still having issues sending the data to the third party,
When setting the server configuration to the desired address the sending fails,
I was successfully able to send via a wan enable connection (which is what is needed for the final setup), but when changing the server address to the third party’s address the data was not sent.
WORKING (Server address is NOT real just for for clarification purposes)
Could you please confirm which third-party MQTT broker you’re attempting to use now? Initially, as I understood, TRB245 was acting as a broker itself, where data was published to the TRB’s mobile WAN public IP and a client (like MQTT Explorer, MQTTx, etc.) was used to subscribe to the topic, and this setup worked fine.
If you’re now trying to publish to a third-party MQTT broker, first try disabling MQTT broker on the TRB. Also, make sure the correct server address and credentials (username & password), which I assume are required, are properly configured in the Data to Server section.
Regarding the second issue:
From your screenshots and description, the modem sees the SIM inserted but fails to register with the operator.
Could you please confirm whether the data plan limit hasn’t been reached or if the SIM is active and unblocked on your provider’s side?
If the SIM is fine, please:
Restart the mobile connection from Status → Network → Mobile.
Navigate to the System logs via System → Maintenance → Troubleshoot page System log → Show — and share logs here (make sure no sensitive, vulnerable information is seen).
The third party is another company that will use the modbus data for machine learning purposes. They have provided me with a broker address to send the modbus data to.
I have changed the server address to the broker address given to me by the third company,
This (terribly bad) diagram may help clear things up
Appreciate the diagram and additional information.
Could you clarify if you want to have 2 MQTT brokers now or a single 3rd-party one? If that’s the required setup, then configuration is simple, involving creating two Data to Server collections with different MQTT broker/server addresses. If that’s not the required setup, please provide more additional information and confirm whether the 3rd-party server is an MQTT broker without a username/password. Also, check if the server is not an HTTP(s) one. Additionally, please provide screenshots from MQTT and Data to Server settings where changes were made.
your support is very much appreciated,
I effectively need two brokers.
One to use for testing (before implementing the actual sending) to ensure we are sending the correct data and to be able to refine the data being sent, i.e. not all data or just certain data.
One to send the MQTT data to the company that will use said data it i.e. the production broker.
The broker for testing does not need to be active all the time.
The broker for the production needs to send at 3 am each day.
I am trying to set up a remote meeting with the company to 100% confirm the details of how to send the data, as I set the broker to what they had advised me previously.
once I have had a meeting with them I’ll update you.