GithubHelp home page GithubHelp logo

ai-republic / bms-to-inverter Goto Github PK

View Code? Open in Web Editor NEW
44.0 8.0 7.0 30.06 MB

Use, monitor and control any battery brand with any inverter! Application to read and monitor data from BMSes and write data to an inverter using any protocol (e.g. UART, RS485, ModBus or CAN)

Home Page: https://github.com/ai-republic/bms-to-inverter

License: Other

Java 86.51% HTML 12.66% CSS 0.28% Shell 0.54% Batchfile 0.01%
bms daly daly-bms deye inverter sma solar sunny-island victron growatt

bms-to-inverter's People

Contributors

ai-republic avatar danieltorkian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bms-to-inverter's Issues

Daly BMS - ttl

Hello,
Currently you are supporting Daly BMS (RS485 or CAN).
I have bad luck with my daly bms and i am missing the hardware parts in my Daly for CAN/RS485.
I have only TTL usb.

daly-ttl-usb

Maybe i should use USB to RS-485 but how i am gonna connect it to my PI ? Now i can connect directly via USB
and read data like cells , soc and all of this.

Building on PI4

Hello,
I am trying to build this on a PI4 device.
Here is the error i got:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project core-api: Fatal error compiling: error: release version 17 not supported -> [Help 1]

Maybe my mvn is too new ?

root@sol:~/bms-to-inverter # mvn -v
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.18, vendor: Raspbian, runtime: /usr/lib/jvm/java-11-openjdk-armhf
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.1.31-v8+", arch: "arm", family: "unix"

Not working normally

Hi, after today update the software is not working properly.
It does not crash it just stops.
For example these are the last lines:

BMS SOC V A CellMinV CellMaxV CellDiff
1 25.6 53.2 8.0 3.328(#2) 3.333(#15) 0.005

2024-02-12 13:45:48.367 | INFO | $6@96aa05) | ogs.AuditLogger_impl:2299 | AMQ601501: User [email protected]:48790 is consuming a message from energystorage: Reference[158]:RELIABLE:CoreMessage[messageID=158,durable=true,userID=null,priority=4, timestamp=Mon Feb 12 13:45:48 EET 2024,expiration=0, durable=true, address=energystorage,size=11224,properties=TypedProperties[]]@31771282
2024-02-12 13:45:48.372 | INFO | $6@96aa05) | ogs.AuditLogger_impl:2291 | AMQ601500: User [email protected]:39724 sent a message CoreMessage[messageID=158,durable=true,userID=null,priority=4, timestamp=Mon Feb 12 13:45:48 EET 2024,expiration=0, durable=true, address=energystorage,size=11224,properties=TypedProperties[]]@31771282, context: RoutingContextImpl(Address=energystorage, routingType=null, PreviousAddress=energystorage previousRoute:null, reusable=true, version=-2147483646)
..................................................
***** durable queues energystorage:

  • queueID=4 address:energystorage name:energystorage filter:null
    ***** non durable for energystorage:
    ..................................................
    , transaction: null
    2024-02-12 13:45:48.377 | INFO | 2-thread-1 | verter.BmsToInverter:225 | BMS alarms:
    NONE
    2024-02-12 13:45:53.378 | INFO | 2-thread-1 | stoinverter.core.BMS:128 | ---------------------------------> Thread 43
    2024-02-12 13:45:53.585 | WARN | 2-thread-1 | alyBmsRS485Processor:127 | Command 0x90 to BMS 1 successfully sent and received!
    2024-02-12 13:45:53.793 | WARN | 2-thread-1 | alyBmsRS485Processor:127 | Command 0x91 to BMS 1 successfully sent and received!
    2024-02-12 13:45:54.000 | WARN | 2-thread-1 | alyBmsRS485Processor:127 | Command 0x92 to BMS 1 successfully sent and received!
    2024-02-12 13:45:54.208 | WARN | 2-thread-1 | alyBmsRS485Processor:127 | Command 0x93 to BMS 1 successfully sent and received!
    2024-02-12 13:45:54.416 | WARN | 2-thread-1 | alyBmsRS485Processor:127 | Command 0x94 to BMS 1 successfully sent and received!

Not updating. If i stop the webserver it prints info so it is not crashed

SRNE inverter support

Hi & thank you for the project.
Does this support SRNE inverters & if not, do you have any plans to improve this to add SRNE inverter support?

Latest code not working

Trying the latest version throws the following error:

e.remoting.impl.netty.NettyServerConnection@4cfeae[ID=b311cd28, local= /127.0.0.1:61616, remote=/127.0.0.1:40888]], true, true, false, false, null, org.apache.activemq.artemis.core.protocol.core.impl.CoreSessionCallback@59f6d4, true, {}]
Exception in thread "main" jakarta.enterprise.inject.CreationException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:50)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:90)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:127)
at org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:92)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:78)
at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:112)
at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:186)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:160)
at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:140)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:684)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:666)
at org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:123)
at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:158)
at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:180)
at org.jboss.weld.contexts.unbound.DependentContextImpl.get(DependentContextImpl.java:64)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:684)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:666)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:784)
at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:345)
at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:356)
at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:69)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:71)
at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:117)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:161)
at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:140)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:102)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
at com.airepublic.bmstoinverter.BmsToInverter$Proxy$_$$_WeldClientProxy.start(Unknown Source)
at com.airepublic.bmstoinverter.BmsToInverter.main(BmsToInverter.java:73)
Caused by: java.util.ServiceConfigurationError: com.airepublic.bmstoinverter.core.InverterDescriptor: Provider com.airepublic.bmstoinverter.inverter.pylonhv.can.PylonHVInverterCANProcessor not found
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
at java.base/java.lang.Iterable.forEach(Iterable.java:74)
at com.airepublic.bmstoinverter.core.InverterProducer.(InverterProducer.java:27)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119)
... 37 more

and sits there ...

configuration issues

After latest commits seems like webserver and email is broken. Also there are many errors in cleanrepo.sh

Hardware connection to the Growatt Inverter

Hello,
I have little technical question about connecting Growatt to PI.
I have 3 ways to connect it. One is via RS-485 to USB but as i see you started only CAN. Next way is connecting via CAN from the inverter to USB port in the PI device. Growatt has one USB port too which i have already once connected to my PI for reading inverter data. Now i am wondering how exactly to connect it to the inverter. I have received CAN to USB modules so i can use that too. Also i think growatt has some kind of password which is growatt+current_date. Can you give a little help how exactly you are expecting the data from the inverter via CAN ?

Webserver module

I noticed a bug that after sometime 24 hours the webserver is working but do not refresh values like SoC and other correctly. Actually they stay as they were previous day. App seems to work no crash. I stop and start it and everything is displayed normal updated. If you need more info you can email me for live access.

Outback Power Skybox Inverter BMS Canbus

outback has a limited list of batteries it supports. It has support for Simpliphi, Blue Ion, Discover, Fortress, Active BMS, Energycell PLR and XLC, Kilovault.

Skybox runs on an industrial beagleboard and has an RJ12 connector to connect to the BMS RJ45 Can port.

Running on Windows

Hi,

I am trying to run the solution on Windows 10. I managed to build the project but running bms-to-inverter throws below error:
Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Inverter with qualifiers @default
at injection point [BackedAnnotatedField] @Inject private com.airepublic.bmstoinverter.BmsToInverter.inverter
at com.airepublic.bmstoinverter.BmsToInverter.inverter(BmsToInverter.java:0)

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:285)
    at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:141)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:162)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:515)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
    at org.jboss.weld.executor.CommonForkJoinPoolExecutorServices.lambda$wrap$0(CommonForkJoinPoolExecutorServices.java:70)
    at java.base/java.util.concurrent.ForkJoinTask$AdaptedInterruptibleCallable.exec(ForkJoinTask.java:1461)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Unfortunately I am not a Java expert. Spent 2h googling for solution but could not make it work. Help would be appreciated.

JK BMS RS485 doesn't work

2024-03-14 18:46:34.633 | INFO | Thread-2 | verter.BmsToInverter:164 | Reading BMS #1 JK_RS485 on /dev/ttyAMA0...
2024-03-14 18:46:34.645 | INFO | Thread-2 | stoinverter.core.BMS:120 | ---------------------------------> Thread 44
2024-03-14 18:46:34.647 | ERROR | Thread-2 | stoinverter.core.BMS:139 | Error requesting data!
java.lang.UnsupportedOperationException: null
at java.nio.ByteBuffer.array(ByteBuffer.java:1471) ~[?:?]
at com.airepublic.bmstoinverter.protocol.rs485.JSerialCommPort.sendFrame(JSerialCommPort.java:115) ~[protocol-rs485-0.0.1-SNAPSHOT.jar:?]
at com.airepublic.bmstoinverter.bms.jk.rs485.JKBmsRS485Processor.collectData(JKBmsRS485Processor.java:27) ~[bms-jk-rs485-0.0.1-SNAPSHOT.jar:?]
at com.airepublic.bmstoinverter.core.BMS.process(BMS.java:127) ~[core-api-0.0.1-SNAPSHOT.jar:?]
at com.airepublic.bmstoinverter.BmsToInverter.lambda$start$2(BmsToInverter.java:165) ~[bms-to-inverter-main-0.0.1-SNAPSHOT.jar:?]
at java.lang.Thread.run(Thread.java:840) [?:?]

Selectronic SP Pro

Hi. Total noob here (the extent of my knowledge was putting Victron VRM on pi3B).

I have a selectronic inverter (I am off grid) and about to replace ABB with Fronius AC couple). I will have upto 3 fronius inverters on different arrays.

Apparently selectronic supports pylontech but unsure as contacted Batrium and they could not guarantee their bms would work so went with the jk inverter bms.

Do you know if your programming supports selectronic?

In the future I would like to get information on home assistant.

Thanks for your time.

G

Daly Growatt implementation imminent

Hiya

16 Lishen 272ah @ 1C
Daly 48v 150A
Growatt SPF 5000ES
Solar only, generator backup

No comms to BMS

RS485 (Daly) to RJ45 (growatt) fail. Crimped then inverted pins then removed 2 then inverted again. Could not set BMS to any specific (Pylon) protocol. Speedy email response from Daly support asked where I bought it but hasn't replied to me since I told them it was a small south African online shop that has since closed down, with a very bad reputation.

Daly interface board option but I think I still need to set the battery type on BMS so I don't want to buy it.

RS485 (Daly) to USB windows success
Daly software could also not change battery protocol. But I had full live Conn to BMS, all voltages etc working fine. 3 wire from RS485 to USB. So the BMS is speaking fine. Just need to relay the message.

Tomorrow I'm going to get my first ever Pi. Pi 3 and with your suggested IO. Then I'll follow your guide as best that I can. I'm excited.

I need this. My growatt isn't very good at charging blindly. 😅

mqtt with authentication?

Hello,

is there any way to use mqtt with authentication?

I was trying tcp://login:password@server_ip:1883 but no luck
mosquitto reports in logs:
Client disconnected due to protocol error.

cheers

Support for deye battery

Hi is any chance to make possibility communication between JK BMS (PB version) and Deye RW-M6.1 battery via RS485 or can?

Thank for reply.

waveshare CAN expansion hat compatibility

Does it also work with the Waveshare 2-Channel Isolated Can Expansion Hat or does it only work with the flexible data rate (FD) version ?

Nice project by the way.

Raspberry Pi 5 compatibility

Not really important to fix since Pi 4's are still easily obtainable.
It might be worthwhile putting a warning that the Pi 5 and Waveshare RS485/CAN adapter may (probably) not work and still a work in progress.

Just in case anyone (like me :) ) think to get a Pi 5 because it's the newest.

SMA CAN Help

Hi! I love what you’ve got going here. I recently built a battery pack with three Daly BMS and I am attempting to establish EXTBMS comms with SMA.

I saw your post on a forum and I have some rPi 4b’s laying around. I’m a novice in programming and raspbian. The most I’ve done on a rPi is emulation and tweak config files.

I’m also new to GitHub and I’m not even sure if this is where I post this kind of stuff.

Anyways, I’m looking for some dumbed down guidance on creating this tool. I’ll gladly support this project and I’ll send more to keep this project going and for your time.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.