Git Product home page Git Product logo

can-service's Introduction

can-service

hardware

  • Waveshare 2-CH CAN HAT (shop , wiki)
  • Raspberry Pi 4B

installation

/usr/sbin/ip link set can0 type can restart-ms 100
/usr/sbin/ip link set can1 type can restart-ms 100
/usr/sbin/ip link set can0 up type can bitrate 500000
/usr/sbin/ip link set can1 up type can bitrate 500000
/usr/sbin/ifconfig can0 txqueuelen 100
/usr/sbin/ifconfig can1 txqueuelen 100
  • chmod +x startscript.sh
  • sudo crontab -e and add @reboot /root/startscript.sh
  • (if running directly): run pip install -r requirements.txt in repository dir

run

directly

./service.py

docker compose

can-service:
  build: https://github.com/SunshadeCorp/can-service.git
  container_name: can-service
  depends_on:
    - mosquitto
  network_mode: host
  restart: unless-stopped
  volumes:
    - ./can-service/credentials.yaml:/usr/src/app/credentials.yaml:ro

mqtt messages

publish:

master
└─ can (running/stopped)
   ├─ available (online/offline)
   └─ [topic] ([float])

subscribe:

master
├─ can
│  ├─ start ([any])
│  ├─ stop ([any])
│  └─ [topic]
│     ├─ reset ([any])
│     └─ set ([float])
└─ relays
   └─ kill_switch (pressed)
esp-total
├─ total_voltage ([float])
└─ total_current ([float]) {positive = discharge, negative = charge}

current config.yaml topics:

battery
├─ current {positive = charge, negative = discharge}
├─ max_cell_temp
├─ min_cell_temp
├─ soc
├─ soh
├─ temp
└─ voltage
inverter
├─ battery_voltage (read only)
├─ soc (read only)
└─ timestamp (read only)
limits
├─ max_charge_current
├─ max_discharge_current
├─ max_voltage
└─ min_voltage

can-service's People

Contributors

arnemayer avatar jesseklm 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

Watchers

 avatar  avatar  avatar  avatar

can-service's Issues

Are BYD LVS BatteryBox Premium batteries also supported?

Though the repo clearly states that the code is intended for HVS batteries, I would like to know whether it is known if LVS batteries are also supported?
Also onto which version of the BYD CAN protocol this information is based? Is there a reference to an "official" or publicly available BYD CAN protocol information?

Thanks for the reply!

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.