No description
Find a file
Christian 061dd0e89a Original TTN-Credentials wiederhergestellt (DevEUI 0x7405)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 19:08:39 +02:00
src Original TTN-Credentials wiederhergestellt (DevEUI 0x7405) 2026-05-10 19:08:39 +02:00
.gitignore Initial commit 2026-05-01 17:18:56 +02:00
platformio.ini Initial commit 2026-05-01 17:18:56 +02:00
README.md Add README.md 2026-05-01 17:20:10 +02:00
ttn_decoder.js Initial commit 2026-05-01 17:18:56 +02:00

SmartShunt LoRaWAN

Liest Batterie-Daten eines Victron SmartShunt über die VE.Direct-Schnittstelle aus und überträgt sie per LoRaWAN (EU868, OTAA) an das The Things Network (TTN) oder ChirpStack.

Hardware

Komponente Details
Mikrocontroller Heltec CubeCell HTCC-AB01 (v2)
Batterie-Monitor Victron SmartShunt
Protokoll VE.Direct (19200 Baud, 8N1)
Funk LoRaWAN EU868, Class A

Verkabelung

SmartShunt VE.Direct TX  →  CubeCell RX (P3_0)
SmartShunt VE.Direct GND →  CubeCell GND

VE.Direct RX wird nicht benötigt (nur Empfang vom SmartShunt).

LoRaWAN Payload (8 Byte, Big-Endian)

Byte Inhalt Typ Einheit Beispiel
01 Spannung uint16 10 mV 1280 = 12,80 V
23 Strom int16 mA -5000 = 5,0 A
45 SOC uint16 950 = 95,0 %
67 Board-Akku uint16 mV 3850 = 3,85 V

TTN / ChirpStack Decoder

Die Datei ttn_decoder.js enthält den Payload-Decoder für TTN v3 und ChirpStack v4. Einfach als Uplink Formatter in der Konsole einfügen.

Ausgabe-Felder:

  • victron_voltage_V
  • victron_current_A
  • victron_soc_pct
  • board_battery_V

Konfiguration

In src/smartshunt_lorawan.ino die LoRaWAN OTAA-Zugangsdaten anpassen:

uint8_t devEui[] = { ... };
uint8_t appEui[] = { ... };
uint8_t appKey[] = { ... };

Sendeintervall (Standard: 60 Sekunden):

uint32_t appTxDutyCycle = 60000;

LED-Statusanzeige

Farbe Bedeutung
Weiß (kurz) Paket wird gesendet
Grün SOC > 70 %
Gelb SOC 3070 %
Rot blinkend Kein LoRaWAN-Join nach 30 s
Rot (3 s) SOC < 30 %

Build

pio run -e cubecell_board
pio run -e cubecell_board -t upload