129 lines
3.3 KiB
Markdown
129 lines
3.3 KiB
Markdown
# SL Transport Departures Display
|
|
|
|
A digital signage system for displaying transit departures and weather information. Perfect for Raspberry Pi-based information displays.
|
|
|
|

|
|
|
|
## Features
|
|
|
|
- Real-time transit departure information
|
|
- Current weather and hourly forecast
|
|
- Multiple screen orientation support (0°, 90°, 180°, 270°)
|
|
- Dark mode with automatic switching based on sunrise/sunset
|
|
- Custom background image support
|
|
- Responsive design for various screen sizes
|
|
|
|
## Quick Start
|
|
|
|
1. Clone this repository
|
|
2. Run the server: `node server.js`
|
|
3. Open a browser and navigate to: `http://localhost:3002`
|
|
|
|
## System Requirements
|
|
|
|
- Node.js (v12 or higher)
|
|
- Modern web browser with CSS3 support
|
|
- Internet connection for API access
|
|
|
|
## Raspberry Pi Setup
|
|
|
|
For a dedicated display on Raspberry Pi, we've included a setup script that:
|
|
|
|
1. Installs Node.js if needed
|
|
2. Creates a systemd service to run the server on boot
|
|
3. Sets up Chromium to launch in kiosk mode on startup
|
|
4. Disables screen blanking and screensaver
|
|
5. Creates a desktop shortcut for manual launch
|
|
|
|
To set up on Raspberry Pi:
|
|
|
|
```bash
|
|
# Clone the repository
|
|
git clone https://github.com/yourusername/sl-departures-display.git
|
|
cd sl-departures-display
|
|
|
|
# Make the setup script executable
|
|
chmod +x raspberry-pi-setup.sh
|
|
|
|
# Run the setup script as root
|
|
sudo ./raspberry-pi-setup.sh
|
|
|
|
# Reboot to apply all changes
|
|
sudo reboot
|
|
```
|
|
|
|
## Configuration
|
|
|
|
### Changing Transit Stop
|
|
|
|
To display departures for a different transit stop, modify the API_URL in server.js:
|
|
|
|
```javascript
|
|
const API_URL = 'https://transport.integration.sl.se/v1/sites/YOUR_SITE_ID/departures';
|
|
```
|
|
|
|
### Changing Weather Location
|
|
|
|
To display weather for a different location, modify the latitude and longitude in index.html:
|
|
|
|
```javascript
|
|
window.weatherManager = new WeatherManager({
|
|
latitude: YOUR_LATITUDE,
|
|
longitude: YOUR_LONGITUDE
|
|
});
|
|
```
|
|
|
|
## UI Settings
|
|
|
|
The gear icon in the top-right corner opens the settings panel where you can configure:
|
|
|
|
- Screen orientation
|
|
- Dark mode (auto/on/off)
|
|
- Background image and opacity
|
|
- Transit sites
|
|
|
|
Settings are saved to localStorage and persist across sessions.
|
|
|
|
## Architecture
|
|
|
|
The system consists of the following components:
|
|
|
|
1. **Node.js Server** - Handles API proxying and serves static files
|
|
2. **Configuration Manager** - Manages system settings and UI customization
|
|
3. **Weather Component** - Displays weather data and manages dark mode
|
|
4. **Clock Component** - Shows current time and date
|
|
5. **Departures Component** - Displays transit departure information
|
|
6. **Main UI** - Responsive layout with multiple orientation support
|
|
|
|
## Documentation
|
|
|
|
For detailed documentation, see [documentation.md](documentation.md).
|
|
|
|
## Troubleshooting
|
|
|
|
### Common Issues:
|
|
|
|
1. **Server won't start**
|
|
- Check if port 3002 is already in use
|
|
- Ensure Node.js is installed correctly
|
|
|
|
2. **No departures displayed**
|
|
- Verify internet connection
|
|
- Check server console for API errors
|
|
- Ensure the site ID is correct (currently set to 9636)
|
|
|
|
3. **Weather data not loading**
|
|
- Check OpenWeatherMap API key
|
|
- Verify internet connection
|
|
- Look for errors in browser console
|
|
|
|
|
|
## License
|
|
|
|
MIT License
|
|
|
|
## Acknowledgements
|
|
|
|
- OpenWeatherMap for weather data
|
|
- SL Transport API for departure information
|