Back to Project Index | http://graham.auld.me.uk | E-Mail me |
GitHub - no project here yet |
Back in November 2019 I thought it was a good idea to buy a Moixa 4.8 kWh battery system, happily with a minor setting tweak this supported MQTT so the SOC, Solar, Batttery and Grid metering was all extenally available - In March 2022 I upgraded to the 9.6kWh system but the new hardware and software no-longer provided metering data on MQTT. I contacted Moixa for support and they declined - at which point I started to take a little more interest in the system I own and what I can do with it... Everything you find here is a result of open source literature research and reverse engineering. In April 2022 Moixa decided to exit the customer business and now only deals through third party partners, I want to be prepared for Moixa exiting the business and not supporitng this system at all.
Discussion around this topic can be found in the Moixa Owners Group on Facebook Code will eventually end up in my GitHub account when I get round to it
These systems are based round a Victron Multiplus II Inverter/Charger with multiple Pylontec US2000 batteries. The "Moixa Hub" is some custom hardware that's based on the Victron Venus platform - happily Victron are very open for integration so there's plenty of info available there. The 4.8 kWh system is packaged in a box using two US2000 batteries, the 9.6 (and 7.2) kWh systems are installed as components with the four and three batteries respectivly in a 19" rack cabinet.
All Photos of the 4kWh system are courtesy of Duncan MacCallum who also kindly supplied his old Moixa Hub for me to experiment with.
Jumping ahead a little, the Moixa system appears to essentially be an implimentation of the Victron Energy Storage System (ESS) - specifically a Self Consumption ESS Mode 3 system running software on a GX style device using D-Bus paths to control the inverter charger.
I've started here as there's not much to say - Pylontec US2000 batteries are a pretty common bit of kit in any storage system. It's a 48V LiFePo4 (Lithum type) battery including Battery Management System (BMS) - 2.4kWh storage, 90% Depth of Dischage (DoD) 10 year warranty. The modules have serial ports so you can speak to the BMS directly - plenty of info online about this stuff so I won't cover any of it here. In this application, the top battery in the stack is connected to the controller using CAN bus through an RJ45 connecter and CAT 5 cable.
The system uses a Victron MultiPlus-II 40/3000/35-32, a great bit of kit with oodles of manufacturer support and configurability. In this application it is run under external control from the Moixa Hub which instructs it when (and at what rate) to charge the battery (either to minimise export or for low rate periods) and when to discharge (to minimise grid import)
The Moixa Battery is working with AC grid-tied Solar, and not configured for providing emergency backup power in a power cut. The Victron however supports DC coupled solar and sustained supplies - The benefit of DC solar is you could add more DC panels that could charge your batteries and provide AC via the inverter without needing the Distribution Network Operator to approve another generator (If you've already got a 3.6 kVA AC Solar inverter plus the 3 KVA Moixa then you might not get additional generation capacity approved. Adding a Victron DC MPPT to the system would be a great mod.
Technically yes, easy to add BUT, there are caveats
Here's what the connections look like on one of these Victron units. AC-OUT-1 is for essential loads and will stay live as long as it can. AC-OUT-2 is for normal output loads - there's a relay that can switch this output on and off. During initial charging after a power failure this output will be switched off. AC-IN is where the grid power is connected. If that doesn't make much sense then try imagining you've installed it on a boat and you have a DC charger from solar panels topping up your batteries. AC-OUT-1 runs your radios, and nav lights, AC-OUT-2 runs your telly and laptop, AC-IN connects to shore power when available. There are plenty of other config options, for instance you might have an onboard generator set which you have automatically started by the controller when your battery charge get's a little low...
In the Moixa Battery setup you've just got the Grid on AC-IN, the Moixa Hub connected to VE.Bus for controlling the Victron unit and the 48 VDC on those big red and black terminals off to the Pylontec batteries via a fuse.
For the Moixa Battery functionality to work it needs to measure grid power and any connected solar generation power. The planned virtual power plant also required monitoring of the inverter generation with a MID compliant meter. The standard setup is to use current clamps although in some installations the potential reading error introduced here is unacceptable and these have been exchanged for current shunts. Current transformers are preferred as they introduce no resistance to circuits and can easily be added without rewiring.
My 9.6 kWh system uses an Eastron SDM630 and an Eastron SDM120 for metering, these are RS485 MODBUS RTU connected meters that are wired back to the Moixa Hub.
This is a three phase meter from Eastron, it is configured to read as a three channel single phase meter on MODBUS address 1 (You can find this stuff on the front panel - the manual is here). As this comms goes through some wires to the hub, I connected up a RS485 serial interface and fired up my favourite terminal emulator (realterm since you asked) and had a look at the data (I'm not teaching MODBUS RTU here - you can read about it on Wikipedia or just grab the protocol spec from the Modbus organisation. The device is queried using with three read commands:
This single phase inline MODBUS meter is on the same serial bus at address 244 (read from the display after checking the manual), I've not happened to see any comms to this while sniffing the bus but it might just not be very common. My guess is that it's there to meter the export of the Moixa Battery for use in the proposed Virtual Power Plant they were talking about doing in which case they'd need to have a MID certified metering to capture what they'd actually pushed onto the network.
This is where the smarts of the system are - everything connects back to here. It's some custom hardware which runs the victron Venus software that goes in a GX controller with some software from Moixa running the control loop that looks at the grid power and commands the inverter/charger to charge or discharge the batteries (and impliments the force charge and forced no discharge periods needed to support time of use tariff based load shifting). What disturbed me when this little box of tricks connected to my LAN was that it made multiple external connections to the internet including one reverse SSH connection. That allowed anyone with credentials for the box to remotely SSH in to it and gain a root privilidged session. Now that not only provides the oppertunity to compromise the unit directly but then act as a jumping off point for hacking other things connected to my LAN. I take a dim view of this sort of cyber hygene
I set a reservation in my DHCP server so the system always gets the same IP address and then started off with a firewall rule to deny and log all outgoing traffic from the Moixa Hub. The mygridshare.com app/website unsurprisingly stopped displaying data so I started to add specific rules for each traffic type to experiment
I specifically allow that last connection to 52.28.98.25 which clears the connection fault to Victron Remote Management and enables the mygridshare stuff. Looking up VRM and the online demo it seems like the underlying Victron system is being used and the data extracted to generate the mygridshare platform. I tried setting up VRM and adding my inverter and got an error saying my inverter was already registered to a different account - I assume Moixa registered that. On the plus side, if Moixa go bust then the Victron VRM is a good alternative, just need to get the inverter re-registered.. After a day I got a phone call from Moixa asking if I had any problems with my internet connection, I chuckled and said no problem at all. When they asked me to reboot my router I refused and asked why, they then admitted that they couldn't access the system remotely. I told them I'd seen suspicious remote traffic so I'd simply firewalled all non-essential traffic. Not long after this the documentation was updated to include the required ports to allow in your firewall.
Looking at available services on the LAN with the version 2.23 firmware there was the expected SSH server but also a web server on port 80 - pointing a web browser at the IP address of your Moixa Battery system gave you a nice view of the system status. It's the same view that would usually be on the LCD of a Victron GX controller - as such it also provides access to a bunch of configuration options, I always though it was a pity that Moixa didn't put this or someting similar on the LCD panel on the front of the Hub.
When my 4.8 kWH unit was upgraded to 2.42 firmware (after Moixa called me and asked if I could give them access to do it) I lost access to the web interface. This irritated me enormously and next time they asked to upgrade my firmware I refused unless they gave me accurate information on what was being updated. Moixa declined to say anything beyond, bug fixes and performance improvements so I saw no more updates until I upgraded to the 9.6 kWh system and got a new Moixa Hub.
On getting the latest 8.3.4 firmware I was even more peeved to find that the web interface (when re-enabled) didn't include solar or grid data anymore and the grid box just showed inverter/charger power. This also meant that the internal D-Bus data and external MQTT data sources also lacked grid or solar metering data. I'd developed an external display that logged and showed on a screen that data so loosing the datasource after an 'upgrade' was super annoying. Moixa 'support' was of course, not supportive. I initially "fixed" this problem with a Raspberry Pi, a USB to RS485 and a perl script to sniff the MODBUS traffic from the SDM630 and publish that data to my MQTT server. An entire RPi sat next to the Moixa Hub felt like overkill but was a good quick fix, I spent a bit of time looking at the software in the Moixa Hub and eventually in July 2023 produced a solution that would make all metering data available both internally on D-Bus and externally on MQTT - more on that later. Having fixed that I stopped messing as I didn't have a known recovery method from overambitious fiddling - remember the battery system will be useless without the Moixa Hub running the show. Then at the end of March 2024 Duncan MacCallum was kind enough to let me have the Moixa Hub from his removed 4.8 kWh system so I had something to play with risk free!
Working our way clockwise around the unit from the top
Further info is going to be split into a few other pages covering topics like: