Skip to content

Conversation

SW-Niko
Copy link

@SW-Niko SW-Niko commented Apr 4, 2025

I've implemented a transmission error log for the VE.Direct connections (charge controller, shunt). The Live View displays the recorded transmission errors for each device per day. This allows you to check the quality of your VE.Direct connection.

grafik

Additionally, the log displays transmission errors in more detail every 60 seconds. You can see which errors (checksum, buffer overflow, etc.) were detected.

23:13:09.079 > [VE.Direct MPPT 10/9] Average transmission errors per day: 0.0
23:13:09.079 > [VE.Direct MPPT 10/9] Total Sum: 0, Frame Timeout: 0, Text Checksum: 0
23:13:09.133 > [VE.Direct MPPT 10/9] Hex Checksum: 0, Hex Buffer: 0, Nested Hex: 0
23:13:09.133 > [VE.Direct MPPT 10/9] Debug Buffer: 0, Unknown Data: 0, Invalid Char: 0

For the sake of completeness, I should also mention:

  • We cannot detect all errors (multiple errors with the correct checksum).
  • Sometimes a transmission error triggers multiple individual errors.
  • No average is calculated on day 1.
  • When the total error reaches 50,000, all error counters are automatically reset.

@SW-Niko SW-Niko marked this pull request as draft April 4, 2025 06:54
@AndreasBoehm AndreasBoehm requested a review from Copilot April 4, 2025 07:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • webapp/src/locales/de.json: Language not supported
  • webapp/src/locales/en.json: Language not supported
  • webapp/src/locales/fr.json: Language not supported

@SW-Niko
Copy link
Author

SW-Niko commented Apr 10, 2025

Update, System 2 days and 12h online

Live View:
grafik

Logging:
07:10:58.475 > [VE.Direct MPPT 11/12] Average transmission errors per day: 1.6
07:10:58.475 > [VE.Direct MPPT 11/12] Total Sum: 4, Frame Timeout: 0, Text Checksum: 3
07:10:58.569 > [VE.Direct MPPT 11/12] Hex Checksum: 0, Hex Buffer: 0, Nested Hex: 0
07:10:58.569 > [VE.Direct MPPT 11/12] Debug Buffer: 0, Unknown Data: 0, Invalid Char: 1

Copy link

github-actions bot commented May 1, 2025

Build Artifacts

Firmware built from this pull request's code:

Notice

  • These artifacts are ZIP files containing the factory update binary as well as the OTA update binary.
    Extract the binaries from the ZIP files first. Do not use the ZIP files themselves to perform an update.
  • These links point to artifacts of the latest successful build run.
  • The linked artifacts were built from fe93fb4.

@SW-Niko SW-Niko marked this pull request as ready for review May 1, 2025 08:14
@AndreasBoehm AndreasBoehm requested a review from Copilot May 1, 2025 18:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to log and display VE.Direct transmission errors in greater detail for both the MPPT charge controllers and the Victron SmartShunt. Key changes include:

  • Adding transmission error values in the JSON output for MPPT and SmartShunt.
  • Introducing new error counter and logging functions in the VeDirect frame handler.
  • Updating the VE.Direct data structure to map error codes to human‐readable strings.

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/solarcharger/victron/Stats.cpp Adds JSON entries for MPPT transmission errors.
src/battery/victronsmartshunt/Stats.cpp Updates Live View data to include transmission error value.
lib/VeDirectFrameHandler/VeDirectFrameHexHandler.cpp Updates error handling to include HEX_CHECKSUM errors.
lib/VeDirectFrameHandler/VeDirectFrameHandler.h Declares new error counter and logging function members.
lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp Implements error counting and logging, including transmission error averaging.
lib/VeDirectFrameHandler/VeDirectData.h and VeDirectData.cpp Adds mapping for transmission error codes to readable strings.
include/battery/victronsmartshunt/Stats.h Adds a new member to hold transmission error data for the SmartShunt.
Files not reviewed (3)
  • webapp/src/locales/de.json: Language not supported
  • webapp/src/locales/en.json: Language not supported
  • webapp/src/locales/fr.json: Language not supported
Comments suppressed due to low confidence (1)

src/solarcharger/victron/Stats.cpp:255

  • [nitpick] Consider aligning the naming for transmission error keys across device types. For consistency, either use 'MpptTransmitError' or a similar naming convention as used in the SmartShunt ('transmitError').
device["MpptTransmitError"]["v"] = mpptData.transmissionErrors_Day;

@SW-Niko
Copy link
Author

SW-Niko commented May 30, 2025

Now using DTU_LOGI to log the transmission errors.

@SW-Niko
Copy link
Author

SW-Niko commented Jun 13, 2025

Small improvement: Do not print the transmission faults in the logging if we do not have any.

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