BruceJohnJennerLawso
Posts: 8
Joined: Sat May 23, 2015 12:15 am
Location: Canada

Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu Mar 01, 2018 2:35 pm

I was looking for a solution to connecting a bluetooth headset to the pi, and having GPS/GSM access along with a RTC onboard sounded pretty good, so I ordered a waveshare GSM/GPS/Bluetooth/whatever hat. The shipping was reasonably quick even for ePacket from China (under a month IIRC?), and the build quality on opening up the package looks fantastic. It even came with an assortment of antennas and a snap connector that adapts the uFl port to a coax one, very handy if youre planning on removing the standard coax socket on the board for space reasons.

Im still slogging through a different project before I really dive into working on this, but my preliminary reading has been a bit confusing. The product page and the wiki page dont directly mention what protocol the hat uses to communicate, although Id strongly suspect its UART based off of the Pi setup instructions. The board also contains a set of 8 exposed IO pins with pairs of pairs of pins labelled A (USB - SIM868, B (Pi - SIM868), and C(USB - Pi). (You can see it in this photo where the yellow connector seems to be bridging it?)Image Id really like to be able to trim those pins down for space reasons, but Im unsure if theyre meant to act as some sort of switch that determines whether the sim module talks only over its onboard usb to uart port, or directly to the pi, or what.

Other than that, the setup seems like it should be fairly simple,the wiki indicates that communicating with the device just involves setting up a serial connection like you would with any other serial device, and then exchanging a list of these at commands back and forth with the hat will get responses about GPS position, GSM data, whatever. OH1KK has started work on a script that automates some of this in bash, on github here, although Im unsure how to start interfacing with the bluetooth functionality, will it automatically show up for the pi the same way that a bluetooth dongle will when plugged in?

Interested to hear some thoughts from others who are using or planning to use this hat.

Zombymumf
Posts: 1
Joined: Sat Mar 10, 2018 11:30 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sat Mar 10, 2018 11:39 am

Hi, I am using the HAT for a project so would be happy to collaborate on any issues.I am UK-based.

Please don't remove the pins until you are certain how you want to communicate with the HAT and can permanently connect the pins.They select how the usb connector is connected to the UART. This is made clear on the "related instruction" page (https://www.waveshare.com/wiki/GSM/GPRS ... nstruction).

Vrooooom
Posts: 1
Joined: Thu Feb 22, 2018 9:42 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Tue Apr 03, 2018 3:41 pm

Good morning, everyone,
have you made any progress on the subject?
I would like to use this card on RPI3 to connect to the Internet and send or receive SMS.
If you have some examples in Python :)
Thank you for your feedback, positive or negative!
I just received this module...
Thank you

travgonz
Posts: 1
Joined: Sun May 06, 2018 4:12 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sun May 06, 2018 4:16 am

Hey all, has anyone else made any progress with this?
I cant get it to work at all.
the wiki says to power it on and wait for the net light to blink once every 3 seconds and that will mean its connected.

mine always blinks 1 per second which apparently means its not connecting.

im using a sim from freedompop and veridfied that it works by plugging it into an ipad.

one thing i am curious about however. I know that when I plug a different sim into a normal phone type device I have to specify APN settings etc. in order for the sim to work at all. but no where does it specify where I can put APN settings, and shouldnt I have to configure that before it will connect?

if anyone has info on this that would be great. thanks.

Arnoldjp57
Posts: 3
Joined: Mon Mar 05, 2018 3:41 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sun May 13, 2018 4:21 pm

Hi

I am busy with a project using a Raspberry PI and have successfully done a proof of concept where I monitor input from the GPIO pins and send the info to a website using a https post request from where I send SMS's, monitor response etc etc
..... Basically, PI 3B python3/sqlite3/request and I2C for the 16X2 LCD display. Working very well using a wifi connection

So .... My challenge

I am trying to get this working on the PI zero 1.3 with raspian lite (uname -a 4.14.34+)

All the python related stuff is up and running

Installed a Waveshare GSM/GPRS/GNSS hat piggy backed onto the GPIO pins of the PI for the internet connection (Future GPS and Bluetooth as well)

Working SIM is installed in the hat and I have the 2 jumpers in the B position (PI-SIM868) (I have the net LED flashing every 3 seconds)

Installed minicom and can connect to /dev/ttyAMA0 and it responds to ATcommands ...

I have 3 basic issues to resolve and hope for any guidance from this forum


1. How do I configure and activate the GPRS connection for internet access?

2. How do I access other GPIO pins for my other inputs/outputs with the HAT in place?

3. How do I power up the hat automatically when the PI powers up?

I am based in Johannesburg (South Africa)

Regards

Arnold

caouane
Posts: 1
Joined: Sun May 27, 2018 3:40 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sun May 27, 2018 3:53 pm

Hi Arnold
1) The GPRS AT commands can be found on the datasheet of teh SIM868 (https://download.mikroe.com/documents/d ... v1.000.pdf)

2) The access to the gpio need to add something like that: http://canada.newark.com/piface/shim/gp ... dp/83X9199

3) to turns On/Off the board, you have to solder a wire betwwen the leg of the powerkey (the one close to the letter "p" of the label "powerkey" on the board) and a gpio (21 for example). Then set your gpio from high( 3 s) to low and the gsm will start (or stop if it On).

Hope it has help you...

On my side I have a problem to write the time in the rtc: I use AT+CCLK = "27/05/18,18:02:00+01"
to set the time. But if I turn of the power of the raspberry, AT+CCLK? gives me a blank date :cry:

would someone have an idea to solve this issue?

Hubert (Montpellier)

Arnoldjp57
Posts: 3
Joined: Mon Mar 05, 2018 3:41 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Mon May 28, 2018 4:29 am

Thanks for your reply
I have since found a post off the waveshare wiki to install ppp and configure the gprs
Have done the setup and the connection tries to start, but cannot connect
I am now trying to work out how to set the APN name for the mobile network ... when the SIM is in a usb dongle, it works ... the dongle seems to set the APN ....
any pointers/ words of wisdom will be greatfully received
Regards
Arnold

maverick123
Posts: 1
Joined: Fri Jun 22, 2018 12:24 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Fri Jun 22, 2018 12:36 am

Hi all,

Some days ago, I got this hat and I am trying to make it work on my Raspberry Pi 3. I would like to mount it in my car to use it as a GPS data logger. Also, I would like to send the data to my server in real-time with the GSM connection (SIM Card). Therefore, the Raspi would need to communicate with both GPS and GSM modules at the same time.

Regarding this, I have some questions:

1. As far as I know, the only way to communicate the HAT with the Raspi is with the Serial port (ttyS0 in Raspberry Pi 3). That is, it is not possible to establish more than one "communication channel" at the same time. Is this correct? If so, would it be possible to use GPS and GSM modules at the same time for the logger?

2. I have seen that it is necessary to switch the hat on with the PWRKEY button (long clicking it during 1-2 seconds until the STA led turns on) in order to make it work. Do you know if there is any way to switch it on without clicking on the PWRKEY button? I would like the hat to work automatically when the Raspi starts.

Thank you very much for your help!
Cheers!

Mav

zaphodbee
Posts: 1
Joined: Fri Aug 31, 2018 9:08 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu Sep 20, 2018 4:53 pm

Hi,

I recently got the Wavesahre GPRS/GPS HAT for a project to create a realtime or near realtime gps logger. There are not many tutorials using this HAT. So here is what i found helpful:

The easiest way to establish an internet connection is with the PPP configuration. The PPP configuration handles all the necessary AT commands. I used this tutorial to make my project work:https://www.digikey.com/en/maker/projec ... c5c1dc2ff0.
It's written for a different SIM modem (SIM808) but it works also with the one on the Waveshare HAT (SIM 868). Just follow the steps form "Part 2: Connecting the FONA."

You need the APN of your SIM provider. In my case it looks something like "gprs.myProvider.com". For the Serial port i used /dev/serial0. This worked on 3B+ and Zero W.
I disabled the pin code of my SIM before i put it into the Waveshare HAT. If you don't want to do this uncomment AT+CPIN=1234 in:

Code: Select all

nano /etc/chatscripts/gprs
The tutorial provides also the code to make a GPS logger that sends the data over the PPP connection. In my experience the code works well. I used it as a basis for my project.

To power on the HAT via a script rather than the power button i found this shell script:

Code: Select all

#!/bin/bash
if [ ! -e /sys/class/gpio/gpio4 ]; then
    echo "File exists."
    echo "4" > /sys/class/gpio/export
fi
echo "out" > /sys/class/gpio/gpio4/direction
echo "0" > /sys/class/gpio/gpio4/value
sleep 2
echo "1" > /sys/class/gpio/gpio4/value
Credit:https://raspberrypi.stackexchange.com/a/83621

To automate it at startup create a new file, copy & paste the code from above and save it with a .sh ending. Then open

Code: Select all

nano /etc/rc.local
. At the end of the file, before the exit 0 statement, write sudo and the file path to the shell script. It should look like this:

Code: Select all

sudo /home/pi/gipo4onoff.sh
exit 0
.

To power it off at shutdown go to

Code: Select all

cd /etc/systemd/system
and create a new empty file. Copy & paste the following code:

Code: Select all

[Unit]
Description=runs only upon shutdown
Conflicts=reboot.target
After=network.target

[Service]
Type=oneshot
ExecStart=/bin/true
ExecStop=/home/pi/gipo4onoff.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Change the file path under ExecStop to your shell script. Save the file with a .service file extension. Now we need to enable it:

Code: Select all

systemctl daemon-reload
systemctl enable yourServiceFile.service
systemctl start yourServiceFile.service
Credit: https://www.unix.com/red-hat/272693-whe ... tdown.html

Keep in mind that you can only have one connection over the serial port. With the PPP connection on, you can't send AT+CGNSINF to the HAT to get the actual gps location.

Hope this helps somebody save some time...

leroipele
Posts: 1
Joined: Mon Sep 24, 2018 4:55 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Mon Sep 24, 2018 5:39 pm

Hi

I'm trying to make my GSM Hat work with a ZeroW. I have the net LED blinking every second. How to I know on what port the HAt is connected to. I think it is on ttyAMA0 but not sure.

Could you help me to go further on this or tell me where I could find a tutorial to carry on.

Thanks

zapzero
Posts: 1
Joined: Tue Oct 16, 2018 7:45 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Tue Oct 16, 2018 8:00 pm

Hi leroipele,
I just connected the waveshare with my raspberry pi zero w.
- put the jumpers to position B
- logged in with putty via wifi to the raspberry
- had to switch off debug interface in config
- started the screen console with

Code: Select all

screen /dev/ttyS0 115200
in the empty console write AT and get the response OK

btw. the net led should flash every 3s if conncted to the provider. I had to remove the sim pin (with my old handy)

good luck

barrychapman
Posts: 4
Joined: Thu Oct 25, 2018 2:55 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu Nov 01, 2018 7:01 pm

Zombymumf wrote:
Sat Mar 10, 2018 11:39 am
Hi, I am using the HAT for a project so would be happy to collaborate on any issues.I am UK-based.

Please don't remove the pins until you are certain how you want to communicate with the HAT and can permanently connect the pins.They select how the usb connector is connected to the UART. This is made clear on the "related instruction" page (https://www.waveshare.com/wiki/GSM/GPRS ... nstruction).
did you get this thing working? I cannot get mine to connect to the network.

Somebody47
Posts: 1
Joined: Thu Nov 22, 2018 8:03 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu Nov 22, 2018 6:16 pm

Hey,
does it work with modem manager ?

https://www.freedesktop.org/wiki/Software/ModemManager/

I've started a kotlin https://github.com/cretudorin/SIM800 project for this modem. I hope to make a http client and mqtt or websockets client.

SeppPi
Posts: 13
Joined: Sat Sep 30, 2017 2:30 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Wed Mar 13, 2019 4:28 pm

Hello, has anyone an easy solution to use the gpio ports while the Waveshare HAT is on the RPi?

Greetings!

YitEarp
Posts: 45
Joined: Mon May 13, 2019 7:44 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu May 16, 2019 5:36 pm

Hopefully this isn't dragging up a zombie thread but i figured you guys @SeppPi may be able to help.

I have this setup and i can get AT commands working.

I have a sim with the carrier EE but i have misplaced any documentation i had including its number

Where might i find this information? Would it be as simple as entering a command to read the data from the SIM?

ThankYou

EDIT** Got GSM commands working managed to send SMS messages!

Now i just need something that will make life easier than using AT commands and have this all setup so i can text the device to give me details of GPS location etc etc

Andyroo
Posts: 4161
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu May 16, 2019 6:21 pm

To find a cards number you can try AT+CNUM but it dies not work all the time :cry: Depends if the firmware you have in the carrier board supports it or not.

Best way is to either put the sim in a phone and dial another mobile or send a text to a phone!
Need Pi spray - these things are breeding in my house...

YitEarp
Posts: 45
Joined: Mon May 13, 2019 7:44 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu May 16, 2019 7:51 pm

Hey thanks for the reply i got things working regards the SIM still learning AT commands and hope i can do some scripting to make life easier.

But as of right now i cannot get any of these commands to return a response

cat /dev/ttyS0
cat /dev/ttyAM0 - I believe this is for pi 3 usage and not pi zero in my case.

Using minicom -D /dev/ttyS0

I can issue commands to GPS and poll it no problem so there must be a setting somewhere i have missed. Any clue where to look?

Using screen /dev/ttyS0 115200

I can use AT commands so the device is working

But gpsmon gives no info?

zicmama
Posts: 1
Joined: Fri May 17, 2019 8:30 am

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Fri May 17, 2019 9:12 am

When you activate serial communication (UART) between RPi & GSM pHAT, system is using it for console. As serial port cannot handle multiple simultaneous use, it makes trouble.

Remove console=serial0,115200 from /boot/cmdline.txt and reboot ;)

YitEarp
Posts: 45
Joined: Mon May 13, 2019 7:44 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Fri May 17, 2019 1:29 pm

zicmama wrote:
Fri May 17, 2019 9:12 am
When you activate serial communication (UART) between RPi & GSM pHAT, system is using it for console. As serial port cannot handle multiple simultaneous use, it makes trouble.

Remove console=serial0,115200 from /boot/cmdline.txt and reboot ;)
I don't have that line in cmdline.txt

must i setup PPP in order for GPS data to read from gpsmon? Surely not but am running out of things to try as cpgs -s just results in timeout i figured it might be using the wrong baud rate so i set that to 9600 and still get no data back.

for note i am using the GSM hat via a pi zero with pre soldered header and i have set jumper to B to communicate with the serial of the pi.

Just hit a wall here minicom -D /dev/ttyS0 returns commands from AT but not gpsmon.

Frustrated.

So on further testing plugged into a windows machine and using the relevent COM port i can send AT commands for GNSS/GPRS etc

But when i switch over to the pi zero and try to use cgps -s no data is retrieved. I am using /dev/ttyS0 since i only have listed ttyAMA0 and ttyS0

I am unsure on how gpsmon works - Does it send the relevent AT commands to retrieve the data?

It got me thinking that maybe the gps part of the device isn't active and the only way i can get info from it is via minicom -D /dev/ttyS0

Lost on what to try next.

YitEarp
Posts: 45
Joined: Mon May 13, 2019 7:44 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sun May 19, 2019 4:00 pm

Well i made some progress but not really all that much.

I have since managed to get the PPP connection running from boot as well as the pwrkey script to turn on the hat at boot all work fine.

But as stated this device cannot use the serial port for more than one command.

I was wondering if its possible to turn off the bluetooth module and port over that unused port to enable both the gprs and gps systems to act together?

Now though the hat lights flash trying establish connection but after a few seconds die. I believe this is my SIM provider blocking the sim because if I use another working sim the connected lights stay on.

This is bad because one provider doesn’t require a password in ppp setup where another does (ee) as I couldn’t figure out where to put the password

quite
Posts: 2
Joined: Fri May 31, 2019 12:46 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Fri May 31, 2019 1:07 pm

I'm looking at these waveshare rpi hats. As a newbie, i'm wondering if they can be powered through the hat-connection, or if they generally require external power?

YitEarp
Posts: 45
Joined: Mon May 13, 2019 7:44 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Sun Jun 02, 2019 11:00 am

quite wrote:
Fri May 31, 2019 1:07 pm
I'm looking at these waveshare rpi hats. As a newbie, i'm wondering if they can be powered through the hat-connection, or if they generally require external power?
They can be powered by the pi GPio pins. Either use a header or solder the wires yourself. Look for a pi with a pre soldered header makes life simple

quite
Posts: 2
Joined: Fri May 31, 2019 12:46 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Mon Jun 03, 2019 8:34 am

I also got this answer from the manufacturer, Waveshare; "For stable working, we recommend you to connect external power adapter as
sometime the peak current of the SIM module may reach to 2A."

SeppPi
Posts: 13
Joined: Sat Sep 30, 2017 2:30 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Thu Jun 20, 2019 8:44 am

Hello,

does anyone know, if the waveshare gsm hat affects the camera unit on the raspberry pi? Because if I plug the hat on the RPi, then I can't use the camera.

Greetings

raspiGPS
Posts: 1
Joined: Mon Jul 08, 2019 3:59 pm

Re: Anyone familiar with the Waveshare GSM/Bluetooth Hat?

Mon Jul 08, 2019 4:05 pm

YitEarp wrote:
Fri May 17, 2019 1:29 pm
zicmama wrote:
Fri May 17, 2019 9:12 am
When you activate serial communication (UART) between RPi & GSM pHAT, system is using it for console. As serial port cannot handle multiple simultaneous use, it makes trouble.

Remove console=serial0,115200 from /boot/cmdline.txt and reboot ;)
I don't have that line in cmdline.txt

must i setup PPP in order for GPS data to read from gpsmon? Surely not but am running out of things to try as cpgs -s just results in timeout i figured it might be using the wrong baud rate so i set that to 9600 and still get no data back.

for note i am using the GSM hat via a pi zero with pre soldered header and i have set jumper to B to communicate with the serial of the pi.

Just hit a wall here minicom -D /dev/ttyS0 returns commands from AT but not gpsmon.

Frustrated.

So on further testing plugged into a windows machine and using the relevent COM port i can send AT commands for GNSS/GPRS etc

But when i switch over to the pi zero and try to use cgps -s no data is retrieved. I am using /dev/ttyS0 since i only have listed ttyAMA0 and ttyS0

I am unsure on how gpsmon works - Does it send the relevent AT commands to retrieve the data?

It got me thinking that maybe the gps part of the device isn't active and the only way i can get info from it is via minicom -D /dev/ttyS0

Lost on what to try next.
Hi,

I am new to raspberry and I have the same problem with the "SIM7600E-H 4G HAT" from waveshare that you have:
when I use minicom it gives me the correct GPS Signal (after turning the hat on with "AT+CGPS=1"), but just setting the serial settings via stty command and then cat /dev/ttyS0 does not give me any result.

Did you figure something out?
Is there another command to "start" the GPS/LTE device via the command window instead of using minicom?

Thanks a lot for your help!

Return to “HATs and other add-ons”