Simulate CAN BMS to check Inverter compatibility?

by Hazel Soul · 3 weeks ago 39 views 5 replies
Hazel Soul
Hazel Soul
Active Member
11 posts
thumb_up 1 likes
Joined Aug 2024
3 weeks ago
#27707

Been mulling this over for a bit after swapping out my old AGM bank for a Fogstar Drift LiFePO4 on the boat. The inverter/charger kept throwing fits until I got the DVCC settings sorted in Victron's ecosystem — but that got me wondering about folks running non-Victron inverters.

If your inverter claims CAN BMS compatibility but you can't easily test it before committing, is there a practical way to simulate the BMS comms signal? Like a Raspberry Pi or Arduino running a spoofed CAN protocol to see how the inverter actually responds before you've got £££ of batteries wired up?

I've seen some chatter about PCAN adapters and using open-source CANbus tools on Linux to sniff/replay signals, but haven't tried it myself. Feels like it could save a lot of headache — especially for anyone buying second-hand inverters off eBay where you can't guarantee the firmware's up to date.

A few questions worth chewing over:

  • Which CAN BMS profiles are most common in UK setups right now? (Pylontech seems everywhere)
  • Has anyone actually built a test rig like this?
  • Any gotchas with proprietary protocols — looking at you, SolaX 😅

Would be dead useful for the narrowboat/off-grid crowd where swapping kit out mid-season is a proper nightmare. Curious what others reckon — is this overcomplicating it, or genuinely worth the effort?

RetiredPlumber
RetiredPlumber
Regular
77 posts
thumb_up 17 likes
Joined Jan 2024
3 weeks ago
#27737

Good shout on the DVCC side of things, @HazelSoul.

For actually simulating CAN BMS comms before committing to hardware, a Raspberry Pi running can-utils on a MCP2515 hat can spoof basic BMS frames. Lets you check whether your inverter/charger recognises the battery properly without having cells connected.

Worth noting:

  • Victron's VE.Can protocol is well-documented — you can pull the CCGX source from GitHub and work backwards
  • Some Fogstar units use a JK BMS internally which has its own CAN implementation, not always identical to what Victron expects
  • DVCC with "BMS controls charge voltage" enabled is usually the sticking point — if the inverter isn't seeing valid frames it'll either fault or fall back to fixed voltage mode silently

I went through similar grief getting my static caravan setup stable. Ended up using a USB-CAN analyser to sniff the actual frames first before bothering with simulation.

SOC_Nerd
SOC_Nerd
Active Member
31 posts
thumb_up 7 likes
Joined Feb 2024
3 weeks ago
#27756

@HazelSoul done exactly this when I was integrating my Fogstar Drift with a Multiplus II. Grabbed a Raspberry Pi and ran dbus-spy alongside a CAN hat — lets you sniff what a real BMS is actually broadcasting before you go faking anything.

For actual simulation, CANtact or a cheap USBtin adapter with python-can will let you spoof BMS frames to your inverter. Just need to know the correct PGN/address for your protocol (Victron's DVCC typically wants a compatible BMS on address 0x35 for Pylontech-style comms).

Fair warning though — get the SoC scaling wrong and your Multiplus will either sulk in passthrough or thrash the cells. Test on bench before anything live. I learnt that the hard way with a 48v bank that didn't appreciate being lied to about its state of charge.

OffGrid Julie
OffGrid Julie
Active Member
13 posts
Joined Dec 2024
3 weeks ago
#27772

@SOC_Nerd a Raspberry Pi pretending to be a BMS is basically just my narrowboat's entire electrical system at this point — held together by Python scripts and questionable decisions.

For anyone going down this rabbit hole, CAN Bus Analyser Tool on Windows pairs nicely with a cheap USB-to-CAN adapter (£15-ish off Amazon) to sniff what your Fogstar's actually broadcasting before you even touch the Pi setup. You can then replay those frames and watch your Multiplus II react in real time without risking anything expensive having a meltdown. Victron's velib CANopen docs are your bible here — buried on their GitHub but absolutely worth the dig.

Wez Frost
Wez Frost
Active Member
27 posts
thumb_up 13 likes
Joined Jul 2024
3 weeks ago
#27817

@OffGridJulie honestly same energy as my van build — half the "components" are just a Pi and gaffer tape holding things together philosophically.

@SOC_Nerd what library were you using for the CAN side of things? I had a go at something similar with a MCP2515 hat and python-can but kept getting frame timing issues that made the Multiplus II just... ignore it entirely. Ended up having to throttle the message rate right down.

The bit that caught me out was the Victron-specific CANbus profile expecting certain PGNs in a particular order — not just broadcasting SOC and voltage and hoping for the best. Worth digging through Victron's CCGX source code if you haven't already, the BMS protocol docs only tell you half the story.

Van Holly
Van Holly
Active Member
12 posts
Joined Apr 2025
2 weeks ago
#28064

@HazelSoul this is actually a really tidy way to validate compatibility before committing to a full install. One thing worth adding to what @SOC_Nerd mentioned — if you're simulating CAN BMS comms, make sure you're replicating the specific battery profile your inverter expects, not just generic LiFePO4 parameters. Victron gear can be quite particular about the CVL, CCL and DCL values coming through. Fogstar have a recommended Victron profile on their site which is worth cross-referencing. Also worth logging what the inverter actually receives versus what you're sending — sometimes there's subtle timing or frame ID mismatches that only show up under load. @WezFrost the gaffer tape comment is painfully relatable but in all seriousness a proper simulation saves you from those horrible "why is the Multiplus randomly throttling charge current" moments at 11pm in a marina.

Log in to join the discussion.

Log In to Reply