How's your uptime

Flint1

WG VPN Server, Dual WiFi, Adguard with Hagezi Pro list.

Always less than 24h because there is a scheduled restart each night :wink:

1 Like

Haha yeah it's a good housekeeping idea no doubt.!
:grinning:

I guess that I should mention that my Spitz AX is in my RV and running continuously off of 12 volt power. Its got an active cell connection and its also connected to my Starlink Mini as WiFi-as-WAN ("repeater" mode), it also operates as a NAS with an 8TB SSD and a 4TB M.2 (both connected via USB) with a half-dozen SMB shares, and it has an always-on OpenVPN connection to my VPS. Oh, I'm also using the Spitz AX's built-in GPS to regularly log my RV's location to a private map.

I think that the last reboot was for a firmware update.

4 Likes

When I installed the firmware 4.6.8, I never restarted it, so the uptime was about 2 months (the firmware was released on the 17th of Oct).

I installed 4.7.0-op24 and I also never restarted it:

@RVer : could you give us your detailed GPS configuration instructions? Including the private map connectivity? I am in the same situation and really would like to see GPS coming as a standard plugin from GLinet....

could you give us your detailed GPS configuration instructions

I'm sorry - I don't have a drop-in solution for what you're looking for. I have a VPS on which I host a number of services, there's a lot of custom code that links it all together that I've written over the past 20 years. Even the mapping itself (I use OpenStreetMaps API) is entwined with mapping data from my Garmin InReach. At this point in life noone could pay me enough to build out a solution for what you're looking for; not to mention that I don't have the patience to support it.

Instead, I'll point you to a thread which describes how to get the X3000's GPS service up-and-running. Although I don't use it, the thread also includes instructions on getting gpsd up and running (gpsd is an open service for sharing GPS data to other devices on your LAN): [howto] GL-X3000 GPS configuration guide

I'll also share this (b)ash script which pulls and logs the GPS data every 2 hours and uploads it (using scp) to a server every 12 hours. Its run as a cron script every 10 minutes.

NOTE: I WILL NOT PROVIDE SUPPORT FOR THIS SCRIPT. I share it only as an example of what I've done with my GL-X3000 and hope that maybe it'll give someone some inspiration for their own project. The script will not just drop-in and run - obviously, it has to be configured for the router and server; it also assumes than an SSH-key has been created+installed to support the scp. And, undoubtedly, there are some dependancies which need to be installed (bc for example, and I'm sure there are more). Oh - one more thing - I've found that dropbear + ssh/scp has an issue with latenacy; at some point where latency gets too high it just won't work reliably; on my X3000, I've replaced dropbear with openssh-server to get around the issue.

#!/bin/sh

# Log router's GPS location and periodically upload to server


appName=${0##*/}
appName=${appName%.*}

PIDFile=/tmp/$appName.pid
GPSLogFn=/tmp/mountd/disk1_part1/gpslogger/${appName}.log
lastUploadFn=/tmp/${appName}.lastUpload

updateSeconds=$((1 * 60 * 60 + 56 * 60))
uploadSeconds=$((11 * 60 * 60 + 56 * 60))

scpPort=22
scpFolder=<username>@<server>:/gpslogger/rv/

isErr=0
isUpdate=0
isUpload=0

dt=
lat=
lng=
alt=



# Check that process is not currently running

if [ -f $PIDFile ]; then
  CheckPID=`cat $PIDFile`
  res=`ps | grep "\s*$CheckPID\s.*"`
  if [ -n "$res" ]; then
    exit
  fi

  rm $PIDFile
fi

echo "$$" >$PIDFile



# Check if its time to update

if [ $isErr -eq 0 ] && [ $isUpdate -eq 0 ]; then
  if [ -f $GPSLogFn ]; then
    if [ $((`date +%s` - `date +%s -r "$GPSLogFn"`)) -ge $updateSeconds ]; then
      isUpdate=-1
    fi
  else
    isUpdate=-1
  fi 
fi



# Check if its time to upload

if [ $isErr -eq 0 ] && [ $isUpload -eq 0 ]; then
  if [ ! -f $lastUploadFn ]; then
    if [ -f $GPSLogFn ]; then
      dtLogFn=`ls --full-time -lc -n $GPSLogFn | /bin/grep -oE "\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}"`
      /bin/touch -d "$dtLogFn" $lastUploadFn
    else
      /bin/touch $lastUploadFn
    fi
  fi

  if [ $((`date +%s` - `date +%s -r "$lastUploadFn"`)) -ge $uploadSeconds ]; then
    isUpload=-1
  fi
fi



# Start log

if [ $isErr -eq 0 ]; then
  if [ $isUpdate -ne 0 ] || [ $isUpload -ne 0 ]; then
    echo "`date -u +%H:%M` $appName - Create/Upload GPS Track"
    echo "`date -u +%H:%M` `date -u +%Y-%m-%d`"
  fi
fi




# add to log file

if [ $isErr -eq 0 ] && [ $isUpdate -ne 0 ]; then
  exec 3</dev/mhi_LOOPBACK
  for i in $(seq 1 20); do
    read -t1 li <&3
    regex="^\\\$GPGGA,[0-9]{6}.[0-9]+,[0-9]{4}.[0-9]+,[NS],[0-9]{5}+.[0-9]+,[EW],[^,]*,[^,]*,[^,]*,[0-9.]+,[M],.*$"
    if [[ $li =~ $regex ]]; then
      dt=`echo $li | cut -d "," -f 2`
      dt="`date -u +%Y-%m-%d`T${dt:0:2}:${dt:2:2}:${dt:4:2}.000Z"

      lat=`echo $li | cut -d "," -f 3`
      lat=`echo "scale=0; x=$lat/100; scale=6; x + ($lat - x*100)/60" | bc -l`
      ind=`echo $li | cut -d "," -f 4`
      if [ "$ind" = "S" ]; then lat=-$lat; fi

      lng=`echo $li | cut -d "," -f 5`
      lng=`echo "scale=0; x=$lng/100; scale=6; x + ($lng - x*100)/60" | bc -l`
      ind=`echo $li | cut -d "," -f 6`
      if [ "$ind" = "W" ]; then lng=-$lng; fi

      alt=`echo $li | cut -d "," -f 10`
      ind=`echo $li | cut -d "," -f 11`
    fi
  done
  exec 3<&-

  if [ ! -z "$dt" ] && [ ! -z "$lat" ] && [ ! -z "$lng" ]; then
    if [ ! -z "$alt" ]; then alt="<ele>$alt</ele>"; fi
    echo "<trkpt lat=\"$lat\" lon=\"$lng\">$alt<time>$dt</time><src>gps</src></trkpt>">>$GPSLogFn
    echo "`date -u +%H:%M` logged lat=$lat lng=$lng alt=$alt"
  else
    echo "`date -u +%H:%M` ERROR - Incomplete GPS info.  Skipping log. : lat=$lat lng=$lng alt=$alt"
#    isErr=-1
  fi
fi




# zip & upload file to server

if [ $isErr -eq 0 ] && [ $isUpload -ne 0 ] && [ -f $GPSLogFn ]; then
  dt=`date -u +"%Y-%m-%d %H:%M:%S"`
  dtLog=`date -u -d "$dt" +"%Y-%m-%dT%H:%M:%S.000T"`
  trackName=`date -u -d "$dt" +"%Y%m%d%H%M"`

  tmpFolder="/tmp/$appName"
  if [ -d $tmpFolder ]; then rm -rf $tmpFolder; fi
  mkdir $tmpFolder
  tmpFn=$tmpFolder/$trackName.gpx
  tmpZipFn=$tmpFolder/$trackName.zip

  echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" >$tmpFn
  echo "<gpx version=\"1.0\" creator=\"GPSLogger\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.topografix.com/GPX/1/0\" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd\">" >>$tmpFn
  echo "<time>$dtLog</time>" >>$tmpFn
  echo "<trk><name>$trackName</name><trkseg>" >>$tmpFn
  cat $GPSLogFn >>$tmpFn
  echo "</trkseg></trk></gpx>" >>$tmpFn

  # kludge: have to use ziptool as zip package is not available
  if [ $isErr -eq 0 ]; then
    /usr/bin/ziptool $tmpZipFn add_file $trackName.gpx $tmpFn 0 0
    res=$?
    if [ $res -ne 0 ]; then
      echo "`date -u +%H:%M` ERROR zipping GPS track"
      isErr=-1
    fi
  fi

  if [ $isErr -eq 0 ]; then
    /usr/bin/scp -P $scpPort $tmpZipFn $scpFolder
    res=$?
    if [ $res -eq 0 ]; then
      echo "`date -u +%H:%M` SUCCESS uploading GPS track"
    else
      echo "`date -u +%H:%M` ERROR uploading GPS track"
      isErr=-1
    fi
  fi

  if [ -d $tmpFolder ]; then rm -rf $tmpFolder; fi

  if [ $isErr -eq 0 ]; then
    rm -f $GPSLogFn
    /bin/touch $lastUploadFn
  fi
fi



# cleanup

rm -f "$PIDFile"


return 0

3 Likes

38 days and counting...

4.7.0-op24

I'm on a good run so far. Not finding a real need to reboot, although I know it would be good housekeeping to do a nightly reboot.

hope my old trusty Slate is still the record holder:

3 Likes

Probably worth to update it to avoid missing some security updates :slight_smile:

1 Like

As you can imagine, I am interested in that project :slight_smile: is it written down, somewhere?

At home I nearly don't check my uptimes .. a few weeks maybe, before I start to make all new again. And on some routers I play a little wit the OpenWrt firmware.

In my RV the uptime is usually a few hours or up to 3 days. I am not so brave as @RVer , to let it connected 24/7 :slight_smile:

Nah, would hate to lose my record. Just basic client VPN casual browsing in a double NAT situation and very low risk stuff really. Cheers @Renato .

1 Like

Nearly 90 days, to my surprise. I haven't been keeping track of it but I may have to end the streak before the actual 90-day mark for a firmware update.

2 Likes