Skip to content

UG96 Module

This module implements the Zerynth driver for the Quectel UG95/UG96 UMTS/HSPA modem (Product page).

The driver must be used together with the standard library GSM Module.

The following functionalities are implemented:

  • attach/detach from gprs network
  • retrieve and set available operators
  • retrieve signal strength
  • retrieve network and device info
  • socket abstraction
  • secure sockets
  • RTC clock
  • SM
  • SMS

Listening sockets for TCP and UDP protocols are not implemented due to the nature of GSM networks. Moreover, UDP sockets must be connected or bound explicitly in the code to select which kind of function to perform (send vs sendto and recv vs recvfrom).

The communication with UG96 is performed via UART without hardware flow control at 115200 baud.

This module provides the ug96Exception to signal errors related to the hardware initialization and management.

init

init(serial, dtr, rts, power, kill, status, power_on=LOW, kill_on=LOW, status_on=HIGH)

Initialize the UG96 device given the following parameters:

  • serial, the serial port connected to the UG96 (SERIAL1, SERIAL2, etc…)
  • dtr, the DTR pin of UG96 (not used yet)
  • rts, the RTS pin of UG96 (not used yet)
  • power, the power up pin of UG96
  • kill, the emergency off (kill) pin of UG96
  • status, the status pin of UG96
  • power_on, the active level of the power up pin
  • kill_on, the active level of the kill pin
  • status_on, the value of status pin indicating successful power on (can be zero in some pcb designs)
bypass

bypass(mode)

Bypass the modem driver to use the serial port directly. It has one parameter:

  • mode, can be 1 (non-zero) to enter bypass mode, or 0 (zero) to exit.
shutdown

shutdown(forced=False)

Power off the module by sending AT command (clean power-down).

If forced is given, use emergency off (faster, do not detach from network).

startup

startup()

Power on the module by pulsing the power pin.

Network Time

The UG96 has an internal Real Time Clock that is automatically synchronized with the Network Time. The current time can be retrieved with the following function:

rtc

rtc()

Return a tuple of seven elements:

  • current year
  • current month (1-12)
  • current day (1-31)
  • current hour (0-23)
  • current minute (0-59)
  • current second (0-59)
  • current timezone in minutes away from GMT 0

The returned time is always UTC time with a timezone indication.