class Modem

Control the modem interface.

Constructor

class omc048.modem

Create an modem object

Methods

modem.power(state: bool)

Set the modem peripheral on or off. Turn off for low power consumption mode.

  • bool is 1 or 0, True or False, corresponding to on and off.

Example

The following example disables the modem power supply

import omc048

modem_power = omc048.modem()

modem_power.power(False)

The following example shows how to setup a serial connection with the modem. The script will send an AT-command to the modem. The modem will respond with its product type (ME910C1-WW)

import omc048
import obs

modem_power = omc048.modem()
modem_power.power(True)

ser_modem = omc048.serial(7)
ser_modem.init(115200, txbuf=1024, flow=(ser_modem.RTS | ser_modem.CTS), timeout=10, timeout_char=3)

print("Wait 15 seconds to have the modem powerup")
obs.delay(15000)

ser_modem.write("AT+GMM")

obs.delay(50)

print(ser_modem.read())