Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5564

Python • Re: Checking Power State & Flow Control for SIMN7600 GPS/4G HAT

$
0
0
You could probably send a benign AT command and check if you get an OK response. If you do, it's on. If you don't, it's off. Or broken. Or not connected.
As long as that's the way to do it. My research has shown that damaging these components can be done surprisingly easy. It doesn't make sense that sending a command to a component that's off could damage it, but I've seen stranger things. I tried researching the answer and found solutions to identify the hat attached, but nothing to determine the power state.
"pressing the power button in then depressing it along with another 20 second wait for it to power up"

This sentence doesn't read very well. Do you mean press the power button then pressing and holding it?
Yeah, I didn't word that very well. The power on method looks like this:

Code:

def power_on(power_key):print('SIM7600X is starting:')GPIO.setmode(GPIO.BCM)GPIO.setwarnings(False)GPIO.setup(power_key,GPIO.OUT)time.sleep(0.1)GPIO.output(power_key,GPIO.HIGH)time.sleep(2)GPIO.output(power_key,GPIO.LOW)time.sleep(20)ser.flushInput()print('SIM7600X is ready')
As this is my first real dive into coding and interfacing with Python on a Pi so my understanding here is intuitive. When you physically hit a button there are two actions: you first press the button in before releasing it (what I called 'depress'). I think GPIO.output(power_key,GPIO.HIGH) is like pressing the button in where GPIO.output(power_key,GPIO.LOW) is the release. Two seconds seems like a very long time to be holding the button down. Again, I am being overly cautious here to make sure I don't break anything.

What does the datasheet for the module say? If there is a 20 second startup delay then wait for 20 seconds. Nothing hacky about that.

For power off, unless you really need to have an orderly shutdown for the module you could just not care.
The documentation is inadequate to say the least. I haven't seen anything on that. Maybe this is standard practice, but I've always checked to see if something could be done before doing it. Then again, this is my first time with this.

It is extremely unlikely that you're going to need flow control.
Thank you!

Statistics: Posted by MadDokK — Sat Feb 24, 2024 11:11 pm



Viewing all articles
Browse latest Browse all 5564

Trending Articles