MR200v4/README.md

89 lines
2.7 KiB
Markdown
Raw Normal View History

2022-11-15 22:20:54 +00:00
# openwrt - uqmi
Customized uqmi with APN profiles.
More information and source code: https://github.com/mrhaav/openwrt-packages/blob/main/README.md
2022-12-04 11:38:38 +00:00
Latest version: 2022-11-29-0.10
2022-12-04 11:40:16 +00:00
From version 2022-09-13-0.9, an SMS receive/send function and a connectivity daemon are included.\
The SMS is stored in /var/sms/received and the file name is sent to script /usr/bin/uqmi_sms.sh (uqmi_sms.sh is not included in the ipk file).
The daemon will run every 30sec and check the network connectivity and send the RSSI value to script /usr/bin/uqmi_led.sh to trigger signal strenght LEDs (uqmi_led.sh is not included in the ipk file).\
2022-12-04 11:41:28 +00:00
Don´t run other uqmi scripts in parallell. The modems are not able to handle multiple uqmi request at the same time.\
2022-11-16 21:25:00 +00:00
If you need some special uqmi command to be exequted every 30s, add them to the daemon, `/usr/bin/uqmi_d.sh`.\
2022-11-16 21:24:28 +00:00
\
2022-11-16 21:01:37 +00:00
Switches:\
2023-01-12 19:29:14 +00:00
`uci set network.<your interface>.ipv6profile=<ipv6 profile number>`\
2023-01-12 19:28:13 +00:00
If you need an other APN for IPv6. Configure you IPv4 APN with LuCI and add the IPv6 APN with uqmi command `--create-profile` or `--modify-profile`\
2022-11-16 21:04:53 +00:00
\
2023-01-12 19:29:14 +00:00
`uci set network.<your interface>.abort_search=false`\
2023-01-12 19:28:42 +00:00
If you have you modem in poor radio coverage, you can let the modem search for network for ever (default, it will search for 35 sec).\
2022-11-16 21:04:53 +00:00
\
2023-01-12 19:29:14 +00:00
`uci set network.<your interface>.daemon=false`\
If you would like to turn off the daemon.\
2022-11-16 21:04:53 +00:00
\
2022-11-16 21:03:25 +00:00
Don´t foget to run `uci commit network`.
2022-11-16 21:11:32 +00:00
\
\
2023-01-12 19:31:39 +00:00
Downloading file to your router:\
2022-11-16 21:11:32 +00:00
Choose OpenWrt version and target.\
2022-01-13 21:40:48 +00:00
Go to the file, right click on Download button and select Copy link addess.\
2022-01-13 21:41:13 +00:00
Then paste the link in your router after wget.
2022-11-16 21:08:17 +00:00
```
2023-01-10 20:03:08 +00:00
wget https://github.com/mrhaav/openwrt/raw/master/22.03.2/uqmi_2022-11-29-0.10_mipsel_24kc.ipk
opkg install uqmi_2022-11-29-0.10_mipsel_24kc.ipk
2022-11-16 21:08:17 +00:00
```
2022-11-16 21:11:32 +00:00
2022-11-16 21:12:19 +00:00
\
\
2022-11-16 21:11:32 +00:00
uqmi_led.sh example for MR200v4
```
#!/bin/sh
rssi=$1
LED1=$(readlink -f /sys/class/leds/mr200v4:white:signal1)
LED2=$(readlink -f /sys/class/leds/mr200v4:white:signal2)
LED3=$(readlink -f /sys/class/leds/mr200v4:white:signal3)
if [ "${rssi}" -eq -200 ]
then
echo none > $LED1/trigger
echo none > $LED2/trigger
echo none > $LED3/trigger
elif [ "${rssi}" -le -90 ]
then
echo default-on > $LED1/trigger
echo none > $LED2/trigger
echo none > $LED3/trigger
elif [ "${rssi}" -le -70 ]
then
echo default-on > $LED1/trigger
echo default-on > $LED2/trigger
echo none > $LED3/trigger
else
echo default-on > $LED1/trigger
echo default-on > $LED2/trigger
echo default-on > $LED3/trigger
fi
```
2022-11-16 21:12:19 +00:00
\
\
2022-11-16 21:11:32 +00:00
uqmi_sms.sh example
```
#!/bin/sh
receivedSMS=$1
Bnumber=$(sed -n '1p' $receivedSMS)
if [ $Bnumber = '+46123456' ]
then
first_row=$(sed -n '2p' $receivedSMS)
second_row=$(sed -n '3p' $receivedSMS)
# Execute your commands
rm $receivedSMS
else
logger -t SMS Unauthorized Anumber
rm $receivedSMS
fi
```