How do I edit how do I edit the script to fix it?

Good Day,

As a noob I've been very impressed by how to much detailed knowledge there is on technical details associated with getting a LTE modem to work.

I found some instructions that suggest that I "edit the script to fix it."

Unfortunately, I don't know how to edit the script nor how to find it.

Can someone point me to a tutorial?

Thanks in advance!

Here's the reference BTW

uqmi commands hang

If you type any uqmi command and get no output, you may need to edit the script to fix it.

The file is located in /lib/netifd/proto/

Locate the line that looks like this:

while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do

On OpenWRT 19.7 it's on line 83. It might be on a different line if you have a newer or older OS version.

Add the following 3 lines before the line above.

uqmi -s -d "$device" --get-pin-status & sleep 3 killall uqmi || echo "UQMI now works fine!"

This fix is currently necessary for SIM7600G-H card.

The instructions are pretty clear: It's in /lib/netifd/proto/ Obviously, this file is on your router, so you have to connect to it via SSH to get command line access. There is the following wiki article about this:

Then you have several options to edit the file, you could even use the described WinSCP to copy the file to your computer, edit it there and copy it back.


Welcome to the community!

Here's the refrence:

1 Like

thank you!


SEARCH_LINE="while uqmi -s -d \"\$device\" --get-pin-status | grep '\"UIM uninitialized\"' > /dev/null"
INSERT_LINES=("uqmi -s -d \"\$device\" --get-pin-status &" "sleep 3" "killall uqmi || echo \"UQMI now works fine!\"")

# Check if the file exists
if [ ! -f "$FILE_PATH" ]; then
    echo "File not found: $FILE_PATH"
    exit 1

# Create a backup of the original file
echo "Backup created at $BACKUP_FILE_PATH"

# Read file and search for the line
LINE_NUMBER=$(grep -n "$SEARCH_LINE" "$FILE_PATH" | cut -d: -f1)

if [ -z "$LINE_NUMBER" ]; then
    echo "Line not found in the file."
    exit 1

# Insert lines before the found line

echo "Lines successfully inserted."