SKT_CL_SR.py

Script description: the script executes following steps:

●   script configuration (IP address, remote & local ports, APN, PIN, PUK, NET_Operator)

●   check SIM status, insert SIM PIN or PUK when needed, and check for network registration -    socket configuration and GPRS context activation

●   client or server selection based on the input char received ('c' or 's' character to select one of the

●   2 options) o start client mode dialing the remote socket (skt1)

      start server mode configuring firewall and socket listen (skt2)

●   when client to server connection is established, every character sent on the serial port of one module is received by the remote module

●   suspend the socket with "+++" sequence

●   since MDM-SER bridge is active it is possible to send AT commands (AT#SO=1 to reconnect the socket or AT#SH=1 to close the connection)

●   the module is rebooted once DCD low status is detected

User inputs: edit these values in the script

-

NETWORK= "xxx"            

 

# this is the MNO name

-

PIN = ""                

 

# SIM card PIN

-

PUK = ""                

 

# SIM card PUK

-

NEW_PIN = ""                 

 

         # SIM card PIN

-

LOCAL_PORT  = xxxxx    

 

         # Local server port

-

REMOTE_IP   = "xxx.xxx.xxx.xxx"

 

# Remote server address

-

SUBNET_MASK = "255.0.0.0"

 

 

-

REMOTE_PORT = "xxxx"           

 

         # Remote server port

-

APN = "xxx.xxxxxxxx.xx"         

 

# APN, ask your network provider the correct value

Availability: any Telit product supporting Python