Guide by Tim; 4G and GPS HAT For Raspberry Pi - Waveshare SIM7600X

I have just shared content in Guides > Raspberry Pi: "4G and GPS HAT For Raspberry Pi - Waveshare SIM7600X"





Read more

10 Likes

Hello Tim and thank you for the guide!

I’m wondering about:
“Below is everything you will need for this guide.
-Activated SIM Card”

Do you think I can test the module with my personal SIM card that I’m using in my phone that has a pin code? Or is it required to have a different type of SIM-card with a different type of subscription and no pin code?

4 Likes

Hey mate, my pleasure!

When I just started off I used the SIM directly from my phone and it worked perfectly fine. My Phone SIM also has a pin code but I didn’t run into any issues when I was just testing it out. So you should be perfectly fine :slight_smile:
Kind regards,
Tim

4 Likes

Hi, just wondering if you would have the size/scale of the 3d model? The file outputs the 3d print as being 1.5m3, which i would rather not print :slight_smile:

4 Likes

Hi Lachlan,

Welcome to the forum!

What slicer were you using? If you are able to load it in with cm’s as units that would work.
Mine loaded into Cura super large, scaling it down to 10% looks good (Blenders dimensions agree)

4 Likes

Looks like the scale is wrong with the STL model, I’ll fix it now. Liam is absolutely correct, if you scale it down 10% it’ll be the correct dimensions. Will update this post once it is done.

Update - All fixed now

5 Likes

Hi,

but if a SIM card has PIN code required, where do you enter it in order to connect to the network?

4 Likes

Hi Tine,

It looks like Tim already answered a similar question a couple of replies above, you shouldn’t have to enter the pin to connect to the network

Here’s the AT command if you are forced to enter it:


(Source)

5 Likes

Hi Tim, are you able to do an update using the M.2 (SIM7600G-H M.2 4G HAT) as this looks quite a bit different from the version you did an awesome video upon. Also - would you know if the commands are the same for installation / setup etc? I haven’t tried it yet, am just looking to get some quiet time to set it all up :). Cheers James.

5 Likes

Hey James,
I would boldly like to say that the installation process is exactly the same for the Raspberry Pi Zero Version of the 4G Waveshare HAT as it is for the Model B Sized Raspberry Pi HAT. This is the normal situation for most big brother/little brother hardware versions like this. However, as I have not set up a SIM7600G-H M.2 4G HAT so I cannot be sure.
Hopefully this helps somewhat, I would like to explore the little brother version of this HAT, particularly if the installation is different. If when your setting it up you do find differences/find it to work just like normal please come back and tell me! :slight_smile:
Kind regards,
Tim

3 Likes

Hi Tim,
Would it be possible to use the HAT SIM7600G as per your tutorial with SMS and GPS and at the same time create an LTE/4G Internet connection? That would be a great combination for different projects.
Would you be willing to do a second tutorial on this topic?
BR // Manuel

4 Likes

Thanks for the tutorial!
Suggestion: I think this tutorial could be expanded to cover not only GPIO control, but accessing linux shell over sms. There is a massive use case for sending remote shell commands (eg sms triggered standalone bash scripts and other custom actions over SMS. Shell output return messages over SMS could create a level of interactivity over cheap low bandwidth GPRS for so many IOT sensors or edge systems)
Any chance you could point us in this direction?
Thanks again!

3 Likes

Good afternoon @Dave65452 and @Manuel205009.

Definitely willing and able to sort some more tutorials on this topic. The Waveshare 4G HAT really is the leatherman tool for getting all mobile connectivity onto a Raspberry Pi 4 Model B and there was just much to much to pull out for a single guide.

Tutorials do take time to get them the polish I need them to be at. To save you waiting here are three guides (from external websites) that should help in your situations.

Creating a Hotspot/Constant Internet connection with the 4G HAT that can then connect to your Raspberry Pi can be done this way -Super SIM, Raspberry Pi 4, and the Waveshare 4G Hat Getting Started Guide | Twilio

OpenWRT OS is also an option for getting internet connectivity and turning your Raspberry Pi into a full-on router - [OpenWrt Wiki] Raspberry Pi

Finally, I stumbled across another guide as I was writing the Python Scripts for the system. The hardware is a little bit older than what I used here and I couldn’t quite nail it in before shoot day. The end result is a 4G Raspberry Pi System that you can text Terminal Commands directly to it. They run as they should and the output of the Terminal is then texted back to you. I reckon that’s exactly the interactivity that you’re looking for Dave. - Remote Control of Raspberry Pi Via SMS (RPi SMS Shell)

Hopefully, this keeps you pushing forwards, expanding your edge, instead of waiting on me :slightly_smiling_face:.
Kindest regards,
Tim

4 Likes

Thanks Tim, really helpful stuff!

One follow up question if I may:

Are you confirming that the RPi SMS shell link you supplied is actually something that you have confirmed works?, or is workable with the Waveshare suite of devices?, or that you nearly got there with it but ran out of time? (I’m just trying to filter out info that’s incomplete or possibly a dead end so I can spend time more productively developing this. The internet isn’t always accurate from time to time :blush: !)

Again, thankyou,

Dave

2 Likes

Heyya mate :blush: happy to hear.
The RPi SMS shell link above I haven’t got working with the 4G Hat, however, it demonstrates the exact framework you could implement and if I kept working at it I reckon I would’ve nailed it. I just ran out of time really. So I can’t confirm 100% whether that is a dead-end or not but my gut says it is worth pursuing.
Kind regards,
Tim

2 Likes

Hey Tim,

Sorry for the delay in writing back as my work life has been insane. I setup the M2 4G Global hat and yes I guess it’s pretty straight forward when I/you just look at the photos on the waveshare portal (the greatest challenge was adding the antenna and gps wires as it wasn’t clear what goes where… and there are no jumpers to set. However one thing I noticed was you can’t plug the power into the power socket on the m2 board when it’s attached to the pi otherwise the pi 4B doesn’t work. You have to plug the power into the pi and the use the USB adapter to send power to the 4G hat….

The rest of your tutorial for setting up the software aspects of the pi work a treat so thank you for such awesome clear instructions.

So I’ve now rigged up a bunch of piico sensors to the pi 4B with the 4G hat, if the temperature sensor goes above 22c it switches the leds from green to red and sends an SMS alert to my phone… I’ve also now configured the same pi with connectivity to Microsoft Azure IoT portal and send the data there to display on the portal too…. I’m happy to share the code with you… I think there is an opportunity for a good YouTube video (with someone like yourself) doing a complete end to end clear video as the couple of examples on YouTube of Pi connecting to Azure are difficult to understand. If this is of interest then let me know and I’ll send you the details… I don’t really have the time to make the video myself.

Best regards,

James

3 Likes

Heyya mate,

Big thanks for this write up, glad to hear the majority of the setup for the smaller footprint 4G HAT was reasonably similar. Azure is definitely a world I’d love to know more about. Coming up with elegant solutions to data transfer with any system is truly the apex. Plus I’ve heard great things about Microsoft Azure IoT. Feel free to share the code directly here but such an achievement most likely deserves a forum post all to itself :blush:.

Kind Regards,
Tim

2 Likes

Hi, I am trying to use this HAT for Internet access as well as GPS. However, when I follow the guides and (successfully) hook it up using ppp, I can no longer access the serial device. It gets locked by ppp. So now I can either use Internet or GPS, but not both at the same time.

Any pointers what I can do?

Heyya mate,
So with the PPP enabled it won’t let you access the serial communications to the Waveshare 4G HAT? Are the UART settings still enabled inside the Raspberry Pi OS (found in the Raspberry Pi Configuration Menu)? It seems very odd to me that you wouldn’t be able to use GPS and Internet simultaneously.
Kind regards,
Tim

Kind regards,
Tim

1 Like

I am using pon to connect ppp. Then I can use the ppp0 device for networking no problem (other than that it is not very fast).

When I run my GPS tracker with ppp enabled, I get this message:

serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: '/dev/ttyAMA0'

When I do not have ppp running, the GPS works properly.

Seems pon locks the port. :frowning: