I have a combined GSM/GPS HAT and a Pi Zero. I can turn on the HAT manually using the power button, but would like it to power on at boot via /etc/rc.local. I can do something along the lines of this, within /etc/rc.local:

echo "17" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio17/direction
echo "1" > /sys/class/gpio/gpio17/value

My problem is I cannot work out which GPIO pin I need to manipulate in this manner. Number 17 doesn't do it. Will this information appear in the schematic for the HAT? I haven't a clue how to read schematics, but the relevant file is here: https://www.waveshare.com/w/upload/2/20/GSM-GPRS-GNSS-HAT-Schematic_.pdf

Can anyone tell me if I'm able to do it this way, and which GPIO pin(s) I need to manipulate, please?

2 Answers 2


Your power key goes to ground. How about setting the pin LOW? If that does not work you may need a lower impedance and you have to add a fet or resistor. (in which case the GPIO pin has to be high again to drive it) Get the spec of the chip and read upon the power key pin. I assume it has a voltage and/or current max/min value. Post edit: I assume you YOU have made a connection from the GPIO to the powerkey? There is none in the schematics.
To clarify: you have to make a wire connection from a GPIO pin to the signal PWRKEY. You probably have to solder the wire to the connection of the push button on the HAT board. Make sure you have the correct contact. Then if you set the GPIO pin LOW it is equivalent with pushing the button. I am somewhat confused why you would think you need GPIO 17 for that. Any unused GPIO pin is fine.

One more point: I have no idea why that the power button is present. Ask the supplier if you can power up with the button pressed. In which case the whole problem goes away as you can just put a short where the button is.

  • Thanks you, there is a power button, but as the Pi will be left unattended in the field I need to be able to power it on at boot. The solder joins on the power button broke off this morning, so I now have access to the pads beneath it. I've photographed the unit, please see photos.app.goo.gl/uVNwJ8y58FmzZ64g1. Can you please tell me how I can put a short where the button is? I can solder, I just don't what 'thing' to solder in (is it just a thin wire?) and which pads to join together? Please see also waveshare.com/wiki/GSM/GPRS/GNSS_HAT Dec 2, 2017 at 13:06
  • Probably the two inner ones. The two outer ones (nearest to the edge of the board) are very likely also ground and are there for mechanical support. If you want to be sure use an ohmmeter to check out what is connected where. (one side of the ohmmeter to ground the other to check the four pads.) Yes, just a thin wire between the two inner contacts.
    – Oldfart
    Dec 2, 2017 at 13:51
  • It works! Thank you very much indeed. I joined the two inner contacts as you suggested. Not the world's best soldering by any means (see photos.google.com/u/1/photo/…) and it needs to be refined (mechanically not a strong solution) but that's step 2. Step 1 is complete, thank you for your time and help. Dec 2, 2017 at 20:22
  • 1
    Also nice to hear it works. Many times you give advice and never hear from the 'customer' again.
    – Oldfart
    Dec 3, 2017 at 7:12
  • 1
    In case someone is looking for a software solution like I was, you can pull GPIO4 low to turn on the waveshare board. This was answered here by @filippo-baccani May 27, 2018 at 17:33

You can build a auto boot mode using a schema created by supplier: https://www.waveshare.com/wiki/File:GSM_GPRS_GNSS_HAT_power.png


  • 3
    Thanks for your answer but we are looking for comprehensive answers that provide some explanation and context. Very short answers cannot do this, so please edit your answer to explain why it is right. Additionally, we prefer answers to be self contained where possible. Links tend to rot so answers which rely on a link can be rendered useless if the linked to content disappears. If you add more context from the link, it is more likely that people will find your answer useful. Aug 26, 2018 at 11:17
  • 1
    I don't understand because you say it. In documentation the supplier show as you can transform the board to auto boot mode. I understand that with it so don't need make it in the power key button. It's right? I made in my board and she automatically started but I don't know why not work my ttySO port anymore. Maybe I did solder wrong. :( Aug 26, 2018 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.