Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
96c65a3
Add script to monitor connections to prefer Ethernet over PPP
jchonig Nov 15, 2025
8684b4e
Linting of conduit_leds
jchonig Nov 15, 2025
8192b1b
Adjust monit alerts as scripts use more memory and CPU
jchonig Nov 15, 2025
dc386f5
Fix name of ntp.defaults file and clean up turds
jchonig Nov 15, 2025
7e43261
Fix error when there is no network
jchonig Nov 15, 2025
9ded481
fixup! Add script to monitor connections to prefer Ethernet over PPP
jchonig Nov 16, 2025
d9ee533
check_leds: Fix error with duplicate processes
jchonig Nov 16, 2025
2fccd79
Increase basic station tc_timeout on cellular
jchonig Nov 16, 2025
67d798a
Modify the real ppp_on_boot, not the link
jchonig Nov 16, 2025
0e14e9c
Fix configuration of ppp to align w/mlinux
jchonig Nov 16, 2025
5794a84
Fix lock context manager to not overwrite pid file
jchonig Nov 19, 2025
3b70f84
Lint
jchonig Nov 19, 2025
96c5e1a
Have autossh check status more often
jchonig Nov 19, 2025
941700d
Pass AUTOSSH_ environment settings to autossh
jchonig Nov 20, 2025
f08eff4
Do not need do_restart hack from ssh_tunnel
jchonig Nov 20, 2025
5ffb9db
Do not error on calls w/o env variables
jchonig Nov 20, 2025
326dec7
Remove extension from progname
jchonig Nov 20, 2025
a26cbdc
Rewrite
jchonig Nov 20, 2025
0321750
Improve check for ppp running
jchonig Nov 20, 2025
fb69bda
Summarize failed sections at end
jchonig Nov 20, 2025
b6e1711
Initialize logging after we daemonize.
jchonig Nov 21, 2025
fda8cb9
Do not restart services when link comes up the first time
jchonig Nov 21, 2025
a5739e8
Include mlinux-version info in semtech version report
jchonig Nov 21, 2025
4dfc40d
Make check_leds and monitor_modem init.d scripts more informative
jchonig Nov 24, 2025
def0727
Log more status all the time
jchonig Nov 24, 2025
0804b51
Collect facts about mts-io f/s
jchonig Nov 26, 2025
2dfe12a
Use mts-io/has_radio to check for the presence of cellular
jchonig Nov 26, 2025
11927b0
Lint firmware.fact
jchonig Nov 26, 2025
5617c9a
Fix logging setup (indentation)
jchonig Nov 26, 2025
267481f
Properly catch socket errors on Python 2.7
jchonig Nov 26, 2025
d43b691
Ensure we don't create empty logging handlers
jchonig Nov 26, 2025
15c21af
Lint
jchonig Nov 30, 2025
8851866
Use has-radio instead of checking for presense of a device
jchonig Nov 30, 2025
d36194f
Fix use before set when radio-cmd fails
jchonig Nov 30, 2025
2e62dac
Only mark broadcast intf as failed if it fails for 5 cycles
jchonig Nov 30, 2025
7b19cd0
Improve logging
jchonig Nov 30, 2025
c116cae
Document status LEDs
jchonig Dec 5, 2025
e186ca7
Linting
jchonig Dec 8, 2025
9bf58d7
LED A now indicates that we are using PPP
jchonig Dec 8, 2025
7fcb221
Add a bit more time for DNS timeout
jchonig Dec 8, 2025
f7a2965
Improve logging from monitor_modem
jchonig Dec 8, 2025
99d1f13
Prevent ^C and exceptions from resetting LEDS when not locked
jchonig Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/mt_station_conf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def parse_args():
group.add_argument("--log-file",
dest="log_file",
help="Log file name")
group.add_argument("--tc-timeout",
dest="tc_timeout",
type=int,
help="Set tc_timeout value in seconds")

options = parser.parse_args()
if options.debug:
Expand Down Expand Up @@ -164,6 +168,13 @@ def main():
if options.gps:
data['station_conf']['gps'] = options.gps
data['station_conf']['pps'] = "fuzzy" if options.fuzzy_pps else "gps"
if options.tc_timeout:
for key in data['station_conf'].keys():
if key.lower() == "tc_timeout":
data['station_conf'][key] = "%ds" % options.tc_timeout
break
else:
data['station.conf']["tc_timeout"] = "%ds" % options.tc_timeout

print(json.dumps(data, indent=4))

Expand Down
21 changes: 20 additions & 1 deletion roles/conduit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ The following tags can be used to run a subset of the playbook.
<dd>Sets up an ssh tunnel back to a control host<dd>
</dl>

LED Status
----------

On Conduits (not Conduit APs), the LED indications are:

| LED | Meaning |
|--------|------------------------------------------------------------------------------------------------------|
| Status | Blinks twice a second when the OS is running |
| LS | Blicks every couple seconds when Cellular modem is connected |
| A | We are trying to use PPP |
| B | An SSH tunnel connection to the jump host is in Established state |
| C | A packet forwarder is running and has the LoRa device open (does not work on I2C cards running mp) N |
| D | DNS resolution of google.com works |

The A-D LEDs are the ones on the right and have different lables on
older Conduits (CD and one to 3 bars).

The A-D LEDs reverse periodically to indicate that the check program
is running.

License
-------

Expand All @@ -123,4 +143,3 @@ Author Information
------------------

Jeffrey Honig <jch@honig.net>

9 changes: 8 additions & 1 deletion roles/conduit/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ ssh_tunnel_ssh_key: /etc/ssh/ssh_host_rsa_key
ssh_tunnel_daemon: /usr/bin/autossh
ssh_tunnel_ssh_port: 22
ssh_tunnel_base_port: 0
ssh_tunnel_first_poll: 120
ssh_tunnel_poll: 60

# Static Nameserver defaults
resolv_conf_static: /var/config/network/resolv.conf-static
Expand Down Expand Up @@ -176,11 +178,16 @@ monit_pktfwd_stop: '"/etc/init.d/{{ monit_pktfwd_initscript }} stop"'
monit_pktfwd_restart: '"/etc/init.d/{{ monit_pktfwd_initscript }} restart"'
monit_pktfwd_reboot: 'exec "/sbin/reboot"'

# Monit loadavg
monit_loadavg_1m: 2
monit_loadavg_5m: 4
monit_memory_usage: 30%

# Monitor space on /
monit_root_test: "usage > 50%"

# Monitor space on /var/config
monit_config_test: "usage > 15%"
monit_config_test: "usage > 20%"

# Monitor space on /var/volatile
monit_volatile_test: "usage > 75%"
Expand Down
52 changes: 43 additions & 9 deletions roles/conduit/files/conduit_leds.initd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
[ -x ${DAEMON} ] || exit 0

is_running() {
pgrep -F ${PIDFILE} > /dev/null
pgrep -F ${PIDFILE} > /dev/null 2>&1
}

start() {
Expand All @@ -40,22 +40,56 @@ stop() {

case "$1" in
start)
is_running || start
if is_running; then
echo "${NAME} is already running: $(pgrep -F ${PIDFILE} -a)" >&2
exit 1
fi
echo "Starting ${NAME}" >&2
start
;;
stop)
stop
if is_running; then
echo "Stopping ${NAME}" >&2
stop
else
echo "${NAME} is not running" >&2
fi
;;
restart|reload)
nohup ${0} do_restart
;;
do_restart)
stop
if is_running; then
echo "Stopping ${NAME}" >&2
stop
else
echo "${NAME} is not running" >&2
fi

# Wait for it to stop
tries=10
while is_running; do
if [ "${tries}" -eq 0 ]; then
echo "${NAME} failed to stop" >&2
exit 1
fi
tries=$((tries - 1))
sleep 1
done

echo "Starting ${NAME}" >&2
start
;;
status)
is_running
if is_running; then
echo "${NAME} is running with PID $(pgrep -F ${PIDFILE} -a)" >&2
else
echo "${NAME} is not running" >&2
exit 1
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
echo "Usage: $0 {start|stop|status|restart}" >&2
exit 2
;;
esac

exit 0
#=========================================
Loading