question

mn avatar image
mn asked

Remote Console Data (not VRM) via a HTTP GET?

Is there an (easy) way to receive data from the Remote Console (not VRM) e.g. via a HTTP GET request (SSL). I am using Venus OS.
I need it for a local ESP32 data logger which saves the grid data (Pmin, Pmax, P) every 10 seconds. To dedect consumer analysis (peaks).

Or does anyone know a good local data logger (SD-Card) extension for the Raspi?

I assume that the remote console is only a web server or? If not is there a call/protocol description?

remote console
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
mn avatar image
mn answered ·

Thanks for the code and tips. Just watched the Victron Note-RED webinar. I think to get a future oriented solution it makes sense to get into Note-RED.
Solution for the Rasbi: Note-RED
Solution for ESP32 <-> EM24: Modbus
Need some time to think about it - thanks!!!

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mazzen avatar image mazzen commented ·

The Node-RED is exactly what I did above in my Code. Node-RED uses NodeJS under the hood and provides the data via Modbus in a visual framework and from there the data will be delivered. Personally I do like more to program it by myself and not use graphical interfaces. Modbus was my favorite because its industrial standard an can control Wago SPS, other brands of inverter (Growatt) etc. I am sure with all that information you will find your way :)

0 Likes 0 ·
mazzen avatar image
mazzen answered ·

Hi mn,

I am reading that data via ModbusTCP from my EM24 with my Raspberry Pi. I do also set diffrent values in my MultiPlus via the same way. The registerst are very well documented. You can request them vie email on the victron page. Modbus TCP is also possible on the ESP32.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mn avatar image
mn answered ·

Thanks mazzen for your answer.

Reading EM24 directly via Modbus was my plan B.
Plan C was to read the Rasbi or MuliPlus II registers.

Do you have a sample code or script for the Rasbi? I am not very familiar with the Venus OS, Linux and Rasbi. I come from the microcontroller programming. Do you (or other user) have a code for e.g. ESP32?
But reading the remote console directly can't be difficult. Find unfortunately no documentation.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mazzen avatar image mazzen commented ·

Basically you are reading all the information from the Remoteconsole when you are using Modbus-TCP. You only connect to the RC and from there you gather all information from the devices which are connected to the VE Bus or VE direct.

0 Likes 0 ·
mazzen avatar image
mazzen answered ·

A very basic example using NodeJS on the Raspi to get the state of the MultiPlus. Take a look at the Excel List from Victron and you will find out that we are looking for Register 31:

description Address Type Scalefactor Range dbus-obj-path writeable
VE.Bus state 31 uint16 1 0 to 65536 /state no


Assuming your IP of the Remoteconsole is 192.168.1.120:

const ModbusRTU = require("modbus-serial");
const modbus_client = new ModbusRTU();

modbus_client.connectTCP("192.168.1.120", { port: 502 });
modbus_client.setID(239);

var multiplus_data = {
    state: null
}

function modbus_gatherer() {
    function multi_vebus_state(number) {
        let result = null;
        switch (number) {
            case 0:
                result = "Off"
                break
            case 1:
                result = "Low Power"
                break
            case 2:
                result = "Fault"
                break
            case 3:
                result = "Bulk"
                break
            case 4:
                result = "Absorption"
                break
            case 5:
                result = "Float"
                break
            case 6:
                result = "Storage"
                break
            case 7:
                result = "Equalize"
                break
            case 8:
                result = "Passthru"
                break
            case 9:
                result = "Inverting"
                break
            case 10:
                result = "Power assist"
                break
            case 11:
                result = "Power supply"
                break
            case 252:
                result = "Bulk protection"
                break
        }
        return result
    }

    modbus_client.readInputRegisters(31, 1, function (err, data) {
        multiplus_data.state = multi_vebus_state(data.data[0])
    });
}

interval_modbus_gatherer = setInterval(() => {
    modbus_gatherer()
}, 1000);

You can also download tools like https://www.modbustools.com/download.html to easily test your modbus connection. This is by far the best way to get and set data in Victron system.

If you come from Microcontroller programming I you will have zero challange to use the ESP32 Espressif API: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/modbus.html

Happy coding :-)

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.