Hi @spamcop and all,
I installed curl and ran this command in your script. It seems like 192.168.225.1 is not responding
root@OpenWrt:~# curl -v -d '{"module":"status", "action":"0"}' -H "Content-Type:
application/json" http://192.168.225.1/cgi-bin/qcmap_web_cgi
* Failed to connect to 192.168.225.1 port 80 after 131855 ms: Error
curl: (28) Failed to connect to 192.168.225.1 port 80 after 131855 ms: Error
ping 192.168.225.1 is not responding either
My router is tp-link mr6400 and it's very similar to mr200
My version of curl is:
root@OpenWrt:~# curl -V
curl 8.8.0 (mipsel-openwrt-linux-gnu) libcurl/8.8.0 mbedTLS/3.6.0 nghttp2/1.62.1
Release-Date: 2024-05-22
Protocols: file ftp ftps http https ipfs ipns mqtt
Features: alt-svc HSTS HTTP2 HTTPS-proxy IPv6 Largefile SSL threadsafe UnixSockets
I appreciate any help here
and it's the IP of your LTE modem ?
My LTE IP address is 192.168.1.1
Tried this and the web server returned 404
root@OpenWrt:~# curl -v -d '{"module":"status", "action":"0"}' -H "Content-Type:
> application/json" http://192.168.1.1/cgi-bin/qcmap_web_cgi
> POST /cgi-bin/qcmap_web_cgi HTTP/1.1
> Host: 192.168.1.1
> User-Agent: curl/8.8.0
> Accept: */*
> Content-Type:
> application/json
> Content-Length: 33
>
< HTTP/1.1 404 Not Found
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Keep-Alive: timeout=20
< Content-Type: text/html
<
Hi,
Calling uqmi -s -d /dev/cdc-wdm0 --get-signal-info
in a script that loops will crash the script if another process calls uqmi
according to this:
Old thread for reference:
So yes it is straightforward to write a script to poll uqmi --get-signal-info to turn LEDs on or off based on the received signal strength on a QMI modem. But then a problem occurs:
I also have to work around a bug in uqmi: It does not lock the device it is working with. If the signal strength script and the LuCI status page code call it at the same time it locks up. I'm thinking of a wrapper script that puts a semaphore in place.
This is indeed still the case. …
I did try the uqmi
script here:
I wrote down script for it.
#!/bin/sh
os=-1
while true; do
rssi=$(uqmi -d /dev/cdc-wdm0 -t 1000 -s --get-signal-info | jsonfilter -e '@["rssi"]')
if [ -z $rssi ] || [ $rssi -ge 0 ]; then s=0;
elif [ $rssi -ge -65 ]; then s=3;
elif [ $rssi -ge -75 ]; then s=2;
elif [ $rssi -ge -85 ]; then s=1;
else s=0;
fi
if [ $os != $s ]; then
case $s in
0)
echo 0 > /sys/class/leds/white:signal1/brightness
echo 0 > /sys/class/leds/white:signal2/brightness
…
It works but after some time the script stops running