Python subprocess call will not return ERROR: Modem not connected

Hello
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
Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.