0

Please note that I have a Raspberry pi 4 and a SIM7600E-H1C module and I want my Raspberry pi to be connected to the internet all the time. So I used the SIM7600 module, plugged in and inserted the SIM card. I can provide internet to Raspberry pi using this commandenter image description hereand the IP of both SIM7600 and Raspberry pi must match in order to use the internet, for example:enter image description herebut my problem is When the Raspberry pi Reboot and turn it back on Refuses to connect automatically as expected So I have to re-enter the sudo command every time my computer reboots.enter image description here I want SIM7600E works like an aircard that inserts a SIM card and plugs it in to use the internet right away. Can anyone help me with this? Or is there a way to set the IP somewhere?

I follow this website https://www.elementzonline.com/blog/accessing-internet-(jio-sim)-in-sim7600-4g-modem-v2.0-with-Raspberry-pi-using-qmi-interface

1
  • Have you updated using sudo apt update then sudo apt full-upgrade specifically? Then do a reboot. Any errors?
    – Sanders
    Commented Jan 6, 2022 at 6:44

2 Answers 2

0

You can make a python script that is executed automatically at reboot.

The python script only needs to do os.system('sudo ifup wwan0')

1
  • Why do you need Python3? Just run ifup (with sudo if needed).
    – Dougie
    Commented Oct 27, 2022 at 16:34
0

You can make a bash script + udev rule to detect the interface and execute your script. For example, create the file: /etc/udev/rules.d/99-simcom.rules.

ACTION=="add", SUBSYSTEMS=="net", KERNEL=="wwan*", RUN+="/usr/local/bin/simcom.sh '%E{INTERFACE}'"

That means when a wwan* interface is detected, it will execute the script located at /usr/local/bin/simcom.sh and pass to it the interface name (wwan0 for example).

When you create this rule, it will not be executed until reboot or if you reload your rules with:

sudo udevadm control --reload-rules && sudo udevadm trigger

Then you will need to create that simcom.sh file and execute your comands like

File: /usr/local/bin/simcom.sh

ip link set $1 down
echo 'Y' # etc...

Remember to make it executable with sudo chmod +x /usr/local/bin/simcom.sh


An alternative is change the SIM7600 mode and use RNDIS instead of QMI, which is easier to setup but you also will need a small script to get IP with dhclient ir udhcpc.

The interface will be renamed to usb0 instead of wwan0 and you will only need a couple of commands.

A couple of years ago I answered a question before with the instructions here: SIM7600 as RNDIS interface for Raspberry Pi

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.