def debug(str): SparqEE.debug_print( str, SparqEE.debug["DEBUG"] )
def debug(str): SparqEE.debug_print( str, SparqEE.debug["DEBUG"] ) def debug2(cmd, ret): debug(cmd) debug( "---> CMD RET --->: " + str(ret) ) debug( "---> BUFFER --->" + SparqEE.buffer ) #----------------------------------------------------------------------------- try: SparqEE.cmd_setup() #set-up shield GPIO SparqEE.cmd_power() #power on SparqEE.cmd_connection() #check cellular connection # +12223334444 #BASIC SMS ret = SparqEE.at_sms("+"+num, sms) debug2 ("STATUS", ret) #----------------------------------------------------------------------------- SparqEE.debug_print( "***END***", SparqEE.debug["WARNING"] ) SparqEE.cmd_cleanup() #clean-up shield GPIO except: SparqEE.debug_print( "***END (exception)***", SparqEE.debug["CRITICAL"] ) SparqEE.cmd_cleanup() #clean-up shield GPIO print ("Unexpected error:"), sys.exc_info()[0] raise