JK-BMS HW-Version 11.XW

Hallo Wer sein JK-BMS in das VANPi System integrieren möchte hier eine kleine Anleitung. “Eigene Gefahr”

  1. SSH-Verbindung zum PI herstellen: Verbinde dich zunächst per SSH mit deinem Raspberry Pi.
  2. Installiere benötigte Python-Pakete: Führe die folgenden Befehle aus, um die erforderlichen Python-Pakete zu installieren:
sudo python3 -m pip install cysystemd --break-system-packages
sudo python3 -m pip install mppsolar[systemd] --break-system-packages
sudo python3 -m pip install mppsolar[BLE] --break-system-packages

Teste die Installation: Überprüfe die Installation, indem du den Befehl mpp-solar -h ausführst. Dies sollte dir eine Hilfeanzeige für das mpp-solar-Tool anzeigen.

BLE Scann durchführen:

sudo timeout -s SIGINT 5 hcitool -i hci0 lescan

Erstelle einen Node-RED-Flow: Um die wichtigsten Daten aus dem BMS auszulesen und zu verarbeiten, kannst du den folgenden Node-RED-Flow verwenden:Hier ist der Flow-Code zum Kopieren und Einfügen:

[
    {
        "id": "f2c95db5.ba59a",
        "type": "tab",
        "label": "Scanning",
        "disabled": false,
        "info": "Examples of how to scan for devices"
    },
    {
        "id": "551e6c77c5a2914d",
        "type": "inject",
        "z": "f2c95db5.ba59a",
        "name": "trigger",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[]",
        "payloadType": "bin",
        "x": 520,
        "y": 520,
        "wires": [
            [
                "f3c6603ceff4716f"
            ]
        ]
    },
    {
        "id": "f3c6603ceff4716f",
        "type": "exec",
        "z": "f2c95db5.ba59a",
        "command": "jkbms -p "Hier muss die BLE MAC hin" -P jkv11 --getstatus",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 830,
        "y": 520,
        "wires": [
            [
                "bde08d0317ee3a2b"
            ],
            [],
            []
        ]
    },
    {
        "id": "bde08d0317ee3a2b",
        "type": "file",
        "z": "f2c95db5.ba59a",
        "name": "",
        "filename": "pekaway/bms",
        "filenameType": "str",
        "appendNewline": true,
        "createDir": true,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 1200,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "a0d27092352f7903",
        "type": "file in",
        "z": "f2c95db5.ba59a",
        "name": "",
        "filename": "pekaway/bms",
        "filenameType": "str",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 1200,
        "y": 580,
        "wires": [
            [
                "21778b93134db594"
            ]
        ]
    },
    {
        "id": "a3bdb66ba18b9c2f",
        "type": "switch",
        "z": "f2c95db5.ba59a",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "voltage_cell01",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "voltage_cell02",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "voltage_cell03",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "voltage_cell04",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "battery_t1",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "battery_t2",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "battery_voltage",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "current_discharge",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "current_charge",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "percent_remain",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "percent_remain",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 11,
        "x": 1470,
        "y": 580,
        "wires": [
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "21778b93134db594",
        "type": "split",
        "z": "f2c95db5.ba59a",
        "name": "",
        "splt": "\\n",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "",
        "x": 1350,
        "y": 580,
        "wires": [
            [
                "a3bdb66ba18b9c2f"
            ]
        ]
    },
    {
        "id": "72a2cbc48f39bfd8",
        "type": "inject",
        "z": "f2c95db5.ba59a",
        "name": "trigger",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "66",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[]",
        "payloadType": "bin",
        "x": 1040,
        "y": 580,
        "wires": [
            [
                "a0d27092352f7903"
            ]
        ]
    }
]
2 Likes