|
|
||
|---|---|---|
| UCPSMain | ||
| README.md | ||
README.md
Setup for simulation
Install the programming language Go from this website:
https://go.dev/doc/install - This is needed for the local webserver.
Clone the repository:
https://gitty.informatik.hs-mannheim.de/3003075/UCPS_WS26-27.git
Install Arduino IDE:
https://docs.arduino.cc/software/ide/
Start a WiFi Hotspot from a phone and connect to it with the laptop or PC you will host the server from.
You can open the project in Visual Studio Code or just go to the folder UCPSMain through the terminal.
If go is already installed, you have to run the command go run main.go.
This should start the local webserver on the connected WiFi hotspot.
The terminal (or the embedded terminal in VS Code) will display the IP of your hotspot:
PS C:\Your\folder\location\UCPSMain> go run main.go
Heating server is running. Addresses of this PC (adapter name in brackets):
http://26.220.79.179:8080 [Radmin VPN]
http://192.168.X.X:8080 [WiFi] <--- YOUR HOTSPOT IP
Use the address of your Wi-Fi adapter (connected to the phone hotspot) as SERVER_IP in the Arduino sketch.
The server is always running on port 8080, no changes needed there.
You can open the file UCPSMain.ino in the Arduino IDE or in VS Code.
There are three things you need to change:
- In
line 9you have to type in the name of your hotspot:
const char wifiSSID[] = "YourHotspotName";
- In
line 10you have to type in your password:
const char wifiPASS[] = "YourHotspotPassword";
- In
line 14you have to enter the IP that was displayed in the terminal, where you are running your server.
const char SERVER_IP[] = "192.168.X.X";
After changing these 3 things, connect your PC or Laptop to your Arduino Board with the USB cable and upload the changed code.
Do NOT change anything else in the code!
If everything done correctly, you can access the website through the IP and the port given:
http://192.168.X.X:8080/
There you will see every live data that is coming from the Arduino, including the Temperature Sensor and if the heating element is turned on or off.
In the top right corner you can check, if the Arduino Board is connected or not. You can also test, if the heating element turns on, if the temperature is too low by turning it from Automatik to Manuell and then going to Temparatur selbst auswählen. Just set a really high temperature and see if the heating element turns on. The website should also display Heizung ist an in the top left corner.