This is a simple Internet of Things (IoT) dashboard built with React.js, Express.js, and MongoDB. It allows you to control and monitor multiple IoT devices, such as Raspberry Pi's and Arduinos.
The project consists of three main parts:
-
The IoT devices, which periodically send a heartbeat to the server and can execute commands sent from the server.
-
The server, which is built with Node.js, Express.js, and MongoDB. It tracks the online status of each device and sends commands to them.
-
The dashboard, which is a React.js application that displays the status of each device and allows the user to send commands.
To set up the server:
- Navigate to the
server
directory. - Install dependencies with
npm install
. - Set up your environment variables in a
.env
file. See.env.example
for required variables. - Run the server with
npm start
.
To set up a Raspberry Pi device:
- Navigate to the
device
directory. - Install dependencies with
pip install -r requirements.txt
. - Run the device script with
python device.py
.
To set up an Arduino device:
- Open
device.ino
with the Arduino IDE. - Modify the
ssid
,password
,serverUrl
, anddeviceId
variables with your WiFi credentials, the server's URL, and a unique ID for the device. - Upload the script to the Arduino.
To set up the dashboard:
- Navigate to the
dashboard
directory. - Install dependencies with
npm install
. - Run the dashboard with
npm start
.
Once all parts are set up and running, you should be able to:
- See the status of each device on the dashboard, including the device's IP address and the status of each GPIO pin.
- Toggle each pin on or off by clicking the corresponding button.
- Send a script to a device by entering it into the input box and clicking "Send Script".