ai-republic / bms-to-inverter

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)
https://github.com/ai-republic/bms-to-inverter
Other
91 stars 14 forks source link

Daly_RS485 Failed to initialize #60

Closed jlmontes1697 closed 1 month ago

jlmontes1697 commented 1 month ago

I have a raspberry py 3B with "WaveShare CAN HAT For Raspberry Pi, 2-Ch RS485 and 1-Ch CAN" (https://www.waveshare.com/rs485-can-hat-b.htm). A Daly 7s 40A Smart BMS. They are connected by RS485.

With the python library "python-daly-bms" I can read all the BMS parameters with the port /dev/ttySC0 but with the bms-to-inverter app I get the error: "Failed to initialize BMS"

I have the app configured: BMS: DALY_RS485 Id: 1 Port: /dev/ttySC0 Baudrate: 9600 Delay: 200 Inverter: HUAWEI_MODBUS (The inverter is not connected yet) Services: HTTP

What is wrong with my configuration?

ai-republic commented 1 month ago

Could you please attach the config.properties file and if possible the log file. Initially please configure the inverter as NONE to see if you get data from the port. You can also try a cat /dev/ttySC0 to see if data is coming through. Please also initialize your port before starting the application:

stty -F /dev/ttySC0 9600
jlmontes1697 commented 1 month ago

When i configure the inverter to none, get the errror: Failed to execute goal on project inverter-dummy: Could not resolve dependencies for project com.ai-republic.bms-to-inverter:inverter-dummy:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.ai-republic.bms-to-inverter:protocol-can:jar:0.0.1-SNAPSHOT (absent): Could not find artifact com.ai-republic.bms-to-inverter:protocol-can:jar:0.0.1-SNAPSHOT -> [Help 1]

root@raspberrypi:/inverter# cat config/config.properties bms.1.type=DALY_RS485 bms.1.id=0 bms.1.portLocator=/dev/ttySC0 bms.1.baudRate=9600 bms.1.delayAfterNoBytes=200

inverter.type=HUAWEI_MODBUS inverter.portLocator=2 inverter.baudRate=9600 inverter.sendInterval=1

BMS-to-Inverter.log

jlmontes1697 commented 1 month ago

When the daemon is running, get this with "journalctl -f" sc16is7xx spi1.0: ttySC0 (0): invalid RTS setting, using RTS_AFTER_SEND instead

With the app on python, can get the parameters from BMS and dont get this error. What difference between driver java an python?

ai-republic commented 1 month ago

Thanks for the config and the log. I noticed that the BMS id is 0. For the Daly the first BMS id needs to be set to 1

jlmontes1697 commented 1 month ago

This is fot other issue. When you set the id 1 on configuration panel, the file config.properties has value to 0. You have to change de value

ai-republic commented 1 month ago

Btw, I fixed the issue where the BMS id is automatically set in the latest Configurator application.

ai-republic commented 1 month ago

Hi @jlmontes1697, I guess this can be closed. Please open another ticket if you need further assistance. If everything works find I'd be very thankful for any donation 😄