GSM module

class GSM.GPS

Bases: object

[Class that handles GPS details]

static CalculateDeltaP(Position1, Position2)

[Method that calculates the distance between two points on Earth]

Parameters
  • Position1 ([float]) – [Point one on Earth]

  • Position2 ([float]) – [Point two on Earth]

Returns

[Distance between point one and point two]

Return type

[float]

EarthRadius = 6371000.0
class GSM.GSMHat(SerialPort, Baudrate, Logpath='gmsHat.log')

Bases: object

[Class that handles the GSM hat]

Call(Number, Timeout=15)

[Method that starts a call]

Parameters
  • Number ([str]) – [Receiver phone number]

  • Timeout (int, optional) – [Hang up after this number of seconds], defaults to 15

Returns

[Call performed]

Return type

[bool]

CallUrl(url)
Call_OnGoing()

[Method that checks if there is an active call ingoing]

Returns

  • True -> a call is ongoing

  • False -> there is not active call

Return type

[type]

ColData()
GPS_Data_List()

[Method that returns GPS details:

  • [Longitute]

  • [Latitude]

  • [Altitude]

  • [Course]

  • [GPS Satellites]

  • [GNSS Satellites]

  • [Movement Speed]

  • [Others]]

Returns

[GPS details]

Return type

[dict]

GetActualGPS()
HangUp()

[Method that hangs up a call]

PendingUrlCalls()
SMS_available()

[Method that checks how many received messages are]

Returns

[Number of text messages received]

Return type

[int]

SMS_read()

[Method that reads received text message]

Returns

[Text message]

Return type

[str]

SMS_write(NumberReceiver, Message)

[Method that sends a text message]

Parameters
  • NumberReceiver ([str]) – [Receiver message]

  • Message ([str]) – [Text message]

SetGPRSconnection(APN, Username, Password)
UrlResponse_available()
UrlResponse_read()
cGPRSstatusWaittime = 5000
cSMSwaittime = 2500
close()
regexGetAllValues = '([+][a-zA-Z:\\s]+)([\\w\\",\\s+-\\/:.]+)'
regexGetSingleValue = '([+][a-zA-Z\\ ]+(:\\ ))([\\d]+)'
start_GPS(command: str)

[Method that starts the GPS on the hat]

Parameters

command (str) – [command that starts the hat]

timeoutGPSActive = 1
timeoutGPSInactive = 2000
timeoutSerial = 5
class GSM.SMS

Bases: object

[Class than handles text messages]