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.

Okay, @Matas, thanks!

Beyond other uses for I/O pins, I think power cycling devices is a feature that is in demand (it certainly is for my organization).

The rise-delay-fall (or vice versa) feature available in the deprecated I/O API, executable as an atomic operation, is very important. It could be implemented as an enhancement to the /io/{id}/actions/change_state endpoint (adding parameters similar to those of the equivalent deprecated API command), or as an additional, completely separate “delay” endpoint, allowing it to be included within a bulk request. This latter approach may be even more interesting, allowing the entire bulk sequence to execute each individual endpoint sequentially.

Passed this on to the R&D as well. Will get back to you as soon as I have a response.

Thank you for your patience,
M.

Hello, @jcolladoa , @spencercw & @f.coulon ,

The feature for time & delay is set to be added with the firmware release 7.18.

Regards,
M.

Yes we will be in the same situation. we use the the GET/POST interface to power cycle devices,I Just upgraded to 7.16 to find this out :\ I will down grade to 7.13 until 7.18 comes out and implement bulk requests with the time period attribute.

Hi Matas,

The change_state API with the new time and delay parameters seems to have already been deprecated. Is there another way to do this?

Thanks.

Hello,

It will take a long time before the deprecated endpoint is removed, so you can safely continue using it for now. It was reworked due to an improper endpoint structure when implementing the backup functionality. In the future, if there is a need, delay functionality will likely be added to the new endpoint as well.

“Deprecated” is a warning that an endpoint is no longer supported (although in some cases it may still be partially supported and even receive bug fixes). It also indicates that the endpoint will be removed with a major API version update. However, that API version upgrade has not happened yet and is not expected in the near future.

Regards,
Matas.

Hi Matas,

We reiterate our interest in maintaining the implementation of I/O change_state, to perform power cycling in our organisation, without the need of workarounds like bulk requests.

Best regards,

José Luis.

Hello,

Thanks for reaching out, Jose. This issue seems to have been fixed with 7.18 firmware. Could you please update, if you haven’t yet, and confirm whether everything works as expected?

Regards,
Matas.