Need Help with 4G Hat for Raspberry Pi 0

Hello to everyone,
I hope you’re all having a great day! I am currently trying to set up a 4G hat [SIM7600X 4G HAT(B)] for my Raspberry Pi 0, and I am following the guide found here:

I have followed all the instructions carefully, but I have encountered an error that I cannot seem to resolve. When I enter the command sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='ibox.tim.it',ip-type=4" --client-no-release-cid in the terminal, I receive the following error message:

https://imgur.com/XFplRXr
https://pastebin.com/aZ6C09M0

I have tried searching for a solution to this error message, but I have not been successful. I was wondering if anyone in this community could help me out. I would greatly appreciate any advice or guidance you can provide.

Troubleshooting Attempts

I have attempted to connect using SIM cards from the Italian providers TIM and Wind, which offer data services, but encountered issues with both. Interestingly, when they switched to a Vodafone SIM card that supports both data and voice calls, they were able to connect without any problems. This leads them to wonder if there is a distinct process for connecting data-only SIMs, such as those from TIM and Wind, compared to SIMs that support both data and voice calls, like the Vodafone SIM they used.

Thank you in advance for your help!

Best regards,

  • Simone
1 Like

Hey Simone.

Welcome to the forums.
Good to have you with us.

4G networks can be super tricky.

The first thing I’d want to check is the contents of raw_ip file.
You’re looking for a provider IP, but often it defaults to “127.0.0.1”.
It should also contain some kind of Auth Keyword like “1” or “Y” or “OK”.
Looking at your guide, the command you want is

# "cat" gets a list of prams and writes the contents to standard-output
cat /sys/class/net/wwan0/qmi/raw_ip

You’re welcome to paste it here but just scan through it to make sure it doesn’t contain anything you consider to be private or personal information.

Hope we can get this working for you.
Pix :heavy_heart_exclamation:

Hello Pix,
thank you very much for your response. Following the guide, there is a part where it tells me to set raw IP to yes:

sudo ip link set wwan0 down
echo ‘Y’ | sudo tee /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set wwan0 up

I have also verified with a “cat” command that raw_ip is set to Y, but in any case, I still encounter the same error.

Hey Simone,

A few generic troubleshooting suggestions to check everything is correct up to this point:

Use ls /dev/cdc-wdm0 to check that your device is showing up in the correct location. This will list the available devices in this path and the HAT should be listed here.

Is the APN correct? Here you’re using ibox.tim.it which would be correct for the Italian TIM provider but may need to be changed if your using WIND instead.

I’m not super familiar with these 4G HATS so hopefully someone can jump in with some better advice but at least this will cover any command line syntax related issues.

Hi, thanks so much for the reply.
Sisi, the name is correct. I already checked it before.
actually just today I found a way to make it work, even if it’s all absolutely illogical.
basically after having followed the entire procedure as per the manual:

  • Run sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=‘ibox .tim.it’,ip-type=4” --client-no-release-cid
  • Run sudo ip link set wwan0 down and then up again (note that if I do it first it doesn’t work)
  • finally I relaunch sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=’ ibox.tim.it’,ip-type=4” --client-no-release-cid.

So my chain of commands is this:

sudo systemctl unmask ModemManager.service
sudo systemctl disable ModemManager.service
sudo systemctl stop ModemManager.service
sudo ip link set wwan0 down
echo ‘Y’ | sudo tee /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set wwan0 up
sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=‘ibox.tim.it’,ip-type=4” --client-no-release-cid
sudo ip link set wwan0 down
sudo ip link set wwan0 up
sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=‘ibox.tim.it’,ip-type=4” --client-no-release-cid
sudo udhcpc -i wwan0.

I can’t understand the logic of this but ok

1 Like

Hey @Simone270504,

Working with 4G like this is always a tricky thing to do. If that solution works for you then I would consider that a success.

I can’t make sense of why those commands in that specific order would work either but a win is a win, well done!

2 Likes

The company I work for has just changed service provider. :roll_eyes: Now, even with the new SIM cards, this trick doesn’t work.
Any ideas?