Commit ef07dc7b by arun.uday

commit4

parent c4ca5413
......@@ -8,6 +8,7 @@ config.read("conf/applications.conf")
# path
base_path = config.get("path", 'base_path')
sub_path = config.get("path", "sub_path")
full_path = base_path + sub_path
# mqtt
......
import sqlite3
from scripts.config.application_config import db_name, db_table
from scripts.config.application_config import db_name, db_table, full_path
from scripts.utilis.db_queries import DbQueries
class SqliteOperations:
def __init__(self):
# connecting to the database
self.conn = sqlite3.connect(db_name)
self.conn = sqlite3.connect(full_path + db_name)
def create_db(self):
try:
......
......@@ -14,6 +14,7 @@ app = FastAPI()
@app.get("/")
def receiver():
try:
def on_connect(client_name, userdata, flags, rc):
print(userdata, " ", flags)
print("Connected with result code " + str(rc))
......@@ -39,3 +40,6 @@ def receiver():
client.on_connect = on_connect
client.on_message = on_message
client.loop_forever()
except Exception as e:
print(e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment