High Frequency Polling


I have one of these boards for triggering sound effects from contact closures.

It comes with a node for node-Red and I had expected to be able to obtain an output on a state change however it requires polling from an inject node to acquire the input state. To get something approaching a realtime response I'm running an inject node with a repeat interval of 0.1s into 16 instances of the node to return the states of the 16 inputs. This seems to work OK but I was wondering if this would have any detrimental affect to the system and resources required. Its on an RPi 4



indeed yuk... but hey - it's how it works so ...

Maybe an alternative would be to try the Python library with MQTT. Run a simple Python polling app as a separate process feeding any updates to MQTT. Then node-red can use MQTT instead of polling. Possibly would be more efficient.

1 Like