We have been tasked to create the following prototype setup for a potential client, and I need to know if the following setup is possible using scripting:
We would like to connect a USB-numpad to a Mikrotik KNOT (the KNOT is our go-to communications module, and we would like to avoid using something like a Raspberry Pi or similar). The KNOT controls a relay via the GPIO pins, which controls a pump. When a user enters a valid code, the pump runs until the user enters a stop key. The duration of the pump run is sent to an external server along with the user ID and timestamp.
Now, what I need to know, to determine if we can use the KNOT or not, is the following:
I have read that the KNOT can read serial input, so it should be able to catch the numpad keystrokes in a script. However, this might require that a script is running permanently to listen for the numpad inputs over serial? So, is it possible to have a script running permanently and reliably? Or can a small script be executed everytime a keystroke happens, sort of like when a GPIO pin executes a script in this example:
https://help.mikrotik.com/docs/display/ ... ter+device
If a keystroke could start a small script, when each key value could be saved in a global variable, and then when the # key is entered, a start-relay-script is activated.
So, can we use a permanently running script and/or a "small-script-per-keystroke-input"?