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
1,224 views 14 comments
by

I see RUT9xx cannot control digital output via MQTT.

But I want to control digital output of RUT240 on remote site over NAT network. SMS messages cost is too high for our case.

Can I develop MQTT subscribe client on RUT240 or custom MQTT message handler with MQTT Publisher ?

I think Lua script and MQTT client module may be usable for me.

1 Answer

+1 vote
by anonymous

Hi,

I believe it could be done easier. You can use JSON-RPC to control your device, send and receive information about inputs and outputs.

Also, you can do it through HTTP Post/Get functions RUT955 Input/Output - Teltonika Networks Wiki

For both of these to work remotely, you would need a public IP address, which could be a high cost too, but you should also consider trying out our RMS platform, in which accessing your devices without public IP shouldn't be an issue and this service is much cheaper.

EB.

by

Thank you for your advice.

How can I turn on the digital output with RMS ? I tried RMS, but I cannot find any menu or button to turn on digital output.

Also,

  1. I want to turn on and off (control) the digital output with API from our infrastructure
  2. I want to turn on digital output for 5 seconds, then automatically turn off.
  3. If another control is request while above control, another control is responded with specific error (currently, http cgi-bin with "time=5" keeps digital output as ON)
by anonymous

You take the generated WebUI link from RMS and put it instead of 192.168.1.1 in JSON-RPC or HTTP POST/GET links.

For POST/GET https://2b084699e2e0e37478cca7807cc77dbc.proxy1-connect.rms.teltonika-networks.com/cgi-bin/sms_send?username=user1&password=user_pass&number=0037060000000&text=testmessage

For JSON-RPC https://2b084699e2e0e37478cca7807cc77dbc.proxy1-connect.rms.teltonika-networks.com/ubus

Here you will find how to control your I/O with POST/GET: https://wiki.teltonika-networks.com/view/RUT955_Input/Output#Post.2FGet_configuration

EB.

by
Thank you for you advice about POST/GET with WebUI link

How may days is the maximum expiration for WebUI link I can generate ?

I want to use RUT240 with remote API. The remote API to devices is used in our cloud infrastructure in every day 24 hour. So, I want to avoid human interaction with web browser.
by anonymous
Hi,

RMS does have its own API, so you should be able to generate links using API.

Regarding maximum expiration - it will be active until the date you defined while generating the link. Also, your link can get expired sooner if your device loses connection to RMS (this should be fixed soon).

EB.
by anonymous
Please let me confirm. Is it correct as following ?

If I must use private IPv4 address for connecting RUT240, and to control digital output on RUT240,

1. WebUI Link does not reach to RUT240
2. JSON-RPC does not reach to RUT240
3. MQTT client does not support controlling digital output
4. RMS does not support connecting to customer VPN. So, WebUI/JSON-RPC over VPN is not available
5. RMS API reaches to RUT240, but RMS API does not support controlling digital output on RUT240

So, in this condition, I am required to develop custom application in RUT240.
by anonymous
Hi,

If you lose connection generated link (with WebUI and JSON-RPC), you can still generate new links with RMS API. Yes, it does not control I/O, but it will bring back connection to WebUI, POST/GET or JSON-RPC by creating you a new link. So I don't see why you should develop custom application when there are other applications already working.

EB.
by anonymous

Can I generate WebUI and JSON-RPC link with NAT network ?

Does JSON-RPC work without WebUI ?

I got "WebUI is unreachable" error on RMS "DEVICE WEB UI" button. How can I work Web UI in NAT network (soracom, Japan).

I tried "legacy" option, but the RMS shows error is shown as follows.

"An error has occured while trying to browse through the proxy.
Failed to connect to device. Possible problems are that the server was not found, the connection timed out, or the connection refused by the host. Try connecting again and check if the address is correct."

by anonymous
NAT network shouldn't be the issue, as long as it's properly NAT'ed into outside internet and you have internet connection on your device. Have you updated your device to the latest firmware? Did you change anything in the firewall page of the WebUI over the time?

Try resetting your router to default factory settings, then apply any mobile settings that you need for internet connection and check if you can ping 8.8.8.8 address in CLI to make sure you're successfully connected to the internet.

After that - go to RMS, unregister and register the device and after it pops green in the status icon try generating WebUI link.

EB.
by anonymous
After restore default, unregister and register again, I could get generated WebUI link to my RUT240.

Thank you.
by anonymous

Thank you for your support. 

Even if NAT environment, I confirmed CGI over WebUI Link or JSON-RPC WebUI Link controls RUT240 digital output. But it takes several seconds because these API goes through Japan - RMS in Frankfurt - Japan.

We are required to control digital output within less than 2 seconds. To achieve this requirement, I think our RUT240 must connect to cloud always. So, we need MQTT with controlling digital output.

I found "SDK DOWNLOADS" in RUT240 web page. Can I develop my custom MQTT client with this SDK ?

by anonymous
Yes, with SDK you will be able to compile different packages and custom programs into the firmware, but support for any later issues that happen with your device is your own responsibility and unfortunately, I will not be able to help you with the development of that custom MQTT client.

EB.
by anonymous
Thank you. I see.
by anonymous
Hi,

I have a similar need for my TRB255. I need to be able to monitor and control my IO-pins
via MQTT. After some testing and reading documentation back and forth I understand that control
is not supported. This is quite disappointing since MQTT support was one of the features that convinced me
to purchase the TRB255. Both JSON-RPC and HTTP post/get seems clumsy compared to MQTT. Having to send user/passwords is not that "up to date" in the IoT world. I have MQTT up and running over TLS and would like to also control the device. Second, it seems like I can only pull pin status from the TRB, I was expecting the device to publish changes (pulling is costly).

I hope that this is something that can be supported within reasonable time.

/Björn
by anonymous
I would also welcome the linking of digital inputs and outputs using mqtt.