Mar 152015
 

Letzte Woche habe ich meinen Victron BMV 700 für die neue Battery Bank erhalten.
Natürlich möchte ich die aus dem Battery Meter Daten live auswerten. Das BMV 700 verfügt über kein LAN / Ethernet Port, nur ein RS 232 mit TTL Levels.

In dieser Anleitung zeige ich Euch, wie man sehr günstig (ca. 15 Euro) den BMV 700 mit LAN Port ergänzen kann.

1. Den USR-TCP232-T bestellen. Sehr wichtig ist die T Version zu bestellen!!! Andere Version kann den BMV 700 zerstören aufgrund zu hohen Spannungen auf dem TTL Interface.
2. Den BMV 700 mit einem NullModem Kabel (GND, TxD, RxD) an das USR-TCP232-T wie unten verbinden.

BMV700 LAN Port

3. An das USR-TCP232-T einen USB Stecker oder einen externe +5V Spannung anschliessen.
4. Das USR-TCP232-T mit einem LAN Kabel an Router verbinden.
5. Mittels der TCPIP-232-V4.2.2.exe Software soll das USR-TCP232-T konfiguriert werden (Download Link: http://www.usriot.com/Download/28.html). Meine Konfiguration:
Module Work: Server Mode (sehr wichtig!)
Module IP: 192.168.2.22 (anpassen auf dein Netz)
Port: 23 (Bewusst Telnet)
Baud Rate: 19 200

6. Das USR-TCP232-T testen: einfach aus Kommando Zeile „telnet 192.168.2.22“ ausführen. Telnet sollte die Verbindung akzeptieren.
7. Den BMV 700 an die Batteriebank anschliessen.
8. In dem Kommandozeile Fenster sollten die ersten Daten ankommen:
z.B.
mgxmbpr2014:~ magic$ telnet 192.168.2.22
Trying 192.168.2.22...
Connected to 192.168.2.22.
Escape character is '^]'.

PID 0x203
V 12675
I -114
P -1
CE ---
SOC ---
TTG ---
Alarm OFF
Relay OFF
AR 0
BMV 700
FW 0305
Checksum ?
H1 0
H2 0
H3 0
H4 0
H5 0
H6 -75
H7 12599
H8 12677
H9 0
H10 0
H11 0
H12 0
H17 0
H18 0
Checksum o

Um die Informationen on-line darzustellen, habe ich ein kleines PHP Skript zusammengeklebt:
Solar live stats

0) $docOutputFileName = $docOutputFileName."/";

$jsonOutputFile = $docOutputFileName."bmv700GetData.json";
$htmlOutputFile = $docOutputFileName."bmv700GetData.html";

$date = date('Y-m-d H:i:s');

/* Erzeuge ein TCP/IP Socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
if ($socket === false) {
echo "socket_create() error: " . socket_strerror(socket_last_error()) . "\n";
} else {
echo "OK.\n";
}

$result = socket_connect($socket, $address, $service_port);
if ($result === false) {
echo "socket_connect() schulg fehl.\nGrund: ($result) " . socket_strerror(socket_last_error($socket)) . "\n";
} else {
//echo "OK.\n";
}

if (false !== ($bytes = socket_recv($socket, $buf, 512, MSG_WAITALL))) {
//echo "Las $bytes bytes von socket_recv(). Schliesse Socket...\n";

//echo $buf . "\n";

//split buf into array
$arr = explode("\r\n", $buf);
//var_dump($arr);

//loop from PID
$startline = "PID";

$output_array = array();
$output_array["Date"] = $date;

for ($idx = 0; $idx < count($arr); $idx++) { if (0 === strpos($arr[$idx], $startline)) { echo "beginning found\n"; //loop to next PID for ($idy = $idx + 1; $idy < count($arr); $idy++) { if (0 === strpos($arr[$idy], $startline)) { echo "end found\n"; break; } $keyval = explode("\t", $arr[$idy]); $key = $keyval[0]; $value = $keyval[1]; //remap key to text if ($key == "V") { $key = "Batt Voltage[mV]"; } else if ($key == "I") { $key = "Battery Current [mA]"; } else if ($key == "P") { $key = "Instantaneous Power [W]"; } else if ($key == "CE") { $key = "Consumed Amp Hours [mAh]"; } else if ($key == "TTG") { $key = "Time-to-go"; } else if ($key == "AR") { $key = "Alarm Reason"; } else if ($key == "H1") { $key = "Depth Of The Deepest Discharge [mAh]"; } else if ($key == "H2") { $key = "Depth Of The Last Discharge [mAh]"; } else if ($key == "H3") { $key = "Depth Of The Average Discharge [mAh]"; } else if ($key == "H4") { $key = "Number of charge cycles"; } else if ($key == "H5") { $key = "Number of full discharges"; } else if ($key == "H6") { $key = "Cumulative Amp Hours drawn [mAh]"; } else if ($key == "H7") { $key = "Minimum main (battery) voltage [mV]"; } else if ($key == "H8") { $key = "Maximum main (battery) voltage [mV]"; } else if ($key == "H9") { $key = "Number of seconds since last full charge [s]"; } else if ($key == "H10") { $key = "Number of automatic synchronizations"; } else if ($key == "H11") { $key = "Number of low main voltage alarms"; } else if ($key == "H12") { $key = "Number of high main voltage alarms"; } else if ($key == "H17") { $key = "Amount Of Discharged Energy [0.01kWh]"; } else if ($key == "H18") { $key = "Amount Of Charged Energy [0.01kWh]"; } $output_array[$key] = $value; } $json = json_encode($output_array); writeFile($jsonOutputFile, $json); writeFile($htmlOutputFile, arrayToTHTMLTable($output_array)); break; } } } else { echo "socket_recv() error: " . socket_strerror(socket_last_error($socket)) . "\n"; } socket_close($socket); function arrayToTHTMLTable($array) { $out = "

";
foreach($array as $k=>$v)
$out .= "

";
$out .= "

$k $v

";
return $out;
}

function writeFile($filename, $text) {
$wh = fopen($filename, 'w+');
if (!fwrite($wh, $text)) {
logMessage("Kann in die Datei $filename nicht schreiben", 0);
}
fclose($wh);
}

 Posted by at 22:44

  22 Responses to “Victron BMV 700 LAN / Ethernet Port”

  1. Hello,

    I’ve bought an USR-TCP232-T, and would love to use it with my BMV 702.

    Can you please let me know where you downloaded the TCPIP-232-V4.2.2.exe file from?

    Thank you and keep up the good work!

    Noel

  2. I googled it, but did not find it.

    Anyway. Thank you for the link.
    Will be testing my setup this weekend.

  3. Lucas,

    leider bin ich nicht programmier begabt und kann Deinen Blog nicht umsetzen.

    Es gibt ein ähnliches Projekt mit dem BMV600, https://github.com/jepefe/bmvmonitor bei dem mir die Darstellung sehr gut gefallen hat und auch eine android app existiert. Hier wird ein Raspberry Pi als webserver benutzt.

    Freundlichen Gruß!
    Heinrich

  4. Hallo und danke für diese Info. Werde versuchen dies in FHEM zu integrieren.

    Ich habe einen Aufbau fertiggestellt und die Schnittstelle auf 19200bd, 8N1 gesetzt.
    Leider empfängt das Gateway nichts über die ser. Schnittstelle.
    Sind diese Parameter korrekt? Oder gibt es einen besonderen Trick. (Irgendwelche Paramter inzustellen?)

    Gruß
    Andreas

  5. I am very excited about this project.

    I purchased also a BMV700 battery monitor.

    I have today ordered a USR TCP232-T module and will soon start with it.
    I have a question, where can I buy a plug that fits into the serial port of the BMV 700.

    Lex from Netherlands

  6. Thank you for your response.

    I wish you a happy and healthy new year

    I mean the small 4 pin plug on the back side of the BMV700. I go this week to the local electronics shop in Amsterdam for that part.

    I’m very curious about the operation and readout.

    Sincerely.

    Lex

  7. Nochmals Hallo

    Ja ich habe immer noch mein Problem, dass der BMV700 nicht mit dem Gateway komunizieren möchte.
    (Jedenfall kommt nix über Telnet rein)

    In meiner Verzweifelung habe ich nochmal in der Doku (VE Direct) von Victor durchgelesen. Dort steht, dass neben GND,TX,RX auch Power+ angeschossen werden soll. (Denke dies könnten +5V sein?)
    Habt Ihr dies mit angeschlossen?

    Bzg. des Pining auf dem BMV700
    Ich habe es so verstanden, das der linke Pin=1=GND ist.
    (BMV700 von der Rückseite mit dem Piepser nach oben betrachtet.)

    Wenn hier kein Fehler ist, dass wird es langsam eng für mich.
    Oder gibt es noch irgendwelche Parameter in BMV700 um die Schnittstelle zu aktivieren. Bei mir ist (fast) alles auf Factory setting.

    Gruß Andreas

  8. andreas nette info ! Danach kommen daten.

    Leider gibt es keine Infos um das Project zu vervollständigen.

  9. Hi Lukas, great work with our BMV. I have added your project to the list here:
    https://www.victronenergy.com/live/open_source:start?&#other_victron_related_open_source_projects

    I hope, and assume that you don’t mind me doing so.

    have a good weekend! Matthijs

  10. Hi

    This week i will continue with this project.

    Last year I bought the USR-TCP232-T interface module.

    I can not find the loose plug connector Therefore I have ordered a complete cable. Today I received the VE.Direct cable. Also i ordered a holes circuit board.

    It’s clear how I have to solder the wires.

    How I must program it hm mm this seems difficult to me.

    If i need your help than i know the way.

    Lex

  11. VE direct plug: the brand is JST. And the connector type is the PH Connector, 4 pin types. See http://www.jst-mfg.com/product/detail_e.php?series=199

  12. Ich finde das Projekt sehr intessant, der elektrische Teil ist kein Problem für mich.
    Auch verstehe ich die Konfig und die Abfrage der Daten mit Telnet.
    Aber was bitte mache ich dann mit deinem php Script, wohin mache ich diese und wie
    bekommen ich das dann so schön in eine html Seite ?
    Wäre für jede Hilfe dankbar. Jürgen

  13. hallo

    würdest du mir helfen wie hast du das mit deiner Solar anlage
    und dem display und der webpage gemacht

  14. Witam,
    Wstępne wiadomości Chciałbym wyrazić mój podziw dla monitorowania leczenia elektrowni słonecznych.
    Miałem wielką prośbę, czy masz mi rady jak mogę stworzyć podobny system jak twój.
    Mam kontroler Tristar, falownik Axpert 48 / 5kWMKS i akumulatorów niklowo-kadmowych oraz VictronBMV700 KPM 250Ah, z wyjątkiem baterii HW sam jak ty.
    Wszystko, mini podłączony do komputera z systemem Windows 10 i microATX używać oryginalnego oprogramowania dostarczonego przez producenta sprzętu (zob. Załączone zdjęcie).
    I w tym tkwi problem – Chciałbym wszystko zjednoczyć w jednej aplikacji, jak jesteś.
    Ale czy to w ogóle możliwe, aby go uruchomić na serwerze Windows lub NAS Zyxel NSA302- obsługuje MySQL oraz serwer WWW. (Raspberry2 używać jako centrum multimedialne z Kodi).
    Nade mną chodzi o pobieranie danych z sieci BMV700. Dla niego, w przeciwieństwie do ciebie należy użyć kabla Victron VE.Direct interfejs USB (AS030530000) zamiast konwertera RS232TTL-ETH.
    Dziękuję bardzo
    Radomir Pavlů

Leave a Reply to Andreas Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*