# XBEE Low Power Direction (XBEE_LP <-> MCU) xbee_lp_dir = Pin('XBEE_LP_DIR', Pin.OUT_PP) xbee_lp_dir.high() # XBEE High Power Direction (XBEE_HP <-> MCU) xbee_hp_dir = Pin('XBEE_HP_DIR', Pin.OUT_PP) xbee_hp_dir.high() # --------------------------------------------------------------- # GSM Module Communication based socket interface (on XBEE-HP) # --------------------------------------------------------------- # Configure the network interface card (GSM) pwr = Pin('PWR_XBEE_HP', Pin.OUT_OD) nic = network.GSM(UART('XBEE_HP', 115200, rxbuf=1024, dma=False), pwr_pin=pwr, info=True) # --------------------------------------------------------------- # Main application process # --------------------------------------------------------------- async def app_proc(url, port): # Print info print('GSM connection started...\r\n') # Configure the GSM parameters nic.config(user='******', pwd='gprs', apn='internet', pin='1234') # Connect to the gsm network nic.connect()
from sty import UART # --------------------------------------------------------------- # GSM Module Communication based socket interface # --------------------------------------------------------------- # Configure the network interface card (GSM) pwr = Pin('PWR_GSM', Pin.OUT_OD) pon = Pin('M2M_PON', Pin.OUT_OD) rst = Pin('M2M_RST', Pin.OUT_OD) mon = Pin('M2M_MON', Pin.IN) nic = network.GSM(UART('GSM', 115200, flow=UART.RTS | UART.CTS, rxbuf=1024, dma=False), pwr_pin=pwr, pon_pin=pon, rst_pin=rst, mon_pin=mon, info=True) # --------------------------------------------------------------- # Main application process # --------------------------------------------------------------- def app_proc(): # Start up delay to allow REPL message utime.sleep_ms(1000) # Print info