def main(self):
        start_time = time.time()
        cpu_usage = psutil.cpu_percent()

        if getattr(sys, 'frozen', False):
            configFile = Path(os.path.dirname(sys.executable) + "/config.yaml")
        else:
            configFile = Path(
                os.path.dirname(os.path.abspath(__file__)) + "/config.yaml")
        with open(str(configFile), 'r') as stream:
            try:
                config = yaml.load(stream)
            except yaml.YAMLError as exc:
                print(exc)

        self.URL = "http://" + str(config['server']['host']) + ":" + str(
            config['server']['port'])
        self.apikey = self.getApiKey()
        textStorage = TextStorage(self.URL)
        sensors = Sensors()
        sensors.initializeSensors()

        # Continuously loop
        while True:
            # Construct our weatherdata json object
            cpu_usage = psutil.cpu_percent()
            ram = psutil.virtual_memory()
            ram_usage = ram.percent
            weatherdata = sensors.getSensorData(self.apikey, cpu_usage,
                                                ram_usage)

            #Previous semester Posting Method
            #time.sleep(4)
            #try:
            #r = requests.post(self.URL + '/api/weather', data = serv1)
            #if (r.status_code == 200):
            #  textStorage.sendWeather()
            # print("Sent: " + json.dumps(serv1))
            # elif (r.status_code == 400):
            #  print("Invalid API key")
            # Exception if unable to connect to server for the post request
            #except (requests.exceptions.ConnectionError):
            #print("Lost connection to server...storing data locally.")
            # textStorage.storeWeather(serv1)
            #  pass

            #The above commented code is the way previous semester posted to the server. We no longer need that because each individual Pi will not be posting anymore, and only Master will post.
            #Because of that, each Pi needs to store their data locally and broadcast via LoRa to Master.
            print("Lost connection to server...storing data locally.")
            textStorage.storeWeather(weatherdata)

            # Wait 3 seconds before restarting the loop
            time.sleep(self.WAIT_TIME)