Page 1 of 1

Power on a modem at boot

Posted: Thu Nov 23, 2017 8:31 pm
by cvh17
I have two modem HATs.
Unit A is one of these: https://www.itead.cc/wireless/gsm-gprs- ... -v2-0.html.
Unit B is one of these: https://www.waveshare.com/product/modul ... ss-hat.htm

Using both a Pi model B+ and a Pi Zero, I can successfully turn on Unit A at boot by the addition of these commands to /etc/rc.local:

Code: Select all

echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 1 > /sys/class/gpio/gpio17/value
Unit B does not turn on automatically with these commands. Can anyone suggest a way of getting Unit B to turn on automatically, please?

Re: Power on a modem at boot

Posted: Fri Nov 24, 2017 10:09 am
by sora03
have you tried using a python code. use the gpiozero they have lot of examples
https://gpiozero.readthedocs.io/

Re: Power on a modem at boot

Posted: Fri Nov 24, 2017 2:42 pm
by cvh17
Thank you, I haven't heard of GPIO Zero, and will give that a try. I'll report back on success or otherwise.

Re: Power on a modem at boot

Posted: Fri Nov 24, 2017 3:12 pm
by cvh17
I've found the schematic for Unit B here: https://www.waveshare.com/w/upload/2/20 ... matic_.pdf. Looking at the section in the middle at the bottom (titled 'RPI GPIO'), it would appear that the power gpio is number 17, and so the code I have in /etc/rc.local should work (but doesn't) -- have I misunderstood the schematic? I've not dealt with gpio in the past.

Re: Power on a modem at boot

Posted: Sat Nov 25, 2017 7:04 am
by sora03
cvh17 wrote:
Fri Nov 24, 2017 3:12 pm
I've found the schematic for Unit B here: https://www.waveshare.com/w/upload/2/20 ... matic_.pdf. Looking at the section in the middle at the bottom (titled 'RPI GPIO'), it would appear that the power gpio is number 17, and so the code I have in /etc/rc.local should work (but doesn't) -- have I misunderstood the schematic? I've not dealt with gpio in the past.
GPIO 17 on the schematics is the physical PIN number the command that you used in the first post refers to the Broadcom pin numbering (BCM17)
I did not know the power pin based on the schematics. a pin reference can be found at: pinout.xyz
Is there any documentation besides the schematics on your hardware board?