# Shortest repeat interval time?

**URL:** <https://discourse.nodered.org/t/shortest-repeat-interval-time/63325>\
**Category:** General\
**Created:** [31 May 2022 19:11 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325 "2022-05-31T19:11:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmazingFlow](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@AmazingFlow](https://discourse.nodered.org/u/AmazingFlow)\
**Post date:** [31 May 2022 19:11 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/1 "2022-05-31T19:11:40Z")

</div>

Hi there,

When i put the inject object, it allows us to Inject once after "x" seconds, then  
Repeat Interval "N" seconds.

On the x seconds (Inject once after...), how small time can i go?  
On the N seconds (repeat interval), can i go in milliseconds range?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 May 2022 19:15 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/2 "2022-05-31T19:15:02Z")

</div>

You can enter 0.1 or 0.0001 if you want - but the question is, why?

This is primarily an events based programming environment & very efficient at what it does. Constantly polling is not the best design pattern

Perhaps if you explain what you are trying to achieve we can better advise.

---

<div class="post-metadata">

**Author:** ![AmazingFlow](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@AmazingFlow](https://discourse.nodered.org/u/AmazingFlow)\
**Post date:** [31 May 2022 19:20 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/3 "2022-05-31T19:20:09Z")

</div>

I have a arduino hardware that receive an input signal. The signal might come and goes maybe within 10ms every hour.

Would like node-red to be able to detect this input and send it to a database with a timestamp when this input goes high.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 May 2022 19:24 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/4 "2022-05-31T19:24:56Z")

</div>

How is the arduino interfaced with node-red?

Serial connection? MQTT? Other?

---

<div class="post-metadata">

**Author:** ![AmazingFlow](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@AmazingFlow](https://discourse.nodered.org/u/AmazingFlow)\
**Post date:** [31 May 2022 19:29 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/5 "2022-05-31T19:29:18Z")

</div>

> [@Steve-Mcl](#):
>
> 0.0001

Its communicating serially.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 May 2022 19:32 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/6 "2022-05-31T19:32:42Z")

</div>

ok, so then when the serial data arrives, you can simply test the value then trigger a database write if the value is seen - unless - you have to send a serial message to request the value?

Questions:

- Do you have the src code for the aurduino?
- Does your aurduino have WiFi (and would you switch to WiFi or wired Ethernet?

---

<div class="post-metadata">

**Author:** ![AmazingFlow](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@AmazingFlow](https://discourse.nodered.org/u/AmazingFlow)\
**Post date:** [31 May 2022 19:49 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/7 "2022-05-31T19:49:15Z")

</div>

No source code in the arduino yet.  
Will be using wired ethernet.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 May 2022 20:07 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/8 "2022-05-31T20:07:24Z")

</div>

> [@AmazingFlow](#):
>
> No source code in the arduino yet.

Then you can simply write to the serial port when an input change is detected in your Arduino source code. Then it will be 100% event driven (send the change of value when your Arduino detects a change) - no need to poll

> [@AmazingFlow](#):
>
> Will be using wired ethernet.

In which case - could you not use MQTT instead of serial? Then it will be 100% event driven (publish the change of value when your Arduino detects a change) - no need to poll

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 July 2022 20:07 UTC](https://discourse.nodered.org/t/shortest-repeat-interval-time/63325/9 "2022-07-30T20:07:28Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
