Robotics 2025 concluded with 2 kids having built the small Etch-a-Sketch plotter after 5 sessions, and an extra one to just consolidate and draw. There isn’t much to say other than it went like a charm. I’ve added onto the Inherently Programmable Pi so they could have a basic HTML interface to their machine, I have yet to publish the update. This solution I feel is a bit of a game changer for engaging with robotics. At best it lowers the bar significantly for uninitiated learners; at worst it’s just darn convenient to get to work on your Pi project anywhere. A few years ago I’d promote it on a few online communities, these days I just don’t have the will to do much of anything online, but I really should.
Resilient SSH Tunnel
#!/bin/bash
tunnel_entrance_port=13306
tunnel_end=username@re.mo.te.ip
destination=127.0.0.1
destination_port=3306
# Use netcat to connect to tunnel entrance port. If its exit code is not zero, the tunnel needs to be brought up
nc -w1 localhost $tunnel_entrance_port > /dev/null
if [[ $? -ne 0 ]]; then
echo "creating new tunnel for MySQL"
/usr/bin/ssh -f -N -L $tunnel_entrance_port:$destination:$destination_port $tunnel_end
if [[ $? -eq 0 ]]; then
echo " tunnel to $destination through $tunnel_end created successfully"
else
echo " an error occurred creating a tunnel to $destination through $tunnel_end"
fi
fi
Script to reboot a Comtrend AR-5381u Modem when connectivity is lost
#!/bin/bash
# default username for this model
export MODEMUSERNAME=admin
# default password for model
export MODEMPASSWORD=user12345
export COOKIE=/tmp/cookie_jar
export CURL=/usr/bin/curl
export PING=/bin/ping
export GREP=/bin/grep
export CUT=/usr/bin/cut
$PING -c 5 google.com > /dev/null 2>&1
if [ $? -ne 0 ]
then
rm $COOKIE > /dev/null 2>&1
export OUTPUT=`$CURL -v -c $COOKIE 'http://$MODEMUSERNAME:$MODEMPASSWORD@192.168.1.1/resetrouter.html' 2>> /tmp/output`
export SESSIONKEY=`echo "$OUTPUT" | $GREP var | $GREP sessionKey | $CUT -d"=" -f2 | $CUT -d"'" -f2`
echo "kicking modem with session key $SESSIONKEY"
export OUTPUT=`$CURL -v -c $COOKIE "http://$MODEMUSERNAME:$MODEMPASSWORD@192.168.1.1/rebootinfo.cgi?sessionKey=$SESSIONKEY" 2>> /tmp/output`
fi

