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.

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 ( ... nstruction).

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

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.

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


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)



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 ( ... v1.000.pdf)

2) The access to the gpio need to add something like that: ... 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)

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

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!


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


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: ... 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 "". 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

if [ ! -e /sys/class/gpio/gpio4 ]; then
    echo "File exists."
    echo "4" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio4/direction
echo "0" > /sys/class/gpio/gpio4/value
sleep 2
echo "1" > /sys/class/gpio/gpio4/value

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/
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

Description=runs only upon shutdown


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: ... 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...

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


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.


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

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 8 guests