mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Merge branch 'main' into unit-tests
This commit is contained in:
commit
cb95f4771d
15 changed files with 72 additions and 0 deletions
58
.github/workflows/compile-common-image-lilygo-logging.yml
vendored
Normal file
58
.github/workflows/compile-common-image-lilygo-logging.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# This is the name of the workflow, visible on GitHub UI.
|
||||||
|
name: 🔋 Compile Common Image for Lilygo with debug logging
|
||||||
|
|
||||||
|
# Here we tell GitHub when to run the workflow.
|
||||||
|
on:
|
||||||
|
# The workflow is run when a commit is pushed or for a
|
||||||
|
# Pull Request.
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
# This is the list of jobs that will be run concurrently.
|
||||||
|
jobs:
|
||||||
|
# This pre-job is run to skip workflows in case a workflow is already run, i.e. because the workflow is triggered by both push and pull_request
|
||||||
|
skip-duplicate-actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Map a step output to a job output
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5
|
||||||
|
with:
|
||||||
|
# All of these options are optional, so you can remove them if you are happy with the defaults
|
||||||
|
concurrent_skipping: 'never'
|
||||||
|
skip_after_successful_duplicate: 'true'
|
||||||
|
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
|
||||||
|
|
||||||
|
build-common-image:
|
||||||
|
# This is the platform GitHub will use to run our workflow.
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h
|
||||||
|
- name: Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h
|
||||||
|
run: cp ./Software/USER_SECRETS.TEMPLATE.h ./Software/USER_SECRETS.h
|
||||||
|
|
||||||
|
# We use the `arduino/setup-arduino-cli` action to install and
|
||||||
|
# configure the Arduino CLI on the system.
|
||||||
|
- name: Setup Arduino CLI
|
||||||
|
uses: arduino/setup-arduino-cli@v2
|
||||||
|
|
||||||
|
# We then install the platform.
|
||||||
|
- name: Install platform
|
||||||
|
run: |
|
||||||
|
arduino-cli core update-index
|
||||||
|
arduino-cli core install esp32:esp32
|
||||||
|
|
||||||
|
- name: Compile Sketch
|
||||||
|
run: arduino-cli compile --output-dir ./ --fqbn esp32:esp32:esp32 --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 --build-property "build.extra_flags=-Wall -Wextra -Wpedantic -Werror -DESP32 -DDEBUG_VIA_USB -DCOMMON_IMAGE -DHW_LILYGO" ./Software
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: battery-emulator-lilygo-debug.bin
|
||||||
|
path: Software.ino.bin
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h"
|
#include "../datalayer/datalayer_extended.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
// Function to check if a value has gone stale over a specified time period
|
// Function to check if a value has gone stale over a specified time period
|
||||||
bool BmwIXBattery::isStale(int16_t currentValue, uint16_t& lastValue, unsigned long& lastChangeTime) {
|
bool BmwIXBattery::isStale(int16_t currentValue, uint16_t& lastValue, unsigned long& lastChangeTime) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h"
|
#include "../datalayer/datalayer_extended.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
const unsigned char crc8_table[256] =
|
const unsigned char crc8_table[256] =
|
||||||
{ // CRC8_SAE_J1850_ZER0 formula,0x1D Poly,initial value 0x3F,Final XOR value varies
|
{ // CRC8_SAE_J1850_ZER0 formula,0x1D Poly,initial value 0x3F,Final XOR value varies
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
//Code still work in progress, TODO:
|
//Code still work in progress, TODO:
|
||||||
//Figure out if CAN messages need to be sent to keep the system happy?
|
//Figure out if CAN messages need to be sent to keep the system happy?
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
#include "../system_settings.h"
|
#include "../system_settings.h"
|
||||||
|
|
||||||
const unsigned char crc8_table[256] =
|
const unsigned char crc8_table[256] =
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h"
|
#include "../datalayer/datalayer_extended.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
void KiaHyundai64Battery::
|
void KiaHyundai64Battery::
|
||||||
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for modbus
|
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for modbus
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO list
|
TODO list
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../communication/contactorcontrol/comm_contactorcontrol.h"
|
#include "../communication/contactorcontrol/comm_contactorcontrol.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MG HS PHEV 16.6kWh battery integration
|
MG HS PHEV 16.6kWh battery integration
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
There seems to be some values on the Kangoo that differ between the 22/33 kWh version
|
There seems to be some values on the Kangoo that differ between the 22/33 kWh version
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
void VolvoSpaBattery::
|
void VolvoSpaBattery::
|
||||||
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for the inverter
|
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for the inverter
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
#include "../datalayer/datalayer_extended.h" //For "More battery info" webpage
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
void VolvoSpaHybridBattery::
|
void VolvoSpaHybridBattery::
|
||||||
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for the inverter
|
update_values() { //This function maps all the values fetched via CAN to the correct parameters used for the inverter
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
/* This implements Chevy Volt / Ampera charger support (2011-2015 model years).
|
/* This implements Chevy Volt / Ampera charger support (2011-2015 model years).
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include "../utils/events.h"
|
#include "../utils/events.h"
|
||||||
#include "../utils/logging.h"
|
#include "../utils/logging.h"
|
||||||
|
#include "USER_SETTINGS.h"
|
||||||
|
|
||||||
#if defined(WIFI) || defined(WEBSERVER)
|
#if defined(WIFI) || defined(WEBSERVER)
|
||||||
const bool wifi_enabled_default = true;
|
const bool wifi_enabled_default = true;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
/* Based on info from this excellent repo: https://github.com/FozzieUK/FoxESS-Canbus-Protocol */
|
/* Based on info from this excellent repo: https://github.com/FozzieUK/FoxESS-Canbus-Protocol */
|
||||||
/* The FoxESS protocol emulates the stackable (1-8) 48V towers found in the HV2600 / ECS4100 batteries
|
/* The FoxESS protocol emulates the stackable (1-8) 48V towers found in the HV2600 / ECS4100 batteries
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../communication/can/comm_can.h"
|
#include "../communication/can/comm_can.h"
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
#include "../devboard/utils/events.h"
|
#include "../devboard/utils/events.h"
|
||||||
|
#include "../devboard/utils/logging.h"
|
||||||
|
|
||||||
#define NUMBER_OF_MODULES 0
|
#define NUMBER_OF_MODULES 0
|
||||||
#define BATTERY_TYPE 0x50
|
#define BATTERY_TYPE 0x50
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue