@@ -7,6 +7,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HomeApi", "HomeApi\HomeApi.csproj", "{0F340BDE-7B8E-4ACD-8A24-5B5BFFB424F4}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HomeApi", "HomeApi\HomeApi.csproj", "{0F340BDE-7B8E-4ACD-8A24-5B5BFFB424F4}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ESP32_CODE", "ESP32_CODE", "{B3BCE85B-5021-4D4D-8758-CA7AAFF86C2D}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
Esp32_Code\ESPSCREEN\ESPSCREEN.ino = Esp32_Code\ESPSCREEN\ESPSCREEN.ino
|
||||||
|
Esp32_Code\INFOSCREEN_WITH_INTERVAL\INFOSCREEN_WITH_INTERVAL.ino = Esp32_Code\INFOSCREEN_WITH_INTERVAL\INFOSCREEN_WITH_INTERVAL.ino
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -20,5 +26,6 @@ Global
|
|||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{0F340BDE-7B8E-4ACD-8A24-5B5BFFB424F4} = {FF03E920-D5E9-4BE0-AA6F-DB2E9287D3E4}
|
{0F340BDE-7B8E-4ACD-8A24-5B5BFFB424F4} = {FF03E920-D5E9-4BE0-AA6F-DB2E9287D3E4}
|
||||||
|
{B3BCE85B-5021-4D4D-8758-CA7AAFF86C2D} = {FF03E920-D5E9-4BE0-AA6F-DB2E9287D3E4}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="..\README.md" />
|
||||||
<Content Include="..\.dockerignore">
|
<Content Include="..\.dockerignore">
|
||||||
<Link>.dockerignore</Link>
|
<Link>.dockerignore</Link>
|
||||||
</Content>
|
</Content>
|
||||||
|
|||||||
103
README.md
103
README.md
@@ -2,3 +2,106 @@
|
|||||||
Core api and Esp32 code for displaying weather data and public transport information on a e-ink display.
|
Core api and Esp32 code for displaying weather data and public transport information on a e-ink display.
|
||||||
|
|
||||||
<img width="800" height="480" alt="image" src="https://github.com/user-attachments/assets/ef5af0c6-ea3a-494d-b2af-3de6e70b3e6a" />
|
<img width="800" height="480" alt="image" src="https://github.com/user-attachments/assets/ef5af0c6-ea3a-494d-b2af-3de6e70b3e6a" />
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- Display current weather data
|
||||||
|
- Display public transport information
|
||||||
|
- Display time and date
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- ESP32 board
|
||||||
|
- E-ink display (e.g. Waveshare 7.5 inch)
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
This section provides instructions for setting up and running the HomeApi project.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) or later
|
||||||
|
- Docker (optional, for containerized deployment)
|
||||||
|
- Git (to clone the repository)
|
||||||
|
|
||||||
|
## Option 1: Local Development Setup
|
||||||
|
|
||||||
|
1. Clone the repository:
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Myxelium/HomeScreen.git
|
||||||
|
cd HomeApi
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Restore dependencies:
|
||||||
|
```bash
|
||||||
|
dotnet restore
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Build the project:
|
||||||
|
```bash
|
||||||
|
dotnet build
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Run the application:
|
||||||
|
```bash
|
||||||
|
dotnet run
|
||||||
|
```
|
||||||
|
|
||||||
|
The API will be available at `http://localhost:5000`.
|
||||||
|
|
||||||
|
## Option 2: Docker Deployment
|
||||||
|
|
||||||
|
1. Build the Docker image:
|
||||||
|
```bash
|
||||||
|
docker build -t homeapi .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run the container:
|
||||||
|
```bash
|
||||||
|
docker run -d -p 5000 --name homeapi homeapi
|
||||||
|
```
|
||||||
|
|
||||||
|
The API will be accessible at `http://localhost:5000`.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The application uses the standard .NET configuration system. You can modify settings in:
|
||||||
|
|
||||||
|
- `appsettings.json` - Default configuration
|
||||||
|
- `appsettings.Development.json` - Development environment configuration
|
||||||
|
|
||||||
|
API endpoints:
|
||||||
|
- Weather data: GET `/home`
|
||||||
|
- Generated image: GET `/home/default.jpg`
|
||||||
|
- Configuration data: GET `/home/configuration`
|
||||||
|
- Departure board: GET `/home/departure-board`
|
||||||
|
|
||||||
|
## API Documentation
|
||||||
|
|
||||||
|
When running, API documentation is available through Scalar at `/scalar`.
|
||||||
|
|
||||||
|
flowchart TD
|
||||||
|
subgraph ESP32 Device
|
||||||
|
ESP[ESP32 E-Ink Display]
|
||||||
|
ESP -->|HTTP GET /home/configuration| API
|
||||||
|
ESP -->|HTTP GET /home/default.jpg| API
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph HomeApi
|
||||||
|
API[HomeController (API)]
|
||||||
|
API -->|MediatR| Handlers
|
||||||
|
Handlers -->|Service Calls| Services
|
||||||
|
Services -->|Refit Clients| Clients
|
||||||
|
Clients -->|External APIs| ExtAPIs
|
||||||
|
API -->|Returns JSON/JPEG| ESP
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph ExternalAPIs
|
||||||
|
WeatherAPI[Weather API]
|
||||||
|
AuroraAPI[Aurora API]
|
||||||
|
NominatimAPI[Nominatim API]
|
||||||
|
ResRobotAPI[ResRobot API]
|
||||||
|
end
|
||||||
|
|
||||||
|
ExtAPIs -.-> WeatherAPI
|
||||||
|
ExtAPIs -.-> AuroraAPI
|
||||||
|
ExtAPIs -.-> NominatimAPI
|
||||||
|
ExtAPIs -.-> ResRobotAPI
|
||||||
20
compose.yaml
20
compose.yaml
@@ -1,13 +1,15 @@
|
|||||||
services:
|
version: '3.8'
|
||||||
homeapi:
|
|
||||||
image: homeapi
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
|
|
||||||
homeapi-1:
|
services:
|
||||||
image: homeapi-1
|
homeapi:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: HomeApi/Dockerfile
|
dockerfile: HomeApi/Dockerfile
|
||||||
|
image: homeapi:latest
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
|
volumes:
|
||||||
|
- ./HomeApi/appsettings.Development.json:/app/appsettings.Development.json:ro
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user