FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
583 views 3 comments
by anonymous

How to auto-provision a Teltonika modem (RUT240 /TRB141) with openremote? Its based on X.509 certificates: https://github.com/openremote/openremote/wiki/User-Guide%3A-Auto-Provisioning

1 Answer

0 votes
by anonymous

Hello,

I am not quite familiar with OpenRemote, but hopefully the following instructions will provide some guidelines on how to configure the device and required environment to start forwarding data to OpenRemote.

  • So first, refer to the online OpenRemote documentation at Quckstart. Follow the steps in the section Quickstart to create your own environment with full access.
    • NOTE: In examples, port 1883 was used for MQTT protocol. To use this port you need to add it to your docker-compose file.
  • On the top right of the Manager UI page press on the three dots, go to the Users page and create a new service user (second panel on the page).
  • Give the service user a name and the read and write Manager roles for the sake of convenience, though it is advised to configure a more restricted role for your service users. Click 'Create', a password will be generated automatically.
  • Open the created user to see and copy the password.
  • Next, create a Thing asset (in this case, MQTT subscriber).
  • Give it a name and press Add.
  • Modify created asset to give it a new attribute:
    • Type: Custom Attribute
    • Name: writeAttribute
    • Valuetype: JSON

Next step is to configure the router/gateway. The device will act as a MODBUS TCP master and slave, meaning that the device will make data requests to itself and received data will be sent via MQTT protocol to OpenRemote MQTT broker and subscriber. The configuration is as follows:

  • Login to the device's WebUI. Navigate to Services -> MODBUS -> MODBUS TCP slave.
  • Simply enable it, save the settings and switch to  and switch to Services -> MODBUS -> MODBUS TCP master.
  • Add a new instance, enable it, give it a name, set IP address option to device's LAN IP address, add a Period of 10 seconds, leave the rest as default.
  • Under Requests configuration, add a request, configure the data you want to receive. Complete list of device data and associated registers can be found in device's wiki page. 
  • Enable request.
  • Requests can be tested in the same window under Request configuration testing.
  • Once you have finished configuring MODBUS master, save the settings.
  • Go to Services -> Data to server, add a new instance.
  • Configure the following:
    • Enable it;
    • Give it any name
    • Data source: Modbus data
    • Protocol: MQTT
    • JSON format: {"Data":"%a"}
    • Segment count: All
    • URL / Host / Connection string: Host IP of your OpenRemote system.
    • Topic: Define the correct topic. For directly writing an attribute value: {realm}/{clientID}/writeattributevalue/{attributeName}/{assetID}. For example: master/client123/writeattributevalue/writeAttribute/74dSwSsbJ6SzJF1YUq7IuU
    • Client ID: Use the client ID that is used in the Topic field
    • Period: Data sending frequency (in seconds)
    • Use credentials: Enable
    • Username" : master:mqtt_user ({realm}:{user})
    • Password: The secret generated for the MQTT service user (you can find it on the mqtt_user Users page)

Lastly, you can open the "OpenRemote" system to check if your setup works, if everything was setup correctly, you should see the values update in attributes section. In the example registry data (JSON object) - %a" is being updated.

Best regards,

by anonymous
Thank you for the detailed answer, this is indeed a way of sending data to openremote. However, this is what we are already doing - and it isn't scalable for large fleets of devices because it requires us to manually add each device. We need a way to AUTO-provision devices to openremote, and just like other IOT tooling this is often done using certificates. Openremote requires a X.509 certificate, but I cannot see how to configure this in Teltonika devices. Do you?
by anonymous

Please check their documentation on their requirements for auto-provisioning: https://github.com/openremote/openremote/wiki/User-Guide%3A-Auto-Provisioning

by anonymous
I have forwarded your question to the developers to look into the feasibility of Auto-provisioning.

Once there are updates, I will post them.

Best regards,