Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MikroTik Chateau CA / Neighbour / MIMO cell monitor scripts
#1
MikroTik's 4G LTE routers have the ability to show neighbouring 4G cells, a feature many others lack such as the popular Huawei and TP-Link routers. This is very useful for checking the signal and quality readings of the aggregated cells, particularly when repositioning the router or adjusting an external antenna. The MikroTik Chateau router series can also report readings of the different MIMO layers (via AT chat), which is also useful when using individual antennas. See this post on how to get 4x4 MIMO with external antennas on the Chateau 5G.

After upgrading to the V7.1rc1 firmware, I ran into a problem with the built-in cell-monitor command. It now only lists a few neighbouring cells, even on V7.1rc2 at this time of posting. Another issue is that the main LTE status page does not show the signal readings of the aggregated cells, requiring the user to cross-check the aggregated cells with the (broken) cell-monitor list.

As a workaround, I wrote a few scripts to show aggregated cells, MIMO layers (primary carrier only) and neighbouring cells, all which refresh every second. Up until recently, I have never written MikroTik scripts, so these scripts will probably look messy to any seasoned MikroTik user.

Notice: These scripts have only been tested in 4G LTE mode with an active 4G connection. They will not produce any output in 3G WCDMA. In 5G NSA mode, they will only show LTE cells as I don't have any 5G coverage at this time to update for 5G read-outs. Please do not run in them in a production environment.

How to add a script

  1. In Winbox, go into System -> Scripts.
  2. Click the '+' icon.
  3. In the "Name:" field, give it a name like "camonitor".
  4. Copy and paste the script in the white area below, then click 'OK'.
  5. Repeat the steps for each script, giving each a separate name for step 3.

How to run a script

In the terminal, type:
/system script run [script name]

For example, if the script is called "camonitor", type:
/system script run camonitor

The script will run in a loop, refreshing the readings every second, much quicker than the Router OS built-in cell-monitor command. Type 'Q' to stop or 'P' to pause. Press 'D' to dump the readings above. Note: It does not save them to file.


Carrier Aggregation Cell Monitor

Display the RSRP, RSRQ and SINR readings of the primary (PCC) and aggregated (SCC) cells. At present, the A03 firmware (preinstalled on the Chateau 5G) has a bug that causes incorrect SINR read-outs for the aggregated cells. This is reportedly fixed in the A04 firmware.

   

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "CA  PCI\tBAND BW\tEARFCN\tRSRP\tRSRQ\tRSSI\tSINR"
    /terminal style none
}
$headings

# Bandwidth to MHz conversion
set $bandwidth {"6"="1.4";"15"="3";"25"="5";"50"="10";"75"="15";"100"="20"}

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position and note previous line count
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $pcount $count
    set $count 0
    
    # Get the list of carrier aggregation cells from using the modem at-chat command
    set $cells [pick [/interface lte at-chat lte1 input="at+qcainfo" as-value ] 0]

    # Loop through each LTE cell
    set $i [find $cells "QCAINFO"]
    while ($i>0) do={
        set $cell [ toarray "" ]
        set $output ""
        set $i ($i+9)
    
        # Retrieve the raw type, EARFCN, bandwidth, band, PCI, RSRP, RSRQ, RSSI and SINR
        for n from=1 to=9 do={
            set $j [find $cells "," $i]
            # set $output ($output . [pick $cells ($i+1) $j] . "\t")
            set ($cell->$n) [pick $cells ($i+1) $j]
            set $i $j
        }
        set $sinr ([tostr ([tonum [pick $cells ($i+1) [find $cells "\r" $i]]] * 2 - 20)])
        set $band ("B" . ([pick ($cell->4) 10 ([len ($cell->4)]-1)]) . " ")

        # Prepare and display output
        if ([find ($cell->1) "pcc"]=0) do={set $output "PCC"} else={set $output "SCC"}
        set $output ($output . " " . ($cell->6) . "\tB" . ([pick $band 1 3]) . " " . \
            ($bandwidth->($cell->3)) . "M\t" . ($cell->2) . \
            "\t" . ($cell->7) . "\t" . ($cell->8) . "\t" . ($cell->9) . "\t" . $sinr)
        /terminal el; put $output
    
        # Go to the next LTE cell
        set $i [find $cells "QCAINFO" $i]
        set $count ($count+1)
    }

    # Clear any extra lines from the previous run
    /terminal el
    for n from=($count+1) to=$pcount step=1 do={put ""; /terminal el}
    for n from=($count+1) to=$pcount step=1 do={/terminal cuu}

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el


Neighbour Cell Monitor

Works much like the Router OS cell monitor, but refreshes the readings every second. It lacks the age column. It will display the full list of neighbouring cells even on V7.1rc1 and V7.1rc2.

   

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "EARFCN\tPCI\tRSRQ\tRSRP\tRSSI"
    /terminal style none
}
$headings

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position and note previous line count
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $pcount $count
    set $count 0
    
    # Get the list of neighbour cells from using the modem at-chat command
    set $cells [pick [/interface lte at-chat lte1 input="at+qeng=\"NEIGHBOURCELL\"" as-value ] 0]

    # Loop through each LTE cell
    set $i [find $cells "LTE"]
    while ($i>0) do={
        set $output ""
        set $i ($i+4)
    
        # Retrieve the EARFCN, PCI, RSRQ, RSRP and RSSI, then print these
        for n from=1 to=5 do={
            set $j [find $cells "," $i]
            set $output ($output . [pick $cells ($i+1) $j] . "\t")
            set $i $j
        }
        /terminal el; put $output
    
        # Go to the next LTE cell
        set $i [find $cells "LTE" $i]
        set $count ($count+1)
    }

    # Clear any extra lines from the previous run
    /terminal el
    for n from=($count+1) to=$pcount step=1 do={put ""; /terminal el}
    for n from=($count+1) to=$pcount step=1 do={/terminal cuu}

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el;


MIMO Layer Signal Readings

With an AT chat command, the modem can display the RSRP, RSRQ and SINR readings of each MIMO layer for the primary cell. This is particularly useful when checking or adjusting multiple antennas, such as with 4x4 MIMO when using the high frequency bands. In 2x2 MIMO, the 3rd and 4th layer will show -140 for the RSRP.

   

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "MIMO\tL1\tL2\tL3\tL4"
    /terminal style none
}
$headings

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $count 3
    
    # Get the RSRP, RSRQ and SINR readings using the modem at-chat command
    set $rsrp [pick [/interface lte at-chat lte1 input="at+qrsrp" as-value ] 0]
    set $rsrq [pick [/interface lte at-chat lte1 input="at+qrsrq" as-value ] 0]
    set $sinr [pick [/interface lte at-chat lte1 input="at+qsinr" as-value ] 0]

    set $i 7
    set $output "RSRP\t"
    for n from=1 to=4 do={
        set $j [find $rsrp "," $i]
        set $output ($output . [pick $rsrp ($i+1) $j] . "\t")
        set $i $j
    }
    /terminal el; put $output

    set $i 6
    set $output "RSRQ\t"
    for n from=1 to=3 do={
        set $j [find $rsrq "," $i]
        set $output ($output . [pick $rsrq ($i+1) $j] . "\t")
        set $i $j
    }
    set $output ($output . [pick $rsrq ($i+1) [find $rsrq "\r" $i]])
    /terminal el; put $output

    set $i 6
    set $output "SINR\t"
    for n from=1 to=3 do={
        set $j [find $sinr "," $i]
        set $output ($output . ([tonum [pick $sinr ($i+1) $j]] * 2 - 20) . "\t")
        set $i $j
    }
    set $output ($output . [([tonum [pick $sinr ($i+1) [find $sinr "\r" $i]]] * 2 - 20)])
    /terminal el; put $output

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el;
Reply
#2
MikroTik firmware V7.1rc4 appears to have fixed the built-in cell monitor.

There are a few differences between the built-in cell monitor and the above script:
  • The script refreshes the readings quicker, i.e. every second vs 3-4 seconds.
  • The built-in cell monitor shows the band numbers. See updated script below for band # read out.
  • The built-in cell monitor shows the age of each line, which the script does not.

Modem firmware 11.04 notes

The Carrier Aggregation Cell Monitor script is broken in this firmware version, which I cannot fix. This firmware has broken the "at+qcainfo" AT-CHAT command: It no longer reports all the aggregated cells (2 instead of 3 for me). The signal readings it reports for the SCC cells are the same as what it reports for the primary cell.

This firmware has altered the output for the at+q AT-CHAT commands. Use the following code for the MIMO Layer Signal Readings script:

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "MIMO\tL1\tL2\tL3\tL4"
    /terminal style none
}
$headings

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $count 3
    
    # Get the RSRP, RSRQ and SINR readings using the modem at-chat command
    set $rsrp [pick [/interface lte at-chat lte1 input="at+qrsrp" as-value ] 0]
    set $rsrq [pick [/interface lte at-chat lte1 input="at+qrsrq" as-value ] 0]
    set $sinr [pick [/interface lte at-chat lte1 input="at+qsinr" as-value ] 0]

    set $i 7
    set $output "RSRP\t"
    for n from=1 to=4 do={
        set $j [find $rsrp "," $i]
        set $output ($output . [pick $rsrp ($i+1) $j] . "\t")
        set $i $j
    }
    /terminal el; put $output

    set $i 6
    set $output "RSRQ\t"
    for n from=1 to=4 do={
        set $j [find $rsrq "," $i]
        set $output ($output . [pick $rsrq ($i+1) $j] . "\t")
        set $i $j
    }
    /terminal el; put $output

    set $i 6
    set $output "SINR\t"
    for n from=1 to=4 do={
        set $j [find $sinr "," $i]
        set $output ($output . [pick $sinr ($i+1) $j] . "\t")
        set $i $j
    }
    /terminal el; put $output

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el;


Neighbour Cell Monitor with band number

As the neighbourcell AT-CHAT command does not report the band #, I have updated the cell monitor script posted below to look-up the band number, shown as an additional column. I have not tested this script in areas with large numbers of neighbouring cells, so have left the original code without the band # lookup in the above post.

The cell monitor scripts work with both modem firmware versions 11.03 and 11.04.

   

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "BAND\tEARFCN\tPCI\tRSRQ\tRSRP\tRSSI"
    /terminal style none
}
$headings

# Reset counters
set $count 0
set $pcount 0

# EARFCN to band lookup
set $band (0, 600,  1200, 1950, 2400, 2650, 2750, 3450, 3800, 4150, \
           4750, 4950, 5180, 5280, 5380, 0, 0, 5850, 6000, 6150, \
           6450, 6600, 7400, 7700, 8040, 8690, 9040, 9210, 9660, 9770, \
           9870, 9920, 10360, 36200, 36350, 36950, 37550, 37750, 38250, 38650, \
           39650, 41590, 43590, 45590, 46590, 46790, 54540, 55240, 56740, 0, \
           0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66436, 67336, 67536, 67836, 68336, 68586)

# Loop until a keystroke
do {
    # Reset cursor position and note previous line count
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $pcount $count
    set $count 0
    
    # Get the list of neighbour cells from using the modem at-chat command
    set $cells [pick [/interface lte at-chat lte1 input="at+qeng=\"NEIGHBOURCELL\"" as-value ] 0]

    # Loop through each LTE cell
    set $i [find $cells "LTE"]
    while ($i>0) do={
        set $i ($i+4)

        # Retrieve the EARFCN and look up the band #
        set $earfcn [pick $cells ($i+1) [find $cells "," $i]]
        set $n 0
        while ($band->$n < $earfcn and $n < 100) do={ set $n ($n+1) }
        set $output ("B" . $n . "\t")
        if ($n = 100) do={ set $output "-\t" }
    
        # Retrieve the EARFCN, PCI, RSRQ, RSRP and RSSI, then print these
        for n from=1 to=5 do={
            set $j [find $cells "," $i]
            set $output ($output . [pick $cells ($i+1) $j] . "\t")
            set $i $j
        }
        /terminal el; put $output
    
        # Go to the next LTE cell
        set $i [find $cells "LTE" $i]
        set $count ($count+1)
    }

    # Clear any extra lines from the previous run
    /terminal el
    for n from=($count+1) to=$pcount step=1 do={put ""; /terminal el}
    for n from=($count+1) to=$pcount step=1 do={/terminal cuu}

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el;
Reply
#3
MikroTik has released firmware 11.06 for the Chateau 5G - RG502QEAAAR11A06M4G

This has fixed the carrier aggregation readings and now reports all the aggregated cells for me, like the factory 11.03 firmware did. 

The Neighbour Cell Monitor and MIMO Layer Signal Readings scripts from post #2 above work in this firmware version.

Carrier Aggregation Cell Monitor update

This 11.06 firmware also fixes the carrier aggregation signal readings.  However, the SINR calculation has changed, so use the following updated code for the camonitor script:

   
Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "CA  PCI\tBAND BW\tEARFCN\tRSRP\tRSRQ\tRSSI\tSINR"
    /terminal style none
}
$headings

# Bandwidth to MHz conversion
set $bandwidth {"6"="1.4";"15"="3";"25"="5";"50"="10";"75"="15";"100"="20"}

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position and note previous line count
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $pcount $count
    set $count 0
    
    # Get the list of carrier aggregation cells from using the modem at-chat command
    set $cells [pick [/interface lte at-chat lte1 input="at+qcainfo" as-value ] 0]

    # Loop through each LTE cell
    set $i [find $cells "QCAINFO"]
    while ($i>0) do={
        set $cell [ toarray "" ]
        set $output ""
        set $i ($i+9)
    
        # Retrieve the raw type, EARFCN, bandwidth, band, PCI, RSRP, RSRQ, RSSI and SINR
        for n from=1 to=9 do={
            set $j [find $cells "," $i]
            # set $output ($output . [pick $cells ($i+1) $j] . "\t")
            set ($cell->$n) [pick $cells ($i+1) $j]
            set $i $j
        }
        set $sinr [pick $cells ($i+1) [find $cells "\r" $i]]
        set $band ("B" . ([pick ($cell->4) 10 ([len ($cell->4)]-1)]) . " ")

        # Prepare and display output
        if ([find ($cell->1) "PCC"]=0) do={set $output "PCC"} else={set $output "SCC"}
        set $output ($output . " " . ($cell->6) . "\tB" . ([pick $band 1 3]) . " " . \
            ($bandwidth->($cell->3)) . "M\t" . ($cell->2) . \
            "\t" . ($cell->7) . "\t" . ($cell->8) . "\t" . ($cell->9) . "\t" . $sinr)
        /terminal el; put $output
    
        # Go to the next LTE cell
        set $i [find $cells "QCAINFO" $i]
        set $count ($count+1)
    }

    # Clear any extra lines from the previous run
    /terminal el
    for n from=($count+1) to=$pcount step=1 do={put ""; /terminal el}
    for n from=($count+1) to=$pcount step=1 do={/terminal cuu}

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)
/terminal el

Update 17 Nov '21: Minor script fix to show PCC for the primary cell on firmware 11.06.
Reply
#4
Updated after seeing this post, seems to have fixed all the weird issues I was having with the carrier aggregation list disappearing and stuff. Happy with that. Got a text saying three are upgrading the coverage/speed in the area too so I wonder what that'll entail now.
Reply
#5
The terminal inkey timeout parameter is broken since around firmware v7.3 which leads to the scripts no longer automatically refreshing the figures.

As a workaround, replace the following line:
Code:
set $key ([/terminal inkey timeout=1] & 223)

With this code:
Code:
# set $key ([/terminal inkey timeout=1] & 223)
delay 1

The script will now automatically loop again, but will no longer respond to key-presses. To stop a script running, just press CTRL + C.

Once MikroTik fixes this issue, remove the '#' from the '# set $key' line and delete the 'delay 1' line.

I intend soon updating the first post with the scripts that run on the latest Chateau 5G firmware, i.e. 11.06 now that it's been out for a while.
Reply
#6
You mention above, the newer camonitor script has a different SINR calculation.
Does an updated calculation need to go into the mimonitor script also?

My L3 seems way off

MIMO L1 L2 L3 L4
RSRP -88 -82 -140 -
RSRQ R R R
SINR 2 14 -30 -2



but CA shows
CA PCI BAND BW EARFCN RSRP RSRQ RSSI SINR
SCC 184 B1 20M 500 -82 -12 -44 13
SCC 184 B3 15M 1875 -78 -10 -56 18
SCC 430 B20 10M 6200 -80 -15 -54 0
Reply
#7
When I get time I will need to revise the scripts as raw readouts have changed a little since the firmware versions I was on while creating the scripts.

The Carrier Aggregation readout appears to be correct on the latest MikroTik Chateau 5G modem firmware 13.03 with a 4G connection. I don't have 5G yet with any network in my area yet. When using Upload Carrier Aggregation, these raw upload CA values end up after the SINR readout. I think the SINR readout is incorrect on the latest Chateau LTE12 modem firmware as Quectel seems to change the SINR calculation with each firmware update. The old camonitor script probably likely shows the correct SINR readouts again, but will need to test.

The MIMO readout script only works properly on the Chateau 5G as the LTE12 doesn't report the RSRQ or SINR MIMO read-outs. With MIMO SINR readouts, the strongest RSRP, RSRQ and RSRQ readouts should correspond with the primary carrier, i.e. the first line of the camonitor read-out.

Due to an ongoing bug in the Terminal "inkey" command with the latest RouterOS revisions, the line set $key ([/terminal inkey timeout=1] & 223) may need to be replaced with /delay 1 for the readings to auto-refresh. If MikroTik does not fix this bug by the time I get around to revising the scripts, I'll remove the key-press watch options which basically mimicked the Quit / Dump / Pause controls of the built-in cell-monitor command. When using the /delay 1 command which ignores keypresses, press Control + C to stop the script.
Reply
#8
The Terminal "inkey" command timeout parameter is finally fixed in RouterOS v7.11beta2.

This means the scripts will now auto refresh once per second without having to modify the scripts.

I also posted a background task script in this thread that monitors the Internet connection by continuously pinging a post (8.8.8.8 preconfigured) and logs latency spikes, packet loss and Internet outages.
Reply
#9
I have updated the Carrier Aggregation Cell Monitor script below for the Chateau 5G to provide the upload carrier aggregation band on a separate line.  This makes it usable on the Android Winbox with a font size of 34 (via cog wheel icon):

   

Code:
# Print headings
local headings do={
    /terminal style syntax-noterm
    put "CA  PCI\tBAND BW\tEARFCN\tRSRP\tRSRQ\tRSSI\tSINR"
    /terminal style none
}
$headings

# Bandwidth to MHz conversion
set $bandwidth {"6"="1.4";"15"="3";"25"="5";"50"="10";"75"="15";"100"="20"}

# Reset counters
set $count 0
set $pcount 0

# Loop until a keystroke
do {
    # Reset cursor position and note previous line count
    for n from=1 to=$count step=1 do={/terminal cuu}
    set $pcount $count
    set $count 0
    
    # Get the list of carrier aggregation cells from using the modem at-chat command
    set $cells [pick [/interface lte at-chat lte1 input="at+qcainfo" as-value ] 0]
    set $uploadca ""

    # Loop through each LTE cell
    set $i [find $cells "QCAINFO"]
    while ($i>0) do={
        set $cell [ toarray "" ]
        set $output ""
        set $i ($i+9)
    
        # Retrieve the raw type, EARFCN, bandwidth, band, PCI, RSRP, RSRQ, RSSI and SINR
        for n from=1 to=9 do={
            set $j [find $cells "," $i]
            # set $output ($output . [pick $cells ($i+1) $j] . "\t")
            set ($cell->$n) [pick $cells ($i+1) $j]
            set $i $j
        }
        set $sinr [pick $cells ($i+1) [find $cells "\r" $i]]
        set $band ("B" . ([pick ($cell->4) 10 ([len ($cell->4)]-1)]) . " ")

        if ([:len $sinr] > 9) do={set $uploadca ("EARFCN " . ($cell->2) . ", band $band")}
        if ([:len $sinr] > 3) do={set $sinr [pick $sinr 0 [find $sinr ","]]}

        # Prepare and display output
        if ([find ($cell->1) "PCC"]=0) do={set $output "PCC"} else={set $output "SCC"}
        set $output ($output . " " . ($cell->6) . "\tB" . ([pick $band 1 3]) . " " . \
            ($bandwidth->($cell->3)) . "M\t" . ($cell->2) . \
            "\t" . ($cell->7) . "\t" . ($cell->8) . "\t" . ($cell->9) . "\t" . $sinr)
        /terminal el; put $output
    
        # Go to the next LTE cell
        set $i [find $cells "QCAINFO" $i]
        set $count ($count+1)
    }

    if ($uploadca!="") do={
        /terminal el; put ("Upload CA on " . $uploadca)
        set $count ($count+1)
    }

    # Clear any extra lines from the previous run
    /terminal el
    for n from=($count+1) to=$pcount step=1 do={put ""; /terminal el}
    for n from=($count+1) to=$pcount step=1 do={/terminal cuu}

    # Check for any keystroke, then wait one second
    /terminal el; put "-- [Q quit | D dump | P pause]"
    set $key ([/terminal inkey timeout=1] & 223)
    # delay 1
    set $time [/system clock get time]
    /terminal cuu;

    # Keystroke D (68) = dump, P (80) = Pause, Q (81) = Quit
    if ($key=68) do={/terminal el; set $count 0; put "-- $time\n"; $headings}
    if ($key=80) do={/terminal el; put "-- Paused" ; /terminal inkey; /terminal cuu; }
} while (key!=81)

Tested on RouterOS V7.11beta 2, modem firmware "RG502QEAAAR13A03M4G_02.001.02.001".  If using earlier firmware V7.10 or earlier, see post #5 above.

Update 15 July '23: Fixed the script falsely reporting Upload CA when connected with only download CA
Reply
#10
When I get some spare time I plan updating the scripts and placing them in a separate thread per script using the first post here to link to each.

I have also been working on a few other scripts, such as to monitor specific EARFCN / PCI cell combinations.  I will wait until the weather improves to properly test and debug them before posting any code.

For example in the signal meter script I can select a carrier to show the RSRP / SINR / MARGIN readings as meter bars, which should be easier to see in direct sunshine:

       

The Margin figures / line above is the dB difference between the RSRP of the carrier and the strongest neighbour cell (shown as NPCI) on the same EARFCN.
Reply
#11
(04/08/2024, 10:23 PM)Seán Wrote: When I get some spare time I plan updating the scripts and placing them in a separate thread per script using the first post here to link to each.

I have also been working on a few other scripts, such as to monitor specific EARFCN / PCI cell combinations.  I will wait until the weather improves to properly test and debug them before posting any code.

For example in the signal meter script I can select a carrier to show the RSRP / SINR / MARGIN readings as meter bars, which should be easier to see in direct sunshine:



The Margin figures / line above is the dB difference between the RSRP of the carrier and the strongest neighbour cell (shown as NPCI) on the same EARFCN.

Hi Sean, I set the RM520 to 4G only just out of curiosity. One of the B3 is off at the min (power saving) and and the mast is defaulting to 20+28+3 CA (for a while). I have to say that I'm within range to set the B3 as primary (RSRQ -6dB, much better than 20 / 28, in fact after a while the modem transition to B3+28 CA). I ran a couple of speed test and it seems to favour B28 for upload. So I guess it depends on the mast. 

[Image: Screenshot-2024-08-26-at-11-59-37.png]

[Image: Screenshot-2024-08-26-at-12-00-17.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)