Skip to content
Si Jones edited this page Oct 27, 2022 · 11 revisions

Welcome to the VE.DirectMQTTCANBUS wiki!

To install the code, download Visual Code from Microsoft, install it and under extensions install PlatformIO and Github extensions.

From the github extension, you can clone a online project, enter https://github.com/sijones/VE.DirectMQTTCANBUS.git and it will clone this repository to your PC.

Edit the config.h file and then compile and flash the code to a ESP32 using the upload icon within Visual Code, you may need to change the COM port within the Platformio project file.

All Libraries are automatically downloaded and added for the project.

Pin 33 of the ESP32 is connected to VE.Direct device, be careful doing this as the ESP32 is a 3.3v logic level device and some Victron devices use 5v logic levels, you may need to start with a resistor divider to lower the voltage, but if you see bad data in the serial monitor then this might be a sign of the victron being a 3.3v and therefore the ESP32 is not getting the proper logic level, in this case take out the resistors and go direct.

My Victron Smart Shunt is a 3.3v device and therefore directly connected, be very careful doing this, you may damage the Victron or ESP32 doing it wrong.

There is plenty of debug entries that are sent to the serial port, enable debugging level in the IDE and reflash to enable it to transmit the data.

Using a MCP2515 connected to the ESP32 you can send the battery data to your inverter, this is good for people who build their own LifePO4 battery packs, it allows multiple BMS's to be used completely independently and the state of charge is tracked by the smart shunt.

CAN Bus: CAN uses normal network/ethernet cable, pin 4 is CAN High, pin 5 CAN Low, I used a RJ45 patch panel connector and wired some Cat 5 from the MCP2515 using Blue (Can High) and Blue Stripe (Can Low) as this is a pair used in a normal network cable.

Shopping List:

Victron Smart Shunt Link
ESP32: Link
MCP2515 board used: Link

Home Assistant

Past the YAML code in the Home Assistant file in to your configuration and reload manual MQTT entries

Disclaimer: Using these links will allow me to earn a little bit of credit on my amazon account. Wiring diagram will be done shortly.

Clone this wiki locally