Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show MOSFET temperature from JKBMS #440

Merged
merged 4 commits into from
Apr 26, 2023
Merged

Conversation

baphomett
Copy link
Contributor

I had a JKBMS repeatedly cutoff discharge for an unknown reason. After some digging, finally found it was the MOSFET temperature limits that were set too low. But I had to get close to the BMS and open the JKBMS app to use Bluetooth to get the MOSFET temp because it was not showing up through the serial battery driver.

Took the time to did through the byte stream of data that JKBMS publishes and found that it sends the MOS temperature as well.

Had to make changes in the battery class to accept a new temperature attribute, also create a dbus path and add a GUI interface to the qml file.

It shouldn't break anything, but I couldn't test using a BMS that is not JK.

@mr-manuel
Copy link
Collaborator

@Louisvdw could you please merge this? It's running fine since 3 weeks on my end. Do you need help with the open pull requests?

mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this pull request Mar 5, 2023
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it succesfully in my environment including a JK BMS, the Mosfet temperature shows up in ve connect as expected.

Copy link
Collaborator

@mr-manuel mr-manuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is already running fine since months.

@baphomett baphomett closed this Apr 26, 2023
@baphomett baphomett reopened this Apr 26, 2023
@mr-manuel mr-manuel merged commit 09194e0 into Louisvdw:master Apr 26, 2023
@mr-manuel
Copy link
Collaborator

Since it's a small easy to understand PR I will merge it. The black lint errors will be fixed with my PR.

@mr-manuel
Copy link
Collaborator

str variable assignment instead of int will be fixed with 10972b9

Louisvdw pushed a commit that referenced this pull request May 6, 2023
* added balancing switch status

* added balancing switch status

* changed default config file
- added missing descriptions
- changed name

* indentation was wrong

* adding fix for Venus OS >= v3.00~14 QML files

* added cell balancing status for JKBMS

* changed ConsumedAmpHours
should be None instead of 0, if not available

* TimeToSoc fixes
- Added: Show TimeToSoc only, if enabled
- Changed: description in config file
- Changed: default value TIME_TO_SOC_VALUE_TYPE = 1

* resorted functions

* fix CPU overload
- changed: how often Time-To-Soc is calculated in seconds

* fix Time-to-Go and Time-to-SoC
- changed: Time-To-Go has to be always a positive int
since it's used from dbus-systemcalc-py
- changed: how Time-to-SoC is string is generated and displayed
(format like Time-To-Go)

* small fixes

* Show MOSFET temperature from JKBMS
Pull request from @baphomett
#440

* bump version to 1.0.0
respecting semantic versioning

* added uninstall script and fixed reinstall
- `/data/conf/serial-starter.d` was not recreated if deleted

* small fixes
- added description in utils.py
- change qml files in destination not source

* typo

* fixed cell balancing color for cells 13-24

* updated description in default config file

* Updated logging to get relevant informations

* clearer config file

* make config file clearer

* fix #421
- #421

* missing removals

* corrected typo, added missing +x in release.yml

* added info for new issue

* fix black lint errors

* optimize installation scripts

* added script to install directly from repository

* fixed serial-starter.d
#520

* smaller fixes

* fix #351

* fix System Switch in IO page

* fix #239
by @TimGFoley

* fix black lint errors

* run code analyse only on code change

* fix #311

* Separate Time-To-Go and Time-To-SoC activation

* remove duplicated and incorrect log message on handle_changed_setting

* properly log max battery currents on startup

* optimize uninstall script

* fix typo in log_settings

* add charge mode display

* Added: Temp name for sensor 1 & 2
Added the possibility to give a name to temperature sensor 1 & 2
This allows to see which sensor is low and high

* Added: Choose how battery temperature is assembled

* fix black lint errors

* Added/Changed alarms for JKBMS
* Added: HighInternalTemperature alarm for JKBMS
* Changed: Temperature alarm to not trigger all in the same condition

* Removed Alarms/HighCellVoltage
It does not exist on the dbus

* Changed: Moved charge mode
from IO page to Paramaters page

* Merge branch 'master' into master

* Added: Show (dis)charge current limitation reason

* Added changelog

* corrected file permissions

* Update readme

* Small word case changes

* fix dbus-daemon memory leak

`poll_battery` is already called from the dbus mainloop in a separate thread. Opening a new thread here (and especially never closing it) will accumulate threads and leads to problems like `dbus-daemon` memory usage increasing over time, leading to eventual reboot
by @seidler2547

* Added: Show specific TimeToSoC points in GUI
Only if 0%, 10%, 20%, 80%, 90% and/or 100% are selected

* fix black lint error

* removed wildcard import, fixed black lint errors

* removed wildcard import, fixed black lint errors

* remove old log message in handle_changed_setting()

* simplified condition for Time-To-Go/Soc

* fix renogy import

* added BMS info and cleanup
* MNB
* Revov
* Sinowealth

* moved BMS to subfolder

* Added self.unique_identifier to the battery class
Used to identify a BMS when multiple BMS are connected
planned for future use

* fix small errors

* added linear voltage recalculation interval
In the config file can now be defined how often CVL, CCL and DCL is recalculated

* revert Daly adaption

* replaced penalty voltage calculation
with automatically calculated penalty voltages to simplify config
max voltage is kept until batteries are balanced

* flake config change

* updated changelog

* disabled ANT BMS by default
#479

* fix typo

* fixed wrong variable assignment
`str` instead of `int`

* updated battery template

* updated nightly script

* Fix for #450
#450

* Read charge/discharge limit JKBMS
#4

* updated release workflow

* updated readme

* deploy to github pages only
on changes in master or docusaurus branch

* cleanup

* GitHub pages config change

* Renamed scripts for better reading #532

* update docusaurus dependencies

* limitation reason cleanup

* changed default config settings
FLOAT_CELL_VOLTAGE from 3.350V to 3.375V
LINEAR_LIMITATION_ENABLE from False to True

* small typo fixes

* updated changelog

* fix disconnection behaviour & small fixes
* on disconnect, show '---' after 10s and 'not connected' after 60s by @transistorgit
* small fixes in shell script
* added restart driver script

* fixed file permission

* Added: apply max voltage if CVCM_ENABLE is False
before float voltage was applied

* Added: BMS disconnect behaviour
* Choose to block charge/discharge on disconnect
* Trigger Venus OS alarm

* Changed: Remove wildcard import from dbushelper.py

* Added: Show additional data in device page
* show self.unique_identifier as serial number
* show self.production as device name

* Added: JKBMS unique identifier & fixed data length

* move config.ini before update

* read production date by @tranistorgit
this adds the battery production date

---------

Co-authored-by: Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de>
Louisvdw pushed a commit that referenced this pull request May 8, 2023
* added balancing switch status

* added balancing switch status

* changed default config file
- added missing descriptions
- changed name

* indentation was wrong

* adding fix for Venus OS >= v3.00~14 QML files

* added cell balancing status for JKBMS

* changed ConsumedAmpHours
should be None instead of 0, if not available

* TimeToSoc fixes
- Added: Show TimeToSoc only, if enabled
- Changed: description in config file
- Changed: default value TIME_TO_SOC_VALUE_TYPE = 1

* resorted functions

* fix CPU overload
- changed: how often Time-To-Soc is calculated in seconds

* fix Time-to-Go and Time-to-SoC
- changed: Time-To-Go has to be always a positive int
since it's used from dbus-systemcalc-py
- changed: how Time-to-SoC is string is generated and displayed
(format like Time-To-Go)

* small fixes

* Show MOSFET temperature from JKBMS
Pull request from @baphomett
#440

* bump version to 1.0.0
respecting semantic versioning

* added uninstall script and fixed reinstall
- `/data/conf/serial-starter.d` was not recreated if deleted

* small fixes
- added description in utils.py
- change qml files in destination not source

* typo

* fixed cell balancing color for cells 13-24

* updated description in default config file

* Updated logging to get relevant informations

* clearer config file

* make config file clearer

* fix #421
- #421

* missing removals

* corrected typo, added missing +x in release.yml

* added info for new issue

* fix black lint errors

* optimize installation scripts

* added script to install directly from repository

* fixed serial-starter.d
#520

* smaller fixes

* fix #351

* fix System Switch in IO page

* fix #239
by @TimGFoley

* fix black lint errors

* run code analyse only on code change

* fix #311

* Separate Time-To-Go and Time-To-SoC activation

* remove duplicated and incorrect log message on handle_changed_setting

* properly log max battery currents on startup

* optimize uninstall script

* fix typo in log_settings

* add charge mode display

* Added: Temp name for sensor 1 & 2
Added the possibility to give a name to temperature sensor 1 & 2
This allows to see which sensor is low and high

* Added: Choose how battery temperature is assembled

* fix black lint errors

* Added/Changed alarms for JKBMS
* Added: HighInternalTemperature alarm for JKBMS
* Changed: Temperature alarm to not trigger all in the same condition

* Removed Alarms/HighCellVoltage
It does not exist on the dbus

* Changed: Moved charge mode
from IO page to Paramaters page

* Merge branch 'master' into master

* Added: Show (dis)charge current limitation reason

* Added changelog

* corrected file permissions

* Update readme

* Small word case changes

* fix dbus-daemon memory leak

`poll_battery` is already called from the dbus mainloop in a separate thread. Opening a new thread here (and especially never closing it) will accumulate threads and leads to problems like `dbus-daemon` memory usage increasing over time, leading to eventual reboot
by @seidler2547

* Added: Show specific TimeToSoC points in GUI
Only if 0%, 10%, 20%, 80%, 90% and/or 100% are selected

* fix black lint error

* removed wildcard import, fixed black lint errors

* removed wildcard import, fixed black lint errors

* remove old log message in handle_changed_setting()

* simplified condition for Time-To-Go/Soc

* fix renogy import

* added BMS info and cleanup
* MNB
* Revov
* Sinowealth

* moved BMS to subfolder

* Added self.unique_identifier to the battery class
Used to identify a BMS when multiple BMS are connected
planned for future use

* fix small errors

* added linear voltage recalculation interval
In the config file can now be defined how often CVL, CCL and DCL is recalculated

* revert Daly adaption

* replaced penalty voltage calculation
with automatically calculated penalty voltages to simplify config
max voltage is kept until batteries are balanced

* flake config change

* updated changelog

* disabled ANT BMS by default
#479

* fix typo

* fixed wrong variable assignment
`str` instead of `int`

* updated battery template

* updated nightly script

* Fix for #450
#450

* Read charge/discharge limit JKBMS
#4

* updated release workflow

* updated readme

* deploy to github pages only
on changes in master or docusaurus branch

* cleanup

* GitHub pages config change

* Renamed scripts for better reading #532

* update docusaurus dependencies

* limitation reason cleanup

* changed default config settings
FLOAT_CELL_VOLTAGE from 3.350V to 3.375V
LINEAR_LIMITATION_ENABLE from False to True

* small typo fixes

* updated changelog

* fix disconnection behaviour & small fixes
* on disconnect, show '---' after 10s and 'not connected' after 60s by @transistorgit
* small fixes in shell script
* added restart driver script

* fixed file permission

* Added: apply max voltage if CVCM_ENABLE is False
before float voltage was applied

* Added: BMS disconnect behaviour
* Choose to block charge/discharge on disconnect
* Trigger Venus OS alarm

* Changed: Remove wildcard import from dbushelper.py

* Added: Show additional data in device page
* show self.unique_identifier as serial number
* show self.production as device name

* Added: JKBMS unique identifier & fixed data length

* move config.ini before update

* read production date by @tranistorgit
this adds the battery production date

* Changed: Merged all install files into one

* updated install docs for nightly build

* changed config backup

* changed release workflow

* changed release workflow

* changed release workflow

* optimized USB install method

* Daly improvements
* Set SoC on button press by @transistorgit
* Improved driver stability by @transistorgit & @mr-manuel

* moved production date and added custom field

---------

Co-authored-by: Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants