diff --git a/docs/rpi-documentation/Databaseconnection.md b/docs/rpi-documentation/Databaseconnection.md index 0372d01..de44bb4 100644 --- a/docs/rpi-documentation/Databaseconnection.md +++ b/docs/rpi-documentation/Databaseconnection.md @@ -1,13 +1,19 @@ ## Python code + explaination +We wanted to make a working connection between our websocket wich runs all the data gatherd by our nodes and a live feed to our database. +So we set out to make this connection using python. + +At first we needed to import the folowing librarys: ```js -// Here different librarys are imported to // everything is running async so the code can run together and not interfere with eachother. import asyncio import websockets // a library to connect to the database. import mysql.connector import json +``` +Then we began the process of connecting with both the websocket and the database. +```js //the data that has to be pushed needs to be async def process_data(data): try: