Skip to content

Pete1979/nibepi-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NibePi Raspberry Pi Image Build (pi-gen)

This directory provides a reproducible build setup (using Raspberry Pi pi-gen) to create a ready-to-run NibePi image with Node-RED and the node-red-contrib-nibepi node preinstalled.

Stack Versions (adjust in versions.env)

  • Base OS: Raspberry Pi OS (Bookworm Lite)
  • Node.js: 20.x LTS
  • Node-RED: 3.1.x
  • node-red-contrib-nibepi: 1.3.0 (contains 15-minute price interval logic)

Structure

raspi-image/
  versions.env                # Central version pins
  README.md                   # This file
  stage-nibepi/
    00-packages               # Additional Debian packages to install
    01-install/
      00-run.sh               # Install Node.js + Node-RED
    02-nibepi/
      00-run.sh               # Copy/Install project sources & flows
      flows.json              # Initial flows
    03-services/
      00-run.sh               # Install & enable systemd services
      node-red.service        # Node-RED unit
      nibepi.service          # Backend unit

Using with pi-gen

  1. Clone pi-gen:
    git clone https://github.com/RPi-Distro/pi-gen.git
    cd pi-gen
  2. Copy this stage into pi-gen root:
    cp -r ../node-red-contrib-nibepi/raspi-image/stage-nibepi ./
    cp ../node-red-contrib-nibepi/raspi-image/versions.env ./
  3. Create a config file (example):
    IMG_NAME="nibepi"
    STAGE_LIST="stage0 stage1 stage2 stage3 stage-nibepi"
    ENABLE_SSH=1
  4. Run build (Docker recommended):
    ./build-docker.sh
  5. Resulting image appears in deploy/ (e.g. nibepi-*.img).

First Boot

  • Hostname defaults to nibepi (set inside nibepi.service working dir assumptions).
  • Node-RED auto-starts and serves flows in /home/pi/.node-red.
  • Backend service nibepi.service runs /opt/nibepi/node-red-contrib-nibepi/index.js (adjust path if repo layout changes).
  • Place secrets (tokens, etc.) after first boot under /etc/nibepi/ (directory created by script if missing).

Customization

  • Change versions: edit versions.env before build.
  • Add packages: append to stage-nibepi/00-packages.
  • Additional services: add more unit files in 03-services and enable them in 03-services/00-run.sh.

Updating node-red-contrib-nibepi

If you bump the project version:

  1. Update versions.env.
  2. Re-run the build.

Notes

  • flows.json is a minimal placeholder referencing the contrib node category.
  • The interval detection for 15-minute pricing is included in this version.
  • Consider adding a first-boot wizard later for token injection.

Generated scaffolding. Adjust paths as needed before first build.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages