This repository was created for the course: The web as an application platform. Linnaeus University, Sweden.
This Web of Thing is a real-time overview for a bunch of sensors connected to a Raspberry Pi 3 Model B.
- Temperature and humidity (AM2302).
- Air pressure (BMP180).
- Light sensor (TSL2561).
This application depends on the BCM2835 library that must be installed on your board before you can actually use this application.
You also need to have Node.js installed. How to install Node.js on Raspberry Pi
- Clone this repository or download the
.zipfile. - Extract folder to preferred location.
- Open up the terminal in the extracted folder.
- Install the required dependencies by typing
npm install - Start the server by typing
npm start - The server is now running at http://localhost:3000
| Method | Route | Description |
|---|---|---|
| GET | /model | List metadata about this WoT. |
| GET | /properties | List all available properties. |
| GET | /properties/temperature | Get current value from the temperature sensor. |
| GET | /properties/humidity | Get current value from the humidity sensor. |
| GET | /properties/pressure | Get current value from the pressure sensor. |
| GET | /properties/brightness | Get current value from the brightness sensor. |
| WebSocket channel | Description |
|---|---|
| temperature | Get current value from the temperature sensor. |
| humidity | Get current value from the humidity sensor. |
| pressure | Get current value from the pressure sensor. |
| brightness | Get current value from the brightness sensor. |
