Coder Social home page Coder Social logo

bms-parser's Introduction

Github profile stats my language stats

bms-parser's People

Contributors

jakeler avatar nguyenmthien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bms-parser's Issues

Help connecting to Meritsun BMS

I'm attempting to connect to a Meritsun BMS over BLE. I have been able to connect to the device and list its characteristics, but I haven't gotten any useful information out of it as of yet. I'm kind of new to the whole BLE space, so right now I probably have some very feeble attempts at trying to convince thing to talk to me.

What I have found so far:

$ sudo bluetoothctl info
Device AC:23:3F:41:90:3B (public)
        Name: MSP-12V300Ah
        Alias: MSP-12V300Ah
        Paired: no
        Trusted: no
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (6e40fff0-b5a3-f393-e0a9-e50e24dcca9e)
        ManufacturerData Key: 0x0000
        ManufacturerData Value:
  4d 69 6e 65 77 20 54 65 63 68                    Minew Tech
        ServiceData Key: 0000ffe1-0000-1000-8000-00805f9b34fb
        ServiceData Value:
  ac 23 3f 41 90 3b                                .#?A.;
$ sudo ble-scan -d AC:23:3F:41:90:3B
Started deep scan of AC:23:3F:41:90:3B

SERVICE 6e40fff0-b5a3-f393-e0a9-e50e24dcca9e (Handle: 14): Unknown
     CHARACTERISTIC 6e40fff2-b5a3-f393-e0a9-e50e24dcca9e (Handle: 18): Unknown ['write-without-response', 'write']
     CHARACTERISTIC 6e40fff1-b5a3-f393-e0a9-e50e24dcca9e (Handle: 15): Unknown ['notify']
         DESCRIPTOR 00002902-0000-1000-8000-00805f9b34fb (Handle: 17): Client Characteristic Configuration
SERVICE 00001801-0000-1000-8000-00805f9b34fb (Handle: 10): Generic Attribute Profile
     CHARACTERISTIC 00002a05-0000-1000-8000-00805f9b34fb (Handle: 11): Service Changed ['indicate']
         DESCRIPTOR 00002902-0000-1000-8000-00805f9b34fb (Handle: 13): Client Characteristic Configuration

If I attempt to read on that 6e40fff2 characteristic, then I'm getting a well-known packet out:

Attempting to read /org/bluez/hci0/dev_AC_23_3F_41_90_3B/service000e/char0012
[CHG] Attribute /org/bluez/hci0/dev_AC_23_3F_41_90_3B/service000e/char0012 Value:
  dd a5 04 00 ff fc 77                             ......w

I then proceeded with trying to set up ble-serial over this:

$ sudo ble-serial -d AC:23:3F:41:90:3B -r 6e40fff1-b5a3-f393-e0a9-e50e24dcca9e -w 6e40fff2-b5a3-f393-e0a9-e50e24dcca9e
22:30:56.889 | INFO | linux_pty.py: Slave created on /tmp/ttyBLE -> /dev/pts/3
22:30:56.890 | INFO | ble_interface.py: Receiver set up
22:30:56.902 | INFO | ble_interface.py: Trying to connect with AC:23:3F:41:90:3B
22:30:59.894 | INFO | ble_interface.py: Device AC:23:3F:41:90:3B connected
22:30:59.895 | INFO | ble_interface.py: Found write characteristic 6e40fff2-b5a3-f393-e0a9-e50e24dcca9e (H. 18)
22:30:59.895 | INFO | ble_interface.py: Found notify characteristic 6e40fff1-b5a3-f393-e0a9-e50e24dcca9e (H. 15)
22:31:00.071 | INFO | main.py: Running main loop!

But when I then attempted to run your code to try and query it, nothing really happens:

$ sudo python3 ./main.py /dev/pts/3 -v
> Request: dda50300fffd77
> Request: dda50400fffc77
> Request: dda50300fffd77
> Request: dda50400fffc77

and so it continues.

What am I missing here? How can I get this device to talk to me? I believe this is the BMS in question: https://www.meritsunpower.com/high-quality-3s-4s-8s-15s-16s-12v-24v-48v-bms-lifepo4-for-lithium-ion-battery-pack-with-balance

Great thanks in advance! :)

Wrong order in prot_list and fet_bits?

As reported by @mikspec

I tried to charge battery in negative temperature and parser returns ocp_short (10th bit set) however in reality it should return utp_charge - 5th bit (counting from 0). Parsing protection bits in reverse order seems fix the issue - in reverse order 10th bit became 5th.

Needs further verification, I have to admit that I haven't really tested these bits so far.

Package as python module

Use new packaging standard - poerty build.

Submodules:

  • parser
  • cli (main with DB connection)
  • tui (rich visualization, overview)

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.