pulquero / BatteryAggregator

MIT License
35 stars 7 forks source link

Intermittent lost of communications and now ModuleNotFoundError vedbus #80

Open SergioRius opened 2 days ago

SergioRius commented 2 days ago

From time to time I'm experiencing an issue that is reported by the system as a lost of communications with the BMS. The Mppt stops with error and the Smurfs go into passthrough. Normally a Cerbo reboot is enough to recover the system. This past day had been worse as the BatteryAggregator seems not to recover. Today is throwing the errors show at the log below, and I can't find a way to make it online again. I had to remove the BMS control, reset procedure and restart the system. Several times as the smurfs continued to say that the BMS was required.

image

What I can see in the SetupHelper package manager is that my current version is 3.15 and the version file in the repo says you are already at 3.20. I can try to check and download any times, but the pkgmgr still says it's updated.

It seems related to #64 , but with something else.

What I found is that the problem was caused by high load in the system and I was suspecting that the system had corrupt memory and that when the issue happened, it left the modbus/usb devices unattended until the BMS watchdog fired. But now I'm more inclined to think that the high load could be caused by those ModuleNotFound errors.

Please include system details:

System running two Multiplus II 5k in parallel, a Fronius inverter and an mppt 150/85. Battery monitored by Smartshunt and BatteryAggregator as BMS controller.

Hardware: Cerbo/RPi???

Cerbo at versión 3.30 - 20240319094732

Setup: DVCC?

Yes, Voltage limited to 62.1v (18s LiFePo4), SVS, SCS. Had been suffering an ugly issue where CCL ramped up after the battery ended balancing and absorption, overloading the battery and the system going offline. Still without solution: image

Please provide output from dbus-spy.

# cat /data/setupOptions/BatteryAggregator/config.json
{
  "primaryServices": {"com.victronenergy.battery.ttyS6": ["/Soc"]},
  "cvlMode": "dvcc"
}
com.victronenergy.adc                                                                 
com.victronenergy.battery.ttyS6                                   SmartShunt 500A/50mV
com.victronenergy.battery.ttyUSB0                                 SerialBattery(JKBMS)
com.victronenergy.battery.ttyUSB1                                 SerialBattery(JKBMS)
com.victronenergy.evcharger.mqtt_ev_charger_11                         MQTT EV Charger
com.victronenergy.fronius
com.victronenergy.grid.cgwacs_ttyUSB2_mb1                                   Grid meter
com.victronenergy.hub4
com.victronenergy.logger
com.victronenergy.modbusclient.tcp
com.victronenergy.modbustcp
com.victronenergy.packageManager                                       Package Manager
com.victronenergy.platform                                                       Venus
com.victronenergy.pvinverter.pv_75_XB3260H2036099               Fronius Boost/Air/Mini
com.victronenergy.settings
com.victronenergy.solarcharger.ttyS5                     SmartSolar MPPT VE.Can 150/85
com.victronenergy.system
com.victronenergy.temperature.adc_builtin0_7                 Generic Temperature Input
com.victronenergy.temperature.adc_builtin0_8                 Generic Temperature Input
com.victronenergy.vebus.ttyS4                               MultiPlus-II 48/5000/70-50

Please attach any relevant logs. Log location is /var/log/BatteryAggregator/current.

Repeating in loop:

@40000000673df13318345b94 Traceback (most recent call last):
@40000000673df13318347ad4   File "/data/BatteryAggregator/battery_service.py", line 11, in <module>
@40000000673df1331834868c     from vedbus import VeDbusService
@40000000673df13318348e5c ModuleNotFoundError: No module named 'vedbus'

In addition to debugging the issue, Could you please tell me how to completely take the module offline, and/or forcing the latest version to download? Thanks.

pulquero commented 2 days ago

Looks like the install failed to download the vedbus module. You can use the PackageManager UI to install it again. This should fix it. You can stop BatteryAggregator with: svc -d /service/BatteryAggregator and restart it with: svc -u /service/BatteryAggregator

SergioRius commented 2 days ago

Looks like the install failed to download the vedbus module. You can use the PackageManager UI to install it again.

Indeed downloading and reinstalling fixed the error. I have the automatic update disabled and I didn't do it manually. So the memory corruption is still on the table. Anyway, the version installed is still 3.15. Is that a fault on the package manager. Is there a way to fix it?

pulquero commented 1 day ago

I feel it must be packagemanager as I use a common linux command to download. I guess another possibility is Venus itself, maybe under some circumstances it doesn't flush stuff to disk. It is really annoying, not easy to reproduce and have no idea what the cause would be.