RUT955 io-juggler execution delay not working properly

Firmware RUT9_R_00.07.06.18
Question: how to limit Event/Actions on analog input values with RUT955

I have added an io-juggler event on analog input value to guard the correct supply voltage.
The event will initiate when voltage is out of the allowance band (11.5V .. 14.9V) and initiate an SMS action.
Since there are sometimes bursts of heavy current surge spikes from the battery, the battery voltage will drop multiple times within 100 seconds period under the defined bandwith for very short intervals (< 300 msec).
The i/o juggler event for analog values does not include a delay definition to supress sequential events in a short timeframe.
The event will activate an SMS action.
The i/o juggler action SMS message definition does contain a “execution delay” parameter to inhibit multiple SMS messages to be send in short term intervals. (used parameter value: 120 seconds)
A delay of SMS Transmittal is observed, but still multiple SMS messages are transmitted with time differences 11 .. 15 seconds.
It seems to be that the exeution delay function is not working as defined in the manual.
The analog values are part of the SMS message itself, using the ”%g1" parameter. None of the presented voltage values in the SMS message is outside the defined validity band (11.5 .. 14.9V).
Adding an extra condition to check for actual analog value when transmitting an SMS message with same validity band does not change the behave of RUT955.

Hello,

Thank you for reaching out.

To better understand the behavior you’re observing, firstly, could you please provide screenshots of your full I/O Juggler configuration, specifically from the General, Conditions, and Actions tabs where the changes were made?


As an alternative workaround, you might consider smoothing out the voltage spikes at the hardware level by adding a simple RC filter to the analog input line. A suggested circuit could look like this (example is only for reference):

[ Battery + ]----[ 10kΩ Resistor ]----[ 100µF Capacitor ]----[ GND ]
                                   |
                        [ RUT955 Analog Input ]

This may help absorb short transient voltage dips and prevent false triggering.


Alternatively, a more advanced approach involving creating a custom script that reads the analog input value and sends an SMS only when it’s outside your defined threshold, with your own delay handling, could also be a workaround option. For example, the condition for checking the threshold and sending an SMS:

VOLTAGE=$(ubus call ioman.adc.adc0 status | jsonfilter -e '@.value')
if [ $(echo "$VOLTAGE < 11.5 || $VOLTAGE > 14.9" | bc) -eq 1 ]; then
  gsmctl -S -s "+<number> Voltage Alert: ${VOLTAGE}V"
fi

Of course, at the beginning a simple locking mechanism to exit if locked within the debounce period could be added. Example for reference:

if [ -f "$LOCKFILE" ]; then
    LAST_ALERT=$(stat -c %Y "$LOCKFILE")
    NOW=$(date +%s)
    if [ $((NOW - LAST_ALERT)) -lt $DEBOUNCE_TIME ]; then
        exit 0
    fi
fi
Full script for reference
#!/bin/ash

LOCKFILE="/tmp/voltage_alert.lock"
DEBOUNCE_TIME=120 # seconds
LOGFILE="/tmp/voltage_monitor.log"
PHONE="+XXXXXXXXXX" 
THRESHOLD_LOW=11.5
THRESHOLD_HIGH=14.9

# Simple locking mechanism — exit if locked within debounce period
if [ -f "$LOCKFILE" ]; then
    LAST_ALERT=$(stat -c %Y "$LOCKFILE")
    NOW=$(date +%s)
    if [ $((NOW - LAST_ALERT)) -lt $DEBOUNCE_TIME ]; then
        exit 0
    fi
fi

# Read current voltage via ubus — handle potential failure
VOLTAGE=$(ubus call ioman.adc.adc0 status 2>/dev/null | jsonfilter -e '@.value')
if [ -z "$VOLTAGE" ]; then
    echo "$(date) - ERROR: Unable to read voltage" >> "$LOGFILE"
    exit 1
fi

# Compare against thresholds using awk for float-safe comparison
if echo "$VOLTAGE" | awk -v low="$THRESHOLD_LOW" -v high="$THRESHOLD_HIGH" '{ exit !($1 < low || $1 > high) }'; then
    echo "$(date) - Voltage out of range: ${VOLTAGE}V" >> "$LOGFILE"
    gsmctl -S -s "$PHONE Voltage Alert: ${VOLTAGE}V"
    touch "$LOCKFILE"
fi

exit 0

Also, scripts always have to be made executable, e.g.:

chmod +x /path_to_script/script_name.sh

You could then schedule this script via crontab, for instance, to run every 5 seconds:

* * * * * for i in {0..11}; do /path_to_script/script_name.sh; sleep 5; done

More information on crontabs and user custom scripts can be found in the wiki articles below:

I hope this brings you some insights/suggestions for your specific use case.

Best regards,

Thanks for your response.
I will come back on this topic after my holidays.
(Need a desktop to follow up your request and suggestions)

A 10kOhm resistor with 100 microfarad capacitor will result in a filter time of 1 second, which is most likely efficient.
But…
When applying an extrrnal RC input filter, this will have impact on the measured analog value.
The influence depends on input impedance of the analog input. A RUT955 input impedance of 100k will result in 10% lower analog value measurement in this example.
Which brings me two additional questions:

  1. Can you provide the input impedance of the analog input of RUT955?
  2. Is there any way to correct the amplitude of the analog value measurement (to calibrate for influences of input impedance change)?

Hello,

Apologies for the delay in getting back to you.

I’ve forwarded your questions regarding the RUT955 analog input impedance and possible calibration options to our electronics team, as these details fall outside my current scope. I’ll be sure to get back to you as soon as I receive any feedback.

Thank you for your patience and understanding.

Best regards,