FlightAware Discussions

RPIMonitor

Thanks to @mikkyo for sharing the link and instructions for RPIMonitor! I have it up & running using his “Avionics” config, and it will simplify my browser tab situation a great deal.

I do have a question though. Been fighting this one config thing all afternoon…

I have VRS running on a separate Debian VM, and pulling data from my Pi, which is where my antenna/filter/SDR is attached, and where RPIMonitor is installed. Since it’s not local, RPIMonitor can’t verify its Online/Offline state using the “netstat -nlt” test in the config file.

I changed the test to one using nmap to verify that something was listening on port 8080 on that server, figuring that was better than nothing. I tested with the interactive command line tool (very slick, btw), and came up with this:

dynamic.5.name=vrs
dynamic.5.source=nmap 192.168.0.9 -p 8080
dynamic.5.regexp=(open)

This works correctly as far as the interactive tool is concerned, returning “open” if the server is running.

I changed the test on the web.status line to test whether or not data.vrs contains “open”, but I am getting “inactive” no matter what I do. Unless I invert the logic (which doesn’t really help).

Label(data.vrs,"==open","active","success") + Label(data.vrs,"!=open","inactive","danger")

I tried taking all of that out and just using data.vrs, and it definitely is returning “open”, so I am thinking that the problem lies in using == for the comparison operator…but I am at a loss for what to replace it with.

It’s a little thing, but it feels incomplete.

Any tips? Ideas? Suggestions for a better solution? Thanks!

Edit: Ok, I feel dumb… it’s a string - it needs to be in quotes…

This is what worked:

Label(data.vrs,"=='open'","active","success") + Label(data.vrs,"!='open'","inactive","danger")

I just needed to enclose the string that I wanted to compare in single quotes: ‘open’

Below are links to the discussion about RPIMonitor that veered off from the Airspy ADSB Decoder thread:

This post from @mikkyo discusses setting up RPIMonitor, including a sample avionics.conf

This post, also from @mikkyo has a sample cpu.conf to add CPU throttling info to the display:

@nitr0 added some config for adding AirSpy info:

And @mikkyo added GPU temp info:

I appreciate everyone for sharing, hopefully having everything all in one place will be helpful.

1 Like

Thanks for starting a thread, I wasn’t sure if the admins of this thing could move posts around.

Folks will probably want to see what we are talking about

Thanks for the screenshot!

I think I have everything working now, including monitoring my separate DNS server!

The thing that’s driving me nuts now is that the docs say that you can rearrange the status page via drag & drop, but it sure isn’t working for me. Did you do something special to get it into 3 columns? Or is that just a byproduct of a wide monitor?

It adjusts with width of display.
There is probably a way to configure it but I haven’t read through all the docs.
You can shrink your content if you don’t have enough display room using the browser Zoom.

The pi 4 (and I think 3b+) can show whether they are soft throttled, which is when they slow down for thermal management. This is also shown in the vcgencmd get_throttled command.

You can add it to the cpu.conf to display it:
image

dynamic.29.name=softthrottled
dynamic.29.source=vcgencmd get_throttled
dynamic.29.regexp=throttled=(.*)
dynamic.29.postprocess=$1&0x8
dynamic.29.rrd=

dynamic.30.name=hassoftthrottled
dynamic.30.source=vcgencmd get_throttled
dynamic.30.regexp=throttled=(.*)
dynamic.30.postprocess=$1&0x80000
dynamic.30.rrd=

and

web.status.1.content.1.line.15="<tr>"
web.status.1.content.1.line.16="<td>Soft Throttled:</td><td>" + Label(data.softthrottled,"==0","no","success") + Label(data.softthrottled,"!=0","yes","danger")+ "</td><td>" + Label(data.hassoftthrottled,"==0","no","success") + Label(data.hassoftthrottled,"!=0","yes","danger")+ "</td>"
web.status.1.content.1.line.17="</tr>"

You need to adjust the line numbers to fit your config however.

1 Like

If some of you are like me and have a drawer full of SBC’s, I found it useful to show the board I’m using (top left):

Here is the template:

sudo tee /etc/rpimonitor/template/version.conf > /dev/null <<EOF
########################################################################
# Extract System information
#  Page: 1
#  Information               Status     Statistics
#  - distribution name       - yes      - no
#  - kernel version          - yes      - no
#  - firmware version        - yes      - no
#  - processor model         - yes      - no
#  - num of pkg upgradable   - yes      - no
#  - list of pkg upgradable  - yes      - no
########################################################################
static.1.name=distribution
static.1.source=/etc/os-release
static.1.regexp=PRETTY_NAME.\"(.*)\"
static.1.postprocess=

static.2.name=kernel_version
static.2.source=uname -msr
static.2.regexp=(.*)
static.2.postprocess=

static.3.name=firmware
static.3.source=/proc/version
static.3.regexp=(#\d+)
static.3.postprocess=

static.4.name=processor
static.4.source=/proc/cpuinfo
static.4.regexp=(?:Processor|model name|Hardware)\s+: (.*)
static.4.postprocess=

static.5.name=board
static.5.source=/proc/device-tree/model
static.5.regexp=(.*) 
static.5.postprocess=
snmp.board.id=5
snmp.board.type=string 
snmp.board.description=board 
snmp.board.postprocess=

dynamic.1.name=upgrade
dynamic.1.source=/var/lib/rpimonitor/updatestatus.txt
dynamic.1.regexp=(\d+ upgradable\(s\)|.*&nbsp;.*)
dynamic.1.postprocess=
dynamic.1.rrd=

dynamic.2.name=packages
dynamic.2.source=/var/lib/rpimonitor/updatestatus.txt
dynamic.2.regexp=^\s+(.*)\s+\d+ upgradable
dynamic.2.postprocess=
dynamic.2.rrd=

web.status.1.content.1.name=Version
web.status.1.content.1.icon=version.png
web.status.1.content.1.line.1='Processor: <b>' + data.processor + " - " + data.board + '</b>'
web.status.1.content.1.line.2='Distribution: <b>'+ data.distribution + '</b>'
web.status.1.content.1.line.3='Kernel version: <b>' + data.kernel_version + '</b>'
web.status.1.content.1.line.4='Firmware: <b>' + data.firmware + '</b>'
web.status.1.content.1.line.5='Package(s): <b>' + data.upgrade + '</b>' + ShowInfo('packages','Package(s) upgradable(s)',data.packages)
EOF
3 Likes

Please how do you do to have the process list in the CPU section ?

Thanks !

Ok forget my question i found the solution with the TOP3 add-ons ;+)

The top3 is the easiest way, but you might want to dial back how often it samples.

To set up

sudo cp /usr/share/rpimonitor/web/addons/top3/top3.cron /etc/cron.d/top3

and use your favorite editor to uncomment(remove the #) in front of this line in
/etc/rpimonitor/template/cpu.conf

#web.status.1.content.1.line.18=InsertHTML("/addons/top3/top3.html")

The cronjob runs every minute, which probably isn’t necessary for most folks (contents of top3.cron)

* * * * * root cd /usr/share/rpimonitor/web/addons/top3; ./top3 > top3.html

It runs the script
/usr/share/rpimonitor/web/addons/top3/top3
to generate the top3.html section(on disk) it inserts.

If you want more than the top 3 processes plus rpimonitor, edit that file and change the variable nbtop your desired number
my $nbtop=5;
image

If you are refreshing your top processes every minute, you might as well turn on auto refresh in rpimontior (see options in the menu on the web page).

1 Like

I don’t know about drag and drop, but when I want to change the ordering I just edit the main conf file
/etc/rpimonitor/data.conf
it lays them out in order of inclusion

include=/etc/rpimonitor/template/version.conf
include=/etc/rpimonitor/template/avionics.conf
include=/etc/rpimonitor/template/uptime.conf
include=/etc/rpimonitor/template/cpu.conf
include=/etc/rpimonitor/template/temperature.conf
include=/etc/rpimonitor/template/memory.conf
include=/etc/rpimonitor/template/swap.conf
include=/etc/rpimonitor/template/sdcard.conf
include=/etc/rpimonitor/template/network.conf

The tool supports quite a few other neat features…
Of course you can set up links to all your map/maintenance/info pages for easy access from one place, but you can also include an html page within the reporting page(think dump1090 mini page), and set up alerts for conditions as well.

So if you really want to go crazy, figure out how to get the alerting working for when the processes you monitor, like dump1090, is down, or notify if you get dropped mlat samples in the log, or one of your feeds goes offline.

Even crazier, set up a tracking list of aircraft type, or ICAO you want to know about, and have it check for those live in the aircraft log and alert you when one is nearby.

Thanks, that is how I have been handling the arranging, I was just intrigued by this:

Definitely planning to experiment with alerts at a later date!

Thanks for this thing !

Anyone know how change the Scalling Governor from “ondemand”, to “Performance” ?
Thanks !

Boot with Shift or

sudo sh -c "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"

but it won’t stay after reboot.

See this script

https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md

force_turbo
By default (force_turbo=0) the “On Demand” CPU frequency driver will raise clocks to their maximum frequencies when the ARM cores are busy and will lower them to the minimum frequencies when the ARM cores are idle.

force_turbo=1 overrides this behaviour and forces maximum frequencies even when the ARM cores are not busy.

Goes into /boot/config.txt
https://www.raspberrypi.org/documentation/configuration/config-txt/

Thanks mikkyo and wiedehopf for this two solutions !

But why would you do this?

On the RPi 3B+ i do the same but i’m not sure it’s a good idea or necessary on the RPi4.

I’ve found that ondemand can misbehave with some loads where you have a single thread that’s CPU-bound but happens to be bounced around between cores by the scheduler; then you have e.g. 4 CPUs each at 25% load which is not sufficient to trigger ondemand to speed up, even though that thread is actually bottlenecked by CPU speed.

1 Like

It is possible to tune the ondemand governor to switch frequencies at different usage levels. That can prevent that behaviour. To see the current setting do:
cat /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

The default is 50% usage I think. You can modify that figure to make it more or less responsive to load.