I am writing a python script and I want to check for a modem connected before I do anything else. This is the script that gets the signal strength.
p = subprocess.Popen(“sudo hologram modem signal” , stdout=subprocess.PIPE, shell=TRUE)
(output,err) = p.communicate()
p_status = p.wait()
This script will return the signal strength but returns output null err = none when the modem is disconnected.
How can I get the output ERROR: Modem not detected