ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Issue with Raspberry Pi zero and Waveshare gsm HAT

Thu May 23, 2019 3:21 pm

Hi everyone
I recently bought a Waveshare gsm/gprs HAT for a project and I follow the guide on the Waveshare site for the setup but my hat doesn't work perfectly.
I edit the /boot/config.txt and add the following line :
enable_uart=1
dtoverlay=pi3-miniuart-bt

I also installed minicom.
If I connect the Rpi and the HAT using the 40 pin , the HAT turns on and it finds the network (net led blink every 3 seconds) but if I try to send AT commands via minicom I don't have any response

I tried using wire for the connection (following the guide on the Waveshare site) but nothing has changed
I tried to use different power supply for the Rpi and the HAT but nothing has changed.


Can someone help me? Thx
Last edited by ice123 on Fri May 24, 2019 12:17 pm, edited 1 time in total.

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

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Thu May 23, 2019 3:40 pm

Do you have a link to the actual HAT you bought?

Have you tried

Code: Select all

ATE1
and press return then

Code: Select all

AT
and press return?

The first sets echo mode on
The second asks the HAT to confirm its status
Need Pi spray - these things are breeding in my house...

ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Fri May 24, 2019 12:21 pm

That's the link
https://www.waveshare.com/wiki/SIM800C_GSM/GPRS_HAT

And yes i tried ATE1 and then AT but they didn'work

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

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Fri May 24, 2019 2:39 pm

Does running pi_gpio_init.sh directly help?
Need Pi spray - these things are breeding in my house...

ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sat May 25, 2019 9:11 pm

I tried but it does not work

I also tried a loopback test connecting directly the pin 8 to 10 and then running a python script found on another tread
it seems that my RPi has got something wrong :lol:
these are the code and I attached the img:

Code: Select all

#!/usr/bin/env python

# Serial port testing

import serial

test_string = "Testing 1 2 3 4"

port_list = ["/dev/serial0", "/dev/serial0", "/dev/ttyS0", "/dev/ttyS0",]

for port in port_list:

    try:
        serialPort = serial.Serial(port, 115200, timeout = 2)
        print "Opened port", port, "for testing:"
        bytes_sent = serialPort.write(test_string)
        print "Sent", bytes_sent, "bytes"
        loopback = serialPort.read(bytes_sent)
        if loopback == test_string:
            print "Received", len(loopback), "valid bytes, Serial port", port, "working \n"
        else:
            print "Received incorrect data", loopback, "over Serial port", port, "loopback\n"
        serialPort.close()
    except IOError:
        print "Failed at", port, "\n"
Attachments
WhatsApp Image 2019-05-25 at 23.00.54.jpeg
LoopbackTest results
WhatsApp Image 2019-05-25 at 23.00.54.jpeg (93.59 KiB) Viewed 224 times
Last edited by ice123 on Sat May 25, 2019 9:36 pm, edited 1 time in total.

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

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sat May 25, 2019 9:34 pm

To be fair the code does not match the screen :lol:

Can you try a loopback on the pins and minicom?

Can you double check the console output is stopped and the serial port is enabled in

Code: Select all

sudo raspi-config
Need Pi spray - these things are breeding in my house...

ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sat May 25, 2019 9:40 pm

Sorry, my fault I wrong, I changed the code :lol.
How "Can you try a loopback on the pins and minicom?"

I checked that the serial port is enabled and the terminal output stopped

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

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sat May 25, 2019 10:35 pm

A loopback is just a wire with female DuPont connectors jumpered between TX and RX on the Pi.

Minicom is a basic terminal program https://help.ubuntu.com/community/Minicom

Set it to use the serial port at 9600 and try typing anything. It should show up on the screen fine if the serial ports are working.
Need Pi spray - these things are breeding in my house...

ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sat May 25, 2019 11:23 pm

I tried a loopback on minicom and after I abilitate the echo when I type any character I see that's duplicate. If I type A I see on the screen AA.
What does it mean? Does it work?

I used this command

Code: Select all

sudo minicom -D /dev/serial0 -b 9600

serial0 => ttyAMA0
serial1=>ttyS0

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

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sun May 26, 2019 12:53 am

That shows the serial port on the Pi is working fine.

Anything you type is sent over the TX line, picked up on the RX line and shown on the screen.

It may be best now to talk to your supplier and explained the Pi is Ok but you have an issue with the HAT.
Need Pi spray - these things are breeding in my house...

ice123
Posts: 6
Joined: Thu May 23, 2019 2:56 pm

Re: Issue with Raspberry Pi zero and Waveshare gsm HAT

Sun May 26, 2019 10:40 am

I'll try and I'll post if I need help

Thank you Andyroo

Return to “Beginners”