0

I am reading data from a BACnet thermostat and storing values in an sqlite3 database ~ every minute using the schedule library. I realized that the task keeps running even after I close the Chrome browser running Jupyter Lab and the terminal window. In my case this is a good thing but I assume this is unexpected operation since there are other questions posted on how to intentionally cause this to happen. Is this expected operation? I have to assume it is either bac0 or the schedule library keeping the process alive but that is my question. I'm running Linux Mint.

import time
from datetime import datetime
import schedule
import BAC0
import sqlite3

myIPAddr = '192.168.0.65/24'
bacnet = BAC0.connect(ip = myIPAddr)

def SetTempFromSchedule():
def StoreData():
def SetHeatTemp():
def SetCoolTemp():

schedule.every().minute.at(":00").do(setTempFromSchedule)

while True:
    schedule.run_pending()
    time.sleep(1)

Full python program

I was expecting the process to stop when Jupyter Lab and the terminal window which launched Jupter Lab were closed.

Other post

David Filler
  • 198
  • 7

1 Answers1

0

Instead of trying to figure out what is going on I just accomplished the task in a different way. I converted the .ipynb to a .py file using the 'Save and Export' function in Jupyter. Then I executed the .py script every minute using crontab as described here This also allowed be to delete the while loop and the schedule library which are now unnecessary.

David Filler
  • 198
  • 7