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

Hi Tim, can SIM7600G-H 4G setup on ubuntu? Please…

Tim, Got the SIM7600X and used your guide to set it up. Everything is perfect. Thank you so much.

I intend to use my set up in my camper in the event of theft. When the camper gets powered up the Pi will boot and I’ll have the Get GPS and SMS script send me the coordinates.

At that time I’d like to get the IP address from the cellular (wwan0) SMS’d to me as well.

Can that be added to a script?

Again, thanks for the awesome guide!

John
New Bern, NC

1 Like

I ran the Remote Control of Raspberry Pi Via SMS script and it fails. The screen shot of his code is different than the downloadable code. It fails with being unable to populate the data.

I wrote a cron to run your GPS then SMS script and it works, however, I can’t get it to work with an @reboot command and I’ve tried LXDE-pi/autostart with and without LXTerminal with no joy.

I really like the idea of being able to SMS the 7600 and running commands but I’m up against the wall at the moment. Thanks much for getting me this far!

2 Likes

Hi, I’m using the hologram SIM and whilst the AT commands confirm I am connected to telstra I can’t get the unit to call any phone number. Is there a trick to these sims?

3 Likes

Hi Tony,

Welcome to the forum!!

The Hologram SIM cards are locked into data and SMS since they are IoT-oriented devices.

We’ll be sure to clarify on the product page!
Liam

2 Likes

thanks Liam- that explains it

2 Likes

bonjour , hello
thank you for your tutorial about sim7600g-h 4g hat for raspberry
i finally made it and it works well , i try all your demo you gave us , first
phone call (ok), second GPS (ok) third HUMAN READABLE FINAL.PY , not ok , and here is the problem : ( FinalLat = float(Lat) + (float(SmallLat)/60)
ValueError: could not convert string to float: ‘\n+’)
thats what the script says when i run it.
hope you can help me , and sorry for my inglish…i’m french
best regards

3 Likes

Hey mate,

Your English is very good :blush: no stress here.

Could you send through a screen capture of your issue? That would help me troubleshoot better. I reckon if you jump into the code and find where that | \n+ | is. Then alter it by adding in a spacebar so it looks like this | \n + | or by removing the | + | altogether.

The issue has to do with converting a string variable to a float variable. That happens in the Python Script when I alter the raw GPS data to a more user-readable Lattitude and Longitude value.

Meilleures salutations,
Tim

3 Likes

Hey TIM
Very happy that you try to help me, here is the log you asked , tell me if it’s that what you want

SIM7600X is starting:
SIM7600X is ready
Start GPS session…
AT+CGPS=1,1 ERROR
AT+CGPS=1,1 back: AT+CGPS=1,1
ERROR

Traceback (most recent call last):
File “/home/pi/SIM7600X-4G-HAT-Demo/Raspberry/python/python-scripts-4g-waveshare-hat/GPS-Human-Readable-Final.py”, line 115, in
get_gps_position()
File “/home/pi/SIM7600X-4G-HAT-Demo/Raspberry/python/python-scripts-4g-waveshare-hat/GPS-Human-Readable-Final.py”, line 75, in get_gps_position
answer = send_at(‘AT+CGPSINFO’,'+CGPSINFO: ',1)
File “/home/pi/SIM7600X-4G-HAT-Demo/Raspberry/python/python-scripts-4g-waveshare-hat/GPS-Human-Readable-Final.py”, line 51, in send_at
FinalLat = float(Lat) + (float(SmallLat)/60)
ValueError: could not convert string to float: ‘\n+’

i’ m a NOOB in python an appreciate a lot if you can solve my probleme
i plan to make a big projet whith my childrens , and you helped us a lot with your demo , show them how it’s easy to build what ever you want is the best way to incite them to learn computeur programming.
Meilleurs salutations ( as you said , cool)
jean
( i searched in the code and i did not saw this …( | \n+ | )

2 Likes

\n indicates a line break and is not always shown. If you copy your code and paste it into a text editor such as Notepad then the unexpected line break should be revealed. Or you can just delete the whole line (from the end of the previous line to the start of the next line) and re-type it.

2 Likes

hello Jeff

thank you for your help, i will try it.

2 Likes

hey man so I am using the same modules and an rpi3. It worked at first but when I tried it again I am receiving this

GPS is not ready
GPS is not ready
error 0

i did not touch any part of the code yet. I just change the number for the sms and tried to run it. Hope you can help me or If I can contact you somewhere else for more questions would be great. Thank you

2 Likes

Hey Russel,

That is what the script will type if it cannot connect to the GPS device. Because it cannot get the GPS details the script then can’t send out an SMS text. It only tries a couple of time before stopping.

Spend a little bit of time running the | GPS.py | script so that way the GPS dongle has a good idea of where it is generally based. The first couple of times it will take longer than afterward. Make sure the GPS antenna can see the sky and you should get an accurate GPS location very quickly after a couple of goes. Once the GPS module is trained/roughly understands where it is on Earth, it’ll get the connection much more reliably and indoors.

Hope above helps,
Tim

3 Likes

hello so I figured out the gps error but now I have a new error. Here are the errors

First error
get_gps_position()

Second error
answer = send_at('AT+CGPSINFO

Third error
FinalLat = float(Lat) + (float(SmallLat)/60)
ValueError: could not convert string to float: ‘\n+’

Those are the errors, I tried rewriting everything but I get the same error. Can you help me with these errors and can I contact you on other platform to discuss my errors. Looking forward for your response. Have a great day.

Hi Russel,

Thanks for sending that through, would it be possible to send a screenshot through of the REPL on the Pi?
It sounds like the error might be coming from the function that splits the returned values back - have you made any changes to the code?

Liam

sure sure where can I send the screenshot?

I just inserted my number and tried to run the code

2 Likes

Hi there, Tim. my name is Parth.
I am currently learning to operate this module and I had it for 1 month now and I am a noob . I was looking for some help
on this module for a very long time, your content is really helpful to someone somewhere in this big world.
Some questions I had are:

  1. Currently I am trying to connect this module to internet through a 4G LTE sim, I s it possible to do so?
  2. The module currently is being used without Raspberry Pi to achieve the objective. Is the approach correct?
    The software being used in this process for AT commands are ComLed, HTerm.
    **The device gets recognized by the computer through AT commands and the TX /RX communication occurs of the code , **
    ** The issues arises that, the cellular connection is missing with the module and the computer. **
    Additional details, I am trying to upload my file to a server.

Hi Tim. my name is Parth.
I am currently learning to operate this module and I had it for 1 month now and I am a noob . I was looking for some help
on this module for a very long time, your content is really helpful to someone somewhere in this big world.
Some questions I had are:

  1. Currently I am trying to connect this module to internet through a 4G LTE sim, I s it possible to do so?
  2. The module currently is being used without Raspberry Pi to achieve the objective. Is the approach correct?
    The software being used in this process for AT commands are ComLed, HTerm.
    **The device gets recognized by the computer through AT commands and the TX /RX communication occurs of the code , **
    ** The issues arises that, the cellular connection is missing with the module and the computer. **
    Additional details, I am trying to upload my file to a server.
1 Like

Hey Russel,

If you ever want to Add a picture to the forum just press the button I have highlighted in the image below.

Then I’ll best be able to help you mate. Also check higher up in the comment section. Another fellow had the same error due to the | \n + | above.

Regards,
Tim

3 Likes

Hey Prathmesh,

Love to know that someone somewhere in this big world is getting a helping hand :blush:.

Answer to 1 is definitely, a 4G LTE Sim will definitely work with this 4G SIM7600X HAT.
Answer to 2 is yes, I have seen a couple of people experiment with this 4G SIM7600X HAT without a carrier board. You can also connect it straight to a windows computer and there is some interesting software that opens up to you when doing so, like the serial debugging assistant. Check here for more - https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT

Hopefully that helps
Tim

2 Likes