Using a Council Rock E1500 modem, running "TELiG 3.3.1 OpenWRT / LuCI openwrt-21.02 branch git-22.288.45155-afd0012" (See bottom of post for /etc/config/network)
LTE Modem is Sierra Wireless EM7511
I read the previous discussion (now locked) on using uqmi to access LTE signal levels in a script.
I discovered that it worked - but only once:
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
"type": "lte",
"rssi": -78,
"rsrq": -10,
"rsrp": -105,
"snr": 94
}
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
^C"Failed to connect to service"
root@E1500-2:~#
There was a mention of a bug where there were two uqmi processes in deadlock.
There was also mention of contention with the LuCI status page because uqmi does not lock the device it is working with. In my case, I'm connected to the device by ssh only, with no HTTPS session active.
perot posted a script that was supposed to address the issue.
I've extracted just the parts related to uqmi and removed the LED control, and simply report the results with an echo.
The script gives the same result as entering the uqmi command at a prompt. It hangs indefinitely on uqmi, then reports "Failed to connect to service" when terminating with ^C.
#!/bin/sh
#
# Script to report
# Received Signal Strength
#
# (c) 2020 by Peter Rottengatter - Code under GPLv2
#
set -x
qmi_path='/sys/bus/usb/drivers/qmi_wwan/*/usbmisc/*'
qmi_name=$(basename $(echo ${qmi_path}))
for path in $(echo /sys/class/net/*/device/usbmisc/*)
do
if [ "$(basename ${path})" = "${qmi_name}" ]; then
qmi_iface=${path%%/device/usbmisc/*}
qmi_iface=${qmi_iface#/sys/class/net/}
fi
done
if [ -z "${qmi_iface}" ]; then
exit 255
fi
qmi_device=/dev/${qmi_name}
NL="$(echo -e ',\n:')"
NL=${NL:1:1}
previous_rssi=1
while true;
do
sleep 1
info=$(uqmi -d ${qmi_device} --get-signal-info)
old_IFS=${IFS}
IFS=",${NL}"
for line in ${info}
do
label=${line#*\"}; label=${label%\": *}
value=${line#*: }
value=${value#\"}; value=${value%\"*}
case ${label}
in
type) # Type of connection
type=${value} ;;
rssi) # Received signal strength indicator
rssi=${value} ;;
rsrq) # Reference signal received quality
rsrq=${value} ;;
rsrp) # Reference signal received power
rsrp=${value} ;;
snr) # Signal to noise ratio
snr=${value} ;;
signal) # Signal strength for GSM
rssi=${value} ;;
esac
done
IFS=${old_IFS}
if [ ${rssi} -eq ${previous_rssi} ]; then
continue;
fi
previous_rssi=${rssi}
echo "Type- ${type} RSSI- ${rssi}, RSRQ- ${rsrq}, RSRP- ${rsrp}, signal- ${signal}"
done
exit 0
Has anyone learned any more about uqmi and how to use it successfully?
'-------------------------------------------------------------------
configuration from /etc/config/network
root@E1500-2:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan1'
option device 'lan1'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '10.0.0.2'
config interface 'lan2'
option device 'lan2'
option proto 'dhcp'
config interface 'docker'
option device 'docker0'
option proto 'none'
option auto '0'
config device
option type 'bridge'
option name 'docker0'
config interface 'wan_a'
option proto 'modemmanager'
option modem 'EM7511'
option device '/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1'
option iptype 'ipv4'
option passthrough 'none'
option auth 'none'
list supported_1 'utran-1'
list supported_1 'utran-4'
list supported_1 'utran-6'
list supported_1 'utran-5'
list supported_1 'utran-8'
list supported_1 'utran-9'
list supported_1 'utran-2'
list supported_1 'eutran-1'
list supported_1 'eutran-2'
list supported_1 'eutran-3'
list supported_1 'eutran-4'
list supported_1 'eutran-5'
list supported_1 'eutran-7'
list supported_1 'eutran-8'
list supported_1 'eutran-9'
list supported_1 'eutran-12'
list supported_1 'eutran-13'
list supported_1 'eutran-14'
list supported_1 'eutran-18'
list supported_1 'eutran-19'
list supported_1 'eutran-20'
list supported_1 'eutran-26'
list supported_1 'eutran-29'
list supported_1 'eutran-30'
list supported_1 'eutran-32'
list supported_1 'eutran-41'
list supported_1 'eutran-42'
list supported_1 'eutran-43'
list supported_1 'eutran-46'
list supported_1 'eutran-48'
list supported_1 'eutran-66'
list supported_1 'utran-19'
list active_1 'utran-1'
list active_1 'utran-4'
list active_1 'utran-6'
list active_1 'utran-5'
list active_1 'utran-8'
list active_1 'utran-9'
list active_1 'utran-2'
list active_1 'eutran-1'
list active_1 'eutran-2'
list active_1 'eutran-3'
list active_1 'eutran-4'
list active_1 'eutran-5'
list active_1 'eutran-7'
list active_1 'eutran-8'
list active_1 'eutran-9'
list active_1 'eutran-12'
list active_1 'eutran-13'
list active_1 'eutran-14'
list active_1 'eutran-18'
list active_1 'eutran-19'
list active_1 'eutran-20'
list active_1 'eutran-26'
list active_1 'eutran-29'
list active_1 'eutran-30'
list active_1 'eutran-32'
list active_1 'eutran-41'
list active_1 'eutran-42'
list active_1 'eutran-43'
list active_1 'eutran-46'
list active_1 'eutran-48'
list active_1 'eutran-66'
list active_1 'utran-19'
list supported_2 'utran-1'
list supported_2 'utran-4'
list supported_2 'utran-6'
list supported_2 'utran-5'
list supported_2 'utran-8'
list supported_2 'utran-9'
list supported_2 'utran-2'
list supported_2 'eutran-1'
list supported_2 'eutran-2'
list supported_2 'eutran-3'
list supported_2 'eutran-4'
list supported_2 'eutran-5'
list supported_2 'eutran-7'
list supported_2 'eutran-8'
list supported_2 'eutran-9'
list supported_2 'eutran-12'
list supported_2 'eutran-13'
list supported_2 'eutran-14'
list supported_2 'eutran-18'
list supported_2 'eutran-19'
list supported_2 'eutran-20'
list supported_2 'eutran-26'
list supported_2 'eutran-29'
list supported_2 'eutran-30'
list supported_2 'eutran-32'
list supported_2 'eutran-41'
list supported_2 'eutran-42'
list supported_2 'eutran-43'
list supported_2 'eutran-46'
list supported_2 'eutran-48'
list supported_2 'eutran-66'
list supported_2 'utran-19'
list active_2 'utran-1'
list active_2 'utran-4'
list active_2 'utran-6'
list active_2 'utran-5'
list active_2 'utran-8'
list active_2 'utran-9'
list active_2 'utran-2'
list active_2 'eutran-1'
list active_2 'eutran-2'
list active_2 'eutran-3'
list active_2 'eutran-4'
list active_2 'eutran-5'
list active_2 'eutran-7'
list active_2 'eutran-8'
list active_2 'eutran-9'
list active_2 'eutran-12'
list active_2 'eutran-13'
list active_2 'eutran-14'
list active_2 'eutran-18'
list active_2 'eutran-19'
list active_2 'eutran-20'
list active_2 'eutran-26'
list active_2 'eutran-29'
list active_2 'eutran-30'
list active_2 'eutran-32'
list active_2 'eutran-41'
list active_2 'eutran-42'
list active_2 'eutran-43'
list active_2 'eutran-46'
list active_2 'eutran-48'
list active_2 'eutran-66'
list active_2 'utran-19'
option apn1 'EPRI.VZWENTP'
option verizon1 '1'
option sim '1'
config route
option interface 'wan_a'
option target '172.21.0.0'
option netmask '255.255.255.0'
config route
option interface 'wan_a'
option target '172.23.0.0'
option netmask '255.255.255.0'
config route
option target '172.24.0.0'
option netmask '255.255.255.0'
option interface 'wan_a'
config interface 'tunnel0'
option proto 'none'
option device 'tun0'
config route
option interface 'tunnel0'
option target '172.21.0.0'
option netmask '255.255.255.0'
config route
option interface 'tunnel0'
option target '172.23.0.0'
option netmask '255.255.255.0'
config route
option interface 'tunnel0'
option target '172.24.0.0'
option netmask '255.255.255.0'
root@E1500-2:~#