3

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 Answers2

0

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.

Oldfart
  • 188
  • 1
  • 8
-1

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

GSM GPRS GNSS HAT

Greenonline
  • 2,969
  • 5
  • 27
  • 38