Task one focused on connecting the phone to the PC as a serial device and sending a message or making a call with the help of Minicom and AT Commands.
Now we have to write a program which will be our version of Minicom using Python. For this first a few packages need to be imported namely import serial(to establish serial communication) import time (to set delays ) and import sys.
To mimic the processes done in Minicom our code should first establish a connection with the GSM module of the GSM modem or Smartphone and then set the baud rate respectively.
After it establishes a connection the code checks the connection, signal quality and sets the device into text mode using the AT+CMGF command
Then the dictionary created in Task 3 comes in handy for sending messages to all the numbers extracted from the file with the help of AT+CMGS command.