Skip to content

Fixes water_deep_cm, adds bat_percent and updated some internals#35

Open
s2patrick wants to merge 2 commits into
dragino:mainfrom
s2patrick:patch-1
Open

Fixes water_deep_cm, adds bat_percent and updated some internals#35
s2patrick wants to merge 2 commits into
dragino:mainfrom
s2patrick:patch-1

Conversation

@s2patrick

Copy link
Copy Markdown

// Differences & Fixes compared to the original Dragino decoder:
// • Bugfix: Water_deep_cm often stayed 0 → now recalculated from IDC_input_mA as fallback.
// • Auto-detection of two byte layouts (IDC/VDC swapped) → decoder chooses the plausible one.
// • Battery values: Auto-scaling (×0.01 vs ×0.001) fixes mis‑decoded voltages.
// • New: Bat_percent field (battery %). For PS‑LS → Li‑Ion curve, for PS‑LB → Li‑SOCl2 curve.
// • New: raw_hex & layout fields for easier diagnostics.
// • Node_type is automatically distinguished between PS‑LB / PS‑LS (solar voltage detection).

// Differences & Fixes compared to the original Dragino decoder:
// • Bugfix: Water_deep_cm often stayed 0 → now recalculated from IDC_input_mA as fallback.
// • Auto-detection of two byte layouts (IDC/VDC swapped) → decoder chooses the plausible one.
// • Battery values: Auto-scaling (×0.01 vs ×0.001) fixes mis‑decoded voltages.
// • New: Bat_percent field (battery %). For PS‑LS → Li‑Ion curve, for PS‑LB → Li‑SOCl2 curve.
// • New: raw_hex & layout fields for easier diagnostics.
// • Node_type is automatically distinguished between PS‑LB / PS‑LS (solar voltage detection).
Refactor batPctLiSOCl2 function to improve readability and update interpolation points.
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.

1 participant