Watchcat and luci-app-watchcat update

Good day everyone,

I have started working on some features for the incredibly useful watchcat, and the corresponding luci-app-watchcat packages.

Merge Requests
watchcat
luci-app-watchcat

Main features added

  • support for restarting a network interface instead of rebooting the router
  • ping via a specific interface and restart that interface if the ping fails
  • support for specifying ping packet size
  • included a ModemManager-specific path of action
  • general refactor of the code: renaming variable names, aiming for style consistency
  • supports backward-compatibility with the old service type names: always, ping

The code needs another quick tidy up, and the commits need to be redone in order to make this modular and more easily acceptable/revertable, which I will do. Here is my plan for that:
A commit for each of the following:

  • the first refactor
  • the ping packet size feature
  • the restart_iface feature
  • the modemmanager specific features

I wanted to see if I should change the priorities a bit based on community feedback before starting the MR.

  • Should I make it so any service can be restarted, instead of just ModemManager?
  • Any other feedback?
7 Likes

what a kind, considerate and genuine soul...

  • trigger script

i'm thinking, '/etc/watchcat.user' ( aka /etc/udhcpc.user )... short term, provides the most extensible, modular framework.

probably as a list though... i.e. ' list user_script 'A''... the only downside of this method is lack of luci management...

suppose an additional built in sample/daemon script could overcome that... something like ... 'option watchcat_script 1'...

  • trigger hotplug events

in or out of the script/s above 'option hotplug_ifaceevents 1' or similar... :slight_smile:

Joined the forum just to say - I am really looking forward to your improvements. Especially the following two:

  • support for restarting a network interface instead of rebooting the router
  • ping via a specific interface and restart that interface if the ping fails

Since my IPv4 and v6 paths have different quirks.

(Longer version, my modem assigns a bogus IPv4, but not v6, address if it doesn't have connectivity)

1 Like

I like the idea to trigger hotplug events as it can give the user control to write their own actions. I’ll have to look into that more

1 Like

I'm looking forward to it. When will it be released?

The MR's are under review on github, we need to make sure everything is right before it gets in.


1 Like

Hey,
@thirtythreeforty, @jekseparo it's been merged into openwrt/packages, please give it a try

1 Like

try to install manually with scp by overwriting the existing files
I don't know how to install using opkg
looks like this

image

1 Like

Hey!

There have been some changes to luci-app-watchcat and watchcat; namely a rewrite in JavaScript, and moving Watchcat into its own /etc/config/watchcat file, respectively. Testing is welcome. At the moment there is a call for suggestions on how to support migration from the old system.@watchcat[n] UCI configuration to the new location via a UCI-defaults shell script. If anyone has any suggestions, feedback or code contributions feel free to jump into the conversation.

1 Like

suggestion
on the Mode: Restart Interface
to check if the wireless is in AP or STA mode,
So if we change the wireless interface from STA to AP and we forget to set the watchcat, the watchcat will automatically deactivate the interface restart mode.

Sorry my English is bad

I'm having trouble getting the current version 1-12 to work with mwan3 on 21.02. I have two wan connections. With version 1-7 on 19.07, as long as one of the two wan connections was up it wouldn't reboot. With v1-12 if the main wan connection goes down it will reboot even if the wanb connection is still up. Maybe I'm doing something wrong?

1 Like

I have the same problem. What are your interface to monitor and to rebbot?

I tried Ethernet Switch, br-lan and "unspecified".

Try my super simple script, copy it inside /etc/ and add "/etc/respawnLTE.sh &" in rc.local:

respawnLTE.sh

#!/bin/sh
while [ 1 ]; do
#ping 1 packet and wait an answer for 2 seconds
        ping -q -c 1 -W 2 -I wwan0 1.1.1.1 >/dev/null
        RESULT=$?
        if [ $RESULT -ne 0 ]; then
                /etc/init.d/modemmanager stop
                sleep 2
                /etc/init.d/modemmanager start
				sleep 60
                echo "ristarted"
        fi
# wait 10 seconds for the text ping
        sleep 10
done