class SIM7672

class SIM7672.modem(uart=machine.UART, baudrate=115200, handshake=True, debug=False)

Bases: object

Modem class for SIM7672 on MicroCat.1.

__init__(uart=machine.UART, baudrate=115200, handshake=True, debug=False)

Initialize the modem.

Parameters:
  • uart – UART instance for communication (default: UART(1))

  • baudrate – Baud rate for UART communication (default: 115200)

  • handshake – Enable hardware handshake (default: True)

  • debug – Enable debug output (default: False)

active(activate=None, reset=True)

Control or query the modem’s power state.

Parameters:
  • activate – True to power on, False to power off, None to check status

  • reset – Reset modem if powering on and already active (default: True)

Returns:

True if modem is active, False otherwise

config(param=None, apn=None, user=None, key=None, pdp=None, security=None)

Get or set modem parameters. For querying, parameters name should be quoted as a string, and only one parameter can be queries at time.

Parameters:
  • param – Specific parameter to get (default: None)

  • apn – Access Point Name (default: None)

  • user – Username for authentication (default: None)

  • key – Password for authentication (default: None)

  • pdp – PDP type (default: None)

  • security – Security type (default: None)

Returns:

Value of specified parameter if param is given, otherwise None

connect(apn=None, user=None, key=None, pdp=None, security=None, detach=True, retries=60, delay=500)

Connect to the cellular network.

Parameters:
  • apn – Access Point Name (default: None)

  • user – Username for authentication (default: None)

  • key – Password for authentication (default: None)

  • pdp – PDP type (default: None)

  • security – Security type (default: None)

  • detach – Detach before connecting (default: True)

  • retries – Number of connection attempts (default: 60)

  • delay – Delay between attempts in milliseconds (default: 500)

disconnect()

Disconnect from the cellular network.

ifconfig()

Get network interface configuration.

Returns:

Network configuration tuple (ip, subnet, gateway, dns)

isconnected()

Check if modem is connected to the network.

Returns:

True if connected, False otherwise

status()

Get PPP connection status.

Returns:

PPP connection status

Constants

SIM7672.SEC_NONE
SIM7672.SEC_PAP
SIM7672.SEC_CHAP