SmartHome is a edge computing project applied to smart houses to test and compare performances between edge solution and traditionnal cloud computing solutions. This was realized for a course at the UQAC (University of Quebec at Chicoutimi) by : Timothée Corsini, Damien LIEHN and Thomas PIOT.
The project is composed of 3 applications :
- The sensors are Python applications that can generate simulated data and send them to a server to be processed. Sensors are also able to turn on/off some of simulated equipment (heat, clim).
- The Edge Server Application is a REST API in C# with ASP.NET Core 3 wich can receive HTTP requests. This application is made to process data received from sensors and to send statistics to the Cloud Server Application when asked.
- The Cloud Server Application is a Python application that can get statistics from the Edge Server Application.
The Edge Application is the central one, without this application, all other applications won't work because each of them interact with the edge server. To setup this application, you should install ASP.NET Core 3, then follow these steps :
- Run
dotnet restore
to install all dependencies - Install PostgreSQL 9 (or above)
- Create a postgres database called
edge
- Run the SQL script into your new database
- Copy/Paste the appSettings.json configuration file and rename the copy
appSettings.Production.json
- Change the ConnectionString by replacing connection information
- Run
dotnet publish --configuration Release
- Run
dotnet run bin/Release/netcoreapp3.1/Edge.dll
On Windows you can also run directly the application using Visual Studio (Skipping step 7 and 8).
Simply open the .sln
project file, setup the database and run the application.
If done correctly, you should see a web interface (Swagger) to test the API.
By the way, at step 5 you should rename the file appSettings.Development.json
if you're running under Visual Studio.
Follow these steps to run Cloud Application :
- Install PostgreSQL 9 (or above)
- Create a postgres database called
cloud
- Download and install Python 3 (3.6 or above is highly recommended)
- Run
pip install -r requirements.pip
- Run
python main.py
(i.e. run the main.py script)
Follow these steps to run Sensors :
- Download and install Python 3 (3.6 or above is highly recommended)
- Run
pip install -r requirements.pip
- Run
python main.py
(i.e. run the main.py script)