Skip to content
Snippets Groups Projects
Commit 8ecde78a authored by Daniel Björk's avatar Daniel Björk
Browse files

Added pymongo connect and insert of stability(+pos placeholder)

parent 5ce0fbc0
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,16 @@ import pymongo
# For timestamping in MongoDB
import datetime
#pymongo connect
DBConHost = 'localhost'
DBConPort = 27017
DBName = 'matningar'
DBTableName = 'stability'
DBCon = MongoClient(DBConHost, DBConPort)
DB = DBCon[DBName]
DBTableStability = DB[DBTableName]
#DEFINE INPUTS HERE
#CLIENT - SENDER
......@@ -223,6 +233,15 @@ def udp_client_send(UDP_DEST_IP, UDP_DEST_PORT,
print("MOS: ", mos)
post = {
#"timestamp" : int(time.time()),
#Not needed since first 4bits of _id is timestamp
"stability" : mos,
"position" : False # Position appended here
}
DBTableStability.insert(post);
#START THE THREADS FOR SENDER AND RECEIVER
if __name__ == "__main__":
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment