No need. In fact it's discouraged as it causes problems with keeping track of answers, and generally confuses everybody. Your message will be seen wherever it is posted.I wish I could post a topic in more than one board. This could easily go in the HAT or Interfacing board.
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.I've never really done anything with a pi other than load Lakka or RetroPie on it, so using a HAT with Python is very new to me. There is more information on what exactly I'm doing in the other topic I posted. I'm using a Waveshare SIM7600A-H GNSS HAT attached to my Raspberry Pi 3b with the documentation linked here. I've modified the code they provided to give myself a console so I could learn how it all worked. I'm currently focusing on the GPS aspect and have learned a LOT. There are a couple of things I'd like to do and am not sure how to go about it.
First and foremost I would like to be able to check if the SIM7600 HAT is on. I've programmed my code so that I can exit Python while leaving the module on so that I can update the code and start it again. When I do this I have to manually escape the power on method and would like to be able to just check programmatically if it's on.
[/quote]
Also, the provided example code uses the sleep function to wait between pressing the power button in then depressing it along with another 20 second wait for it to power up. It's a bit hackey and I'd prefer to query the HAT to see if it's ready instead of just waiting some set amount of time. It also has an 18 second wait time for the power down, though I'm not sure if that one has a better solution. The Python code I use for the console is linked here.
[/quote]
"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?
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.
It is extremely unlikely that you're going to need flow control.The documentation describes using flow control and says the SIM7600 default is hardware flow control.1.6.1 Software flow control (XON/XOFF flow control)
Software flow control sends different characters to stop (XOFF, decimal 19) and resume (XON, decimal 17)
data flow. It is quite useful in some applications that only use three wires on the serial interface.
The default flow control approach of SIM7500&SIM7600 Series is hardware flow control (RTS/CTS flow
control), to enable software flow control in the DTE interface and within GSM engine, type the following AT
Command:
AT+IFC=1,1
Ensure that any communications software package (e.g. Hyper terminal) uses software flow control.I didn't see anything in their example code that checks the RTS/CTS line. I was going to ask how to do this, but I can find that out on my own. Is this something I should look more into? Everything has worked fine so far, but I've only been receiving GPS data. I've yet to send SMS messages, but again their SMS code doesn't have anything that seems to correspond to this.1.6.2 Hardware flow control (RTS/CTS flow control)
Hardware flow control achieves the data flow control by controlling the RTS/CTS line. When the data
transfer should be suspended, the CTS line is set inactive until the transfer from the receiving buffer has
completed. When the receiving buffer is ok to receive more data, CTS goes active once again.
Thank you for your time.
Statistics: Posted by ame — Sat Feb 24, 2024 8:23 pm