Hi everyone,
I’m using TRB140 and TRB141 devices to send JSON data to my API server. I rely on I/O state changes – when there’s a rising edge, the device sends data indicating which input was triggered, along with a timestamp.
In most cases, this works well. However, the data is sent almost 24/7, and occasionally the API server undergoes a short maintenance (around 5 minutes). Sometimes, even the LTE network can experience brief outages. In those cases, the request gets lost if the server doesn’t return a 2XX response.
Is there a way to buffer or store the data locally on the Teltonika device if the server is temporarily unavailable or doesn’t respond with a 2XX status code? Ideally, I’d like the device to retry sending the data later instead of losing it entirely.
Thanks in advance for any suggestions!
Greetings,
To assist you more accurately, could you please clarify how the I/O state change is currently being monitored and forwarded to your API server? Are you using a custom script, Event or I/O Juggler for this functionality?
If you’re utilizing a custom script with Data to Server functionality, there is a Retry option available within the collection’s configuration window:
This allows the device to automatically retry sending the data if the initial attempt fails.
Additionally, could you let us know how frequently the I/O state change data is being sent to the server?
Kind regards,
Hello sir,
thank you for your response. I am currently using I/O Juggler > Actions / General, and I’m triggering an HTTP request on a logical edge change. I have already tried using the Data to Server functionality, but I was looking for a more “lazy” solution and couldn’t find a way to send the edge state along with a timestamp. I’m sending data to the server on a digital input change, which occurs approximately once every 3 minutes. For my needs, I created a custom *.sh script that checks the curl response from the API server and handles the payload request according to my preferences. It would be great if native features like Data to Server (retry count / timeout) were also available for HTTP in Settings > I/O Juggler > Action > HTTP.
Kind regards