lnart / dryAgerEdgeDevice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DryAgerEdgeDevice

Introduction

This repository contains the hardware component management for DryAger systems. It facilitates the setup on a Raspberry Pi connected to various sensors. The device uses a local MongoDB server instance and a Node.js server to handle database connections, MQTT communication, and sensor data processing. Currently, sensor data reading is simulated with mock functions.

Related API repository: Link to API Repository

Table of Contents

Features

  • Read sensor data from connected sensors (currently mocked).
  • Process and analyze the sensor data.
  • Send data to a specified MQTT server.

Installation

Prerequisites

Steps

  1. Clone the repository to your Raspberry Pi:
    git clone [repository-url]
  2. Navigate into the cloned directory
    cd DryAgerEdgeDevice
  3. Install npm packages
    npm install
  4. Configure your dotenv file like in the configuration section

Usage

Dependencies

  • dotenv: Environment variable management.
  • express: Web server framework.
  • mongoose: MongoDB object modeling tool.
  • mqtt: MQTT client for Node.js.
  • nodemon: Utility that automatically restarts Node.js applications when files change.
  • onoff: GPIO access and interrupt detection with Node.js.

Configuration

  • DB_STRING: Connection string for the local MongoDB server. Default is mongodb://localhost:27017/localRecords.
  • MQTT_STRING: MQTT server URL.
  • MQTT_USERNAME: Username for MQTT server.
  • MQTT_PASSWORD: Password for MQTT server.
  • DB_DOCKER: Connection string for MongoDB when using Docker. Default is mongodb://host.docker.internal:27017/localRecords.

About


Languages

Language:JavaScript 91.8%Language:Dockerfile 8.2%