I/O POST/GET API removal

Hi,

It has come to my attention that RutOS 7.14 has removed the I/O POST/GET function in favour of the standard API. At present we use the time parameter to temporarily toggle a pin, which the API does not appear to support. We use this as a kind of power switch, and the device making the request is the device that gets power cycled, so it is essential that the router itself can switch the pin back again without any further requests from the device. Is there any plan to add this function to the API?

Thanks.

Hi!

We are in the same situation. We have achieved some advances, creating a bulk request ( https://developers.teltonika-networks.com/fundamentals#bulk-requests ), but without a timeout between switching on and then off the dout1 pin. The advantage of a bulk request is that you launch a unique request and forget. The execution of individual requests is done in an “atomic” way.

An additional question is: Does it exist a way to introduce delays between two endpoints requests in a bulk request?

My bulk request body JSON:

{
  "data": [
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "0"
      }
    }
  ]
}

Hello, I have the exact same issue, was using the time parameter.

Thanks @jcolladoa I’ve tried but indeed I would need a delay between requests otherwise it is too fast

Hi again,

I found a completely dirty way to insert a delay: repeat the first trigger multiple times in the bulk. Repeating 8 times in a RUT241 gives aprox. 1 second of delay, enough for my purposes.

Elegant? Not at all! Does it work? Yes. (Long live engineering :wink:

Anyway, it would be nice to find a clean way to do it from the API… Let’s wait for someone at Teltonika to respond.

{
  "data": [
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "1"
      }
    },
    {
      "endpoint": "/api/io/dout1/actions/change_state",
      "method": "POST",
      "data": {
    		"value": "0"
      }
    }
  ]
}

Hi there,

I’ve inquired about this with our R&D to see if there’s any plans to add such a thing in the future. Once I have an answer, I’ll get back to you.

Regards,
M.

1 Like