Coder Social home page Coder Social logo

Comments (6)

Tertiush avatar Tertiush commented on August 23, 2024

Hi hi, which version are you using?

Then, please use the maximum debug level to see which part of the code is throwing this error. I can then build better error handling into that portion.

from bmspace.

GerhardLang avatar GerhardLang commented on August 23, 2024

Will do and post as soon as the error is back.

from bmspace.

GerhardLang avatar GerhardLang commented on August 23, 2024

The error did not occur anymore. So this is not reproduceable. So only div by 0 is still open see other issue.

from bmspace.

asdt1803 avatar asdt1803 commented on August 23, 2024

Hello @Tertiush ,

I experience the same problem with my 4 Gobel Batteries as @GerhardLang does. This happens sporadically a few times a day. I added some additional debug output to the script and it seems that sometimes the script (2.2.3dev) starts reading the cell voltages of my third pack at the wrong position in inc_data (6 bytes early). Please see attached debug log. Subsequently the figures for pack 4 are also implausible. The incoming data seems to be valid, though.

I was not yet able to identify the root cause of the problem but I found a quick and dirty hack that solves the problem for me by correcting the byte_index before the script starts iterating the cells voltages:

        byte_corrected = 6 + ((p-1) * 146)
        if byte_index != byte_corrected:
            print("Wrong start byte index Pack: " +str(p) + " => " + str(byte_index) + " instead " + str(byte_corrected))
            byte_index = byte_corrected

Output in case the problem occurs: Wrong start byte index Pack: 3 => 292 instead 298

Maybe you could look into this? Thank you for your help

pace-bms-dev.log

from bmspace.

Tertiush avatar Tertiush commented on August 23, 2024

I think different vendors/versions of packs have slightly different firmwares which sporadically causes these issues. I had them before and fixed it using a while loop to find the cell count number preceding the cells values. When I find this value, e.g. 16 the parsing starts. Its likely that this value is sometimes present for another reason causing this false offset. Your fix will work for your firmware and cell count, but may not for all versions & cell counts out there.... TBH I don't have time to release special versions for different packs as its working fine for me and most out there. Can I suggest you make a fork, apply the fixes and release that to those with the same issue?

from bmspace.

asdt1803 avatar asdt1803 commented on August 23, 2024

Hello Tertiush,

You are absolutely right, the workaround mentioned above is specific for the BMS and firmware I'm using. I wrote this post before I found out what caused the problem and posted it hoping that might help you to identify the problem.
Now I think I identified the problem and suggested an generic fix in #32 that I think would make the workaround above obsolete.

from bmspace.

Related Issues (20)

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.