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
75 stars 10 forks source link

BMS tab is empty #24

Closed carsonfee closed 6 months ago

carsonfee commented 6 months ago

image

Can't add a bms in the configuator the dialog is empty

ai-republic commented 6 months ago

Have you downloaded the latest Configurator application?

carsonfee commented 6 months ago

Yes I have

ai-republic commented 6 months ago

Please get the new Configurator app again. I've tested it and it works fine for me

carsonfee commented 6 months ago

got latest configurator. couldn't do a clean install as the BMS tab was still empty. I copied my config.properties to the location of the new configurator and ran again. it read the configuration and I updated and did a clean install. the install window was also blank but I watched files get added and closed the window when it stopped adding files. ran ./start and the web server fails. I'm attaching the log start.log

ai-republic commented 6 months ago

Just tested the Configurator app on my Pi and also there it works.

2024-03-18-144833_1024x768_scrot

The Webserver won't run if the BMS-to-Inverter application is not running. You need to select the Webserver in the Configurator and it will automatically also select the MQTT broker and client.

Have you tried to run the Configurator on a PC or laptop and then transfer the installation folder per e.g. WinSCP or Putty to the Pi?

carsonfee commented 6 months ago

I have the gui working now. something is messed up with file permissions. if I run sudo configurator.jar all of the dialogs are blank. I tried chmod 777 and ran sh configurator. the gui is correct now but it fails to write the configuration and also fails to install. doing a combination of adding a config folder and a temp folder seemed to let me save and clean install. The web server is still crashing however. here's a new log :

b2log.log

ai-republic commented 6 months ago

Ok, that is strange. I will have a look at that tomorrow.

The crash of the webserver is due to the Bms-to-Inverter application (and its MQTT broker) not running or not started in time. Be sure to have the Webserver, MQTT Broker and MQTT Client enabled in the Services tab of the Configurator. Maybe try to run the app seperately first and then the webserver.

In your installation folder run:

java -DconfigFile=config/config.properties -Dlog4j2.configurationFile=file:config/log4j2.xml -jar lib/bms-to-inverter-main-0.0.1-SNAPSHOT.jar

and then in another terminal when that is started and running:

java -jar lib/webserver-0.0.1-SNAPSHOT.jar --spring.config.location=file:config/config.properties
carsonfee commented 6 months ago

the bms-to-inverter application fails to run:

bms_cli.log

ai-republic commented 6 months ago

Could you please replace your log4j2.xml in your config folder with this one (please remove the suffix .txt): log4j2.xml.txt

and run the program again to get more information. It is very strange that there is not more in the log.

carsonfee commented 6 months ago

here you go. newlog.log

ai-republic commented 6 months ago

It looks like your install did not finish downloading all the libraries. Please check your lib directory in the installation folder. I'm pretty sure its missing a file called netty-common-4.1.94.Final.jar.

But back to the problem of this issue:

  1. Have you tried to run the Configurator application on a PC? How does it look there? Then you can copy the files over via SCP or a USB stick.
  2. Have you tried running theConfigurator application directly on the PI without using VNC but a connected monitor?
  3. Could you tell me what PI model you are using and which Java is installed (java -version in the terminal)

I'm sure we'll find the cause of this now pretty quickly. I've tested the Configurator application from here now on 3 Pi's (3B, 4B and 5) and its working on all 3, including PC. My guess it might be a problem with the VNC.

carsonfee commented 6 months ago

netty-common-4.1.94.Final.jar is in my lib folder

Its a Pi 4B. I'll try running directly on the pi, I need to spin up a linux build on my PC

openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb12u1) OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1deb12u1, mixed mode, sharing)

carsonfee commented 6 months ago

running directly on the Pi the configurator worked correctly without issues but I still have the crash in bms-inverter

ai-republic commented 6 months ago

Still the java.lang.ClassNotFoundException: io.netty.util.internal.PlatformDependent exception? Could you please delete the .m2 folder in your home folder and also delete your installation folder and do a fresh Clean install again and be sure to enable the Webserver, the MQTT Broker Server and MQTT Producer services. Maybe the Netty Jar file is corrupt due to a incomplete download.

carsonfee commented 6 months ago

did a clean install on PC and copied over to the PI. it's running again but the can info is still wrong on the web page. A can dump does look correct but not the values displayed on the page

image

carsonfee commented 6 months ago

can0 35E [8] 4C 45 4F 43 48 20 20 20 'LEOCH ' can0 359 [8] 00 00 00 00 04 50 4E 00 '.....PN.' can0 351 [8] 34 02 D0 07 A0 0F B0 01 '4.......' can0 355 [8] 42 00 64 00 00 00 00 00 'B.d.....' can0 356 [8] CE 14 F7 FF BE 00 00 00 '........' can0 35C [8] C0 00 00 00 00 00 00 00 '........'

ai-republic commented 6 months ago

Hi, can you confirm that the Configurator is working? Because then I would close this issue and continue the discussion in the issue #20

carsonfee commented 6 months ago

Yes. Configurator is working correctly. We can close this