Example #1
0
def sleep(cause=""):
	""" Put modules to sleep """
	print("Sleep time.")
	if cause:
		print("Cause: %s" %cause)
	# Set GSM slow clock to 1
	#gsm.set_slow_clock()
	#gsm.sleep()
	gsm.stop()
	if gps.nofix: # Module running
		gps.sleep()
	pyb.stop() # Remember to enable RTC wakeup
Example #2
0
import rtb
import rtb.pindebug
import logging
#logging.basicConfig(logging.DEBUG)
from uasyncio.core import get_event_loop,sleep
from rtb.gsm import instance as gsm
rtb.pwr.GSM_VBAT.status()

get_event_loop().create_task(gsm.start())
#get_event_loop().create_task(rtb.heartbeat(1))
#get_event_loop().call_later(10000, gsm.at_test())

get_event_loop().run_until_complete(gsm.at_mode_init())
get_event_loop().run_until_complete(gsm.at_test())
get_event_loop().run_until_complete(gsm.set_flow_control())
get_event_loop().run_until_complete(gsm.at_test())

loop = get_event_loop()
loop.run_forever()

get_event_loop().run_until_complete(gsm.at_test())

get_event_loop().run_until_complete(gsm.stop())
rtb.pwr.GSM_VBAT.status()


#get_event_loop().run_until_complete(gsm.start())
#get_event_loop().run_until_complete(gsm.at_test())