+8
-1
@@ -38,6 +38,13 @@ DISCONNECT_MESSAGE = "!DISCONNECT"
|
|||||||
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
server.bind(ADDR)
|
server.bind(ADDR)
|
||||||
|
|
||||||
|
|
||||||
|
# Open most recent Configuration and grab DB_PWD as a python variable
|
||||||
|
with open('/home/pi/BirdNET-Pi/thisrun.txt', 'r') as f:
|
||||||
|
this_run = f.readlines()
|
||||||
|
db_pwd = str(str(str([i for i in this_run if i.startswith('DB_PWD')]).split('=')[1]).split('\\')[0])
|
||||||
|
|
||||||
|
|
||||||
def loadModel():
|
def loadModel():
|
||||||
|
|
||||||
global INPUT_LAYER_INDEX
|
global INPUT_LAYER_INDEX
|
||||||
@@ -334,7 +341,7 @@ def handle_client(conn, addr):
|
|||||||
connection = mysql.connector.connect(host='localhost',
|
connection = mysql.connector.connect(host='localhost',
|
||||||
database='birds',
|
database='birds',
|
||||||
user='birder',
|
user='birder',
|
||||||
password='databasepassword')
|
password=db_pwd)
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
mySql_insert_query = """INSERT INTO detections (Date, Time, Sci_Name, Com_Name, Confidence, Lat, Lon, Cutoff, Week, Sens, Overlap)
|
mySql_insert_query = """INSERT INTO detections (Date, Time, Sci_Name, Com_Name, Confidence, Lat, Lon, Cutoff, Week, Sens, Overlap)
|
||||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """
|
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """
|
||||||
|
|||||||
Reference in New Issue
Block a user