:local enb ([/interface lte info [find name="lte1"] once as-value]->"enb-id")
:local sector ([/interface lte info [find name="lte1"] once as-value]->"sector-id")
The method i have been using has been working on multiple devices for ages.
Sorry I should have read more carefully. I think your fix is easier, change "
info" to "
monitor" – they changed this in V7.
If you want to see all the variable you can use, you can use this from Terminal (I call it the "CLI"), you can use:
/interface/lte/monitor [/interface/lte find running] once
To understand the signal data, this article is helpful:
https://www.sharetechnote.com/html/Hand ... E_CQI.html
If your reading several of the LTE "info"/"monitor" variable, it's easier to get them all at once into an "array", then use the values you need – makes changing the script easier, code cleaner, and reduces the number of "AT" commands going to the modem. This can be done like this in V7 – you don't need to use the V7 syntax "/interface/lte", "/interface lte" from V6 still works (e.g. with space), but I do to make sure I know it's V7 script code
.
:global cellulardata [/interface/lte/monitor [/interface/lte find running] once as-value]
:log info "*LTE signal report* CQI: $($cellulardata->"cqi") RSRQ: $($cellulardata->"rsrq") RSRP: $($cellulardata->"rsrp") "
# you can also assign the various parts to a variable, which makes using them in a string easier
:global enb ($cellulardata->"enb-id")
:global sector ($cellulardata->"sector-id")
:global carrier ($cellulardata->"current-operator")
:global band ($cellulardata->"primary-band")
:global caband ($cellulardata->"ca-band")
:put "And, with https://cellmapper.net you can find location etc., checking '$carrier' for enb: $enb finding the sector $sector and/or $($cellulardata->"phy-cellid")"
:put "*LTE CA report*. PRIMARY $band. with $([:len $caband]) subcarriers $caband"
# scripting tip: if you create new variable use only lowercase letters, the "string interpolation" is WAY cleaner see above vs first line with $($var->"attribute-name") stuff
You see that cellulardata gets all the data in one operation, then you can pick what you need later in a script. While a bit complex "$($varname->"lteattribute")" is required if you want text with one or more of the variable (e.g. log entry, an email template with signal report or whatnot). To assign a LTE attribute to a variable only the () and quote around the attribute name are needed.