Git Product home page Git Product logo

Comments (7)

ai-republic avatar ai-republic commented on June 2, 2024

Hi,
could you please attach your config.properties (from bms-to-inverter-main/src/main/resources) and pom.xml (from bms-to-inverter-main) please.

Please be aware that if you are running on Windows you will not be able to run any CAN protocol bindings - only RS485/RS232/UART.

from bms-to-inverter.

jparfianowicz avatar jparfianowicz commented on June 2, 2024

pom.xml


4.0.0
bms-to-inverter-main

<parent>
	<groupId>com.ai-republic.bms-to-inverter</groupId>
	<artifactId>bms-to-inverter-parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
</parent>

<name>${project.artifactId}-${project.version}</name>
<description>Application to communicate between a BMS and inverter</description>

<properties>
	<encoding>UTF-8</encoding>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
	<plugins>
		<plugin>
			<artifactId>maven-jar-plugin</artifactId>
			<version>3.3.0</version>
			<configuration>
				<archive>
					<manifest>
						<addClasspath>true</addClasspath>
						<classpathPrefix>lib/</classpathPrefix>
						<mainClass>
							com.airepublic.bmstoinverter.BmsToInverter</mainClass>
					</manifest>
				</archive>
			</configuration>
		</plugin>

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-dependency-plugin</artifactId>
			<version>3.6.0</version>
			<executions>
				<execution>
					<id>copy-dependencies</id>
					<phase>package</phase>
					<goals>
						<goal>copy-dependencies</goal>
					</goals>
					<configuration>
						<outputDirectory>${project.build.directory}/lib</outputDirectory>
						<overWriteReleases>false</overWriteReleases>
						<overWriteSnapshots>false</overWriteSnapshots>
						<overWriteIfNewer>true</overWriteIfNewer>
					</configuration>
				</execution>
			</executions>
		</plugin>


		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-assembly-plugin</artifactId>				
			<executions>
				<execution>
					<id>create-distribution</id>
					<phase>package</phase>
					<goals>
						<goal>single</goal>
					</goals>
					<configuration>
						<descriptors>
							<descriptor>assembly/zip.xml</descriptor>
						</descriptors>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>


<dependencies>
	<dependency>
		<groupId>org.jboss.weld.se</groupId>
		<artifactId>weld-se-shaded</artifactId>
		<version>5.1.1.Final</version>
	</dependency>


	<!-- #################### !!!!!!!!	Choose BMS 	!!!!!!!! ###################### -->

	<!-- ####################  DALY(CAN) ################### -->
	<!-- <dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>bms-daly-can</artifactId>
		<version>${project.version}</version>
	</dependency> -->

	<!-- ####################  DALY (RS485)  ################### -->
	<dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>bms-daly-rs485</artifactId>
		<version>${project.version}</version>
	</dependency>

	<!-- ####################  PYLONTECH (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>bms-pylon-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->

	<!-- ####################  JK (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>bms-jk-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->

	<!-- ####################  SEPLOS (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>bms-seplos-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->


	<!-- #################### !!!!!!!!	Choose Inverter 	!!!!!!!! ###################### -->

	<!-- ####################  SMA Sunny Island (CAN)  ################### -->
	<!-- <dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>inverter-dummy</artifactId>
		<version>${project.version}</version>
	</dependency> -->

	<!-- ####################  SMA Sunny Island (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>inverter-sma-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->

	<!-- ####################  GROWATT (CAN)  ################### -->
	<dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>inverter-growatt-can</artifactId>
		<version>${project.version}</version>
	</dependency>

	<!-- ####################  DEYE (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>inverter-deye-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->

	<!-- ####################  SOLARK (CAN)  ################### -->
	<!--		<dependency>-->
	<!--			<groupId>com.ai-republic.bms-to-inverter</groupId>-->
	<!--			<artifactId>inverter-solark-can</artifactId>-->
	<!--			<version>${project.version}</version>-->
	<!--		</dependency>-->



	<!-- #################### !!!!!!!!	Choose optional services 	!!!!!!!! ###################### -->

	<!-- optionally add MQTT services -->
	<dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>service-mqtt-broker</artifactId>
		<version>${project.version}</version>
	</dependency>

	<dependency>
		<groupId>com.ai-republic.bms-to-inverter</groupId>
		<artifactId>service-mqtt-client</artifactId>
		<version>${project.version}</version>
	</dependency>


	<!-- optionally add Email service -->
	<dependency>
		<groupId>com.ai-republic.email</groupId>
		<artifactId>email-javamail</artifactId>
		<version>1.0.5</version>
	</dependency>
</dependencies>

from bms-to-inverter.

jparfianowicz avatar jparfianowicz commented on June 2, 2024

config.properties


###################################################################
###                  System specific settings                   ###
###################################################################

# The number of battery packs (not cells) of the system
numBatteryPacks=1


###################################################################
###                 Protocol specific settings                  ###
###################################################################

# RS485 properties
RS485.baudrate=9600
RS485.startFlag=165
RS485.frameLength=13


# ModBus properties
ModBus.baudrate=9600


###################################################################
###                       BMS settings                          ###
###################################################################

####  Simple single port configuration ####
# BMS port protocol (CAN/RS485/ModBus)
bms.portProtocol=RS485
#bms.portProtocol=CAN

# The port name/device to use to communicate to the BMS  
#bms.portLocator=com3
bms.portLocator=COM7
#bms.portLocator=/dev/ttyS0

#### Or for multiple BMSes connected to multiple ports #### 
#bms.0.portProtocol=CAN
#bms.0.portLocator=can0
#bms.1.portProtocol=CAN
#bms.1.portLocator=can1
#bms.2.portProtocol=CAN
#bms.2.portLocator=can2
#etc...

# Interval to request BMS data (in seconds) 
bms.pollInterval=2


###################################################################
###                    Inverter settings                        ###
###################################################################

# The port name/device to use to communicate to the  inverter  
inverter.portLocator=can1
# Interval to send data to the inverter (in seconds) 
inverter.sendInterval=1


###################################################################
###                 Optional services settings                  ###
###################################################################

#### MQTT properties ####
# The URL to of the MQTT broker  
mqtt.locator=tcp://127.0.0.1:61616
# The topic name on the MQTT broker
mqtt.topic=energystorage


#### Email properties ####
mail.out.debug=true
# SMTP or IMAP address of the outgoing server 
mail.out.host=smtp.gmail.com
# The port of the outgoing server
mail.out.port=587
# smtp for TLS, smtps for SSL
mail.out.type=smtp
# User name to authenticate at the outgoing server
mail.out.username=
# Password to authenticate at the outgoing server
mail.out.password= 
# Disable if using TLS
mail.out.sslEnable=false
# Disable if using SSL
mail.out.tlsEnable=true
# The email address to use when sending emails
mail.out.defaultEmail=
# A (comma separated) list of pre-configured email recipients
mail.recipients=

from bms-to-inverter.

ai-republic avatar ai-republic commented on June 2, 2024

Hi,
ok thanks. I found the problem and fixed it.
Please pull the latest version.

I would advise to start first only with the dummy inverter configured just to test the connection to your BMS (Daly right?) is working correctly.

from bms-to-inverter.

jparfianowicz avatar jparfianowicz commented on June 2, 2024

Hi,

thank you for the fix. It now runs but is not receiving data from BMS (Daly of course). I tried connecting through Daly's RS485 USB Adapter and Waveshare's USB-RS485 adapter - both with same result, no data is received. Both adapters work with DalyBMSMonitor software. The console log is following:
2024-01-18 15:13:06.007 | INFO | main | verter.BmsToInverter:128 | Starting BMS receiver... 2024-01-18 15:13:06.009 | INFO | main | verter.BmsToInverter:135 | Starting inverter sender... 2024-01-18 15:13:07.021 | INFO | 2-thread-1 | stoinverter.core.BMS:35 | ---------------------------------> Thread 67 2024-01-18 15:13:07.025 | INFO | 2-thread-1 | toinverter.core.Port:88 | Opening COM6 ... 2024-01-18 15:13:07.077 | INFO | 2-thread-1 | toinverter.core.Port:90 | Opening port COM6 SUCCESSFUL 2024-01-18 15:13:07.253 | WARN | 2-thread-1 | alyBmsRS485Processor:125 | Command 0x90 to BMS 1 successfully sent and received! 2024-01-18 15:13:07.437 | WARN | 2-thread-1 | alyBmsRS485Processor:125 | Command 0x91 to BMS 1 successfully sent and received! 2024-01-18 15:13:07.609 | WARN | 2-thread-1 | alyBmsRS485Processor:125 | Command 0x92 to BMS 1 successfully sent and received! 2024-01-18 15:13:07.787 | WARN | 2-thread-1 | alyBmsRS485Processor:125 | Command 0x93 to BMS 1 successfully sent and received! 2024-01-18 15:13:07.958 | WARN | 2-thread-1 | alyBmsRS485Processor:125 | Command 0x94 to BMS 1 successfully sent and received! 2024-01-18 15:13:08.134 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 1 times! 2024-01-18 15:13:08.344 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 2 times! 2024-01-18 15:13:08.561 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 3 times! 2024-01-18 15:13:08.778 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 4 times! 2024-01-18 15:13:08.994 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 5 times! 2024-01-18 15:13:09.195 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 6 times! 2024-01-18 15:13:09.411 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 7 times! 2024-01-18 15:13:09.615 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 8 times! 2024-01-18 15:13:09.817 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 9 times! 2024-01-18 15:13:10.033 | WARN | 2-thread-1 | alyBmsRS485Processor:87 | No bytes received: 10 times! 2024-01-18 15:13:10.037 | ERROR | 2-thread-1 | stoinverter.core.BMS:46 | Received no bytes too many times - trying to close and re-open port!

Do you have any suggestions what could be wrong?

from bms-to-inverter.

kommando828 avatar kommando828 commented on June 2, 2024

This is my go to when in a mess with RS485 Modbus, runs under windows as long as Java is installed.

https://github.com/SciFiDryer/ModbusMechanic

Use the register scanner , tools/register scanner, select RTU, set comms and then scan for the expected registers and try different options such as Slave ID, baud rates etc until you get a result.

from bms-to-inverter.

ai-republic avatar ai-republic commented on June 2, 2024

Hi,
so up to command 0x95 its running fine.
Command 0x95 is where all the cell voltages are read and Daly splits them up in multiple frames. Daly seems to take longer here to prepare the frames and put them on the wire.

I've had the same problem with someone else's Daly via UART also.
The fix there was to wait a little longer between the readings.

I added another config parameter to set a delay after receiving no bytes. It was hardcoded before to 200ms, so try increasing/decreasing that slowly by 50ms and see what happens.
Please pull the latest version and adjust the following config property:

# Delay after receiving no data (in ms)
bms.delayAfterNoBytes=200

What happens after the first reading round? After getting 10x no bytes the application will close and re-open the port and start reading again. Do you get the same messages after that also? Please attach the full log file next time so I can see what is happening afterwards too.

Hope this helps :)

from bms-to-inverter.

Related Issues (9)

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.