pi-supernode by KOSASIH is licensed under Creative Commons Attribution 4.0 International
This repository contains the source code for a simple Node.js application that runs on a Raspberry Pi. The application listens for incoming HTTP requests and responds with a message indicating the current temperature and uptime of the Raspberry Pi.
To run this application, you will need the following:
- A Raspberry Pi with Node.js installed
- A temperature sensor (such as a DS18B20) connected to the Raspberry Pi
- Clone this repository to your Raspberry Pi:
1. https://github.com/KOSASIH/pi-supernode
- Install the required dependencies:
1. cd pi-node
2. npm install
-
Edit the config.js file to specify the temperature sensor's device file path. For example, if you're using a DS18B20 connected to GPIO pin 4, the device file path will be /sys/bus/w1/devices/28-000005f8b8ff/w1_slave.
-
Start the application:
1. npm start
- Use a web browser or a tool like curl to send an HTTP request to the Raspberry Pi and view the response:
1. curl http://<RASPBERRY_PI_IP_ADDRESS>:3000
The response will look something like this:
1. Temperature: 23.5°C, Uptime: 1 day, 2 hours, 34 minutes, 56 seconds
This project is licensed under the MIT License - see the LICENSE file for details.