Skip to content

Config Resilience, RS‑485 Pacing, Docker Publishing, Node 20+, bug fixes#1125

Merged
tagyoureit merged 22 commits intotagyoureit:masterfrom
sam2kb:master
Nov 5, 2025
Merged

Config Resilience, RS‑485 Pacing, Docker Publishing, Node 20+, bug fixes#1125
tagyoureit merged 22 commits intotagyoureit:masterfrom
sam2kb:master

Conversation

@sam2kb
Copy link

@sam2kb sam2kb commented Sep 23, 2025

Key Changes

  1. Configurable RS‑485 transmit pacing via new controller.txDelays for finer collision avoidance and throughput tuning.
  2. Startup & config resilience: empty or invalid config.json now auto‑recreated from defaults, corrupt originals backed up.
  3. Latitude / longitude environment overrides to eliminate early heliotrope warnings prior to UI configuration.
  4. Version check enhancements: git detection, safer redirects, throttled polling, warning suppression.
  5. Docker improvements: fixed Dockerfile and added docker‑compose example with named volumes & environment variable guidance.
  6. Add workflow to build and publish docker images to GitHub Container registry.
  7. Runtime requirements: elevated minimum Node.js version to 20+, safe dependency and security/patch updates.
  8. Documentation updates.

I also fixed a few things in the dash app and will make a PR there as well. Both the server and dash docker images run great as a custom app in my TrueNAS with a forwarded USB-RS485 adapter to SunTouch pool controller.

@tagyoureit
Copy link
Owner

Thanks, a lot of good work here.

  • Why the need to re-write the comms (transmit pacing)? This hasn't really been an issue and the retry normally remedies any conflict.
  • Any reason not to combine the github workflows (see below)?
  • How did you generate the .github/copilot-instructions.md? Mostly curious on this as I haven't seen this type of doc before.

The requirement to move to Node v20 is a big jump (and not straightforward for many users). This would need to be done in sync with Dashpanel and REM. I'll wait for your PR on dP but REM will need to be updated as well.

-- Github workflows combined

name: Publish Docker Image (DockerHub + GHCR)

on:
  push:
    branches:
      - master
    tags:
      - "v*.*.*"
  workflow_dispatch:

jobs:
  build-and-push:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            tagyoureit/njspc
            ghcr.io/${{ github.repository_owner }}/njspc
          tags: |
            type=ref,event=branch
            type=ref,event=pr
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{major}}
            type=sha
            type=raw,value=latest,enable={{is_default_branch}}
          labels: |
            org.opencontainers.image.source=${{ github.repository }}
            org.opencontainers.image.revision=${{ github.sha }}
            org.opencontainers.image.title=njspc
            org.opencontainers.image.description=Pentair pool controller bridge (multi-registry)

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Login to GHCR
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push (DockerHub + GHCR)
        uses: docker/build-push-action@v6
        with:
          context: .
          push: true
          platforms: linux/amd64,linux/arm64,linux/arm/v7
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

      - name: Echo published tags
        run: |
          echo "Published: ${{ steps.meta.outputs.tags }}"

@sam2kb
Copy link
Author

sam2kb commented Oct 2, 2025

Why the need to re-write the comms (transmit pacing)? This hasn't really been an issue and the retry normally remedies any conflict.

I just made them configurable from config/env preserving current defaults. In my case this Sent Failure Rate dropped from 43% to 9%. I'm using the following params

"txDelays": {
      "idleBeforeTxMs": 60,
      "interFrameDelayMs": 50,
      "interByteDelayMs": 1
    },

Any reason not to combine the github workflows (see below)?

Sure. I just don't have docker hub login info, but that config looks good.

How did you generate the .github/copilot-instructions.md? Mostly curious on this as I haven't seen this type of doc before.

There's a gear button in VSCode Copilot -> Configure Chat -> Generate instructions

@tagyoureit
Copy link
Owner

Even 9% is very high for collisions. It's usually <0.05%. You may have some other issues going on (wiring?).

I still need to work on updating REM to Node v20 before approving these.

@tagyoureit
Copy link
Owner

FYI. #1131

@tagyoureit tagyoureit merged commit 193f7b0 into tagyoureit:master Nov 5, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants